summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-08-21 15:35:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-21 15:35:20 +0000
commit8f40bc559923f1c53f10c13b576249fc05fc0a5e (patch)
treea3f5c94ccc832fbc3d0aae196cf73cf6596b4d7f
parent772d85ad350f9a4b8844c72206b6e20b91332b62 (diff)
parent7de76b2d4d597b6984567e66208c9c0268ceaac9 (diff)
downloadlibhardware-8f40bc559923f1c53f10c13b576249fc05fc0a5e.tar.gz
Merge "Quick hack fix for USB accessory audio support" into lmp-dev
-rw-r--r--modules/usbaudio/alsa_device_proxy.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/usbaudio/alsa_device_proxy.c b/modules/usbaudio/alsa_device_proxy.c
index 63a27e70..e15f093c 100644
--- a/modules/usbaudio/alsa_device_proxy.c
+++ b/modules/usbaudio/alsa_device_proxy.c
@@ -66,6 +66,13 @@ void proxy_prepare(alsa_device_proxy * proxy, alsa_device_profile* profile,
proxy->alsa_config.period_size =
profile_get_period_size(proxy->profile, proxy->alsa_config.rate);
+ // Hack for USB accessory audio.
+ // Here we set the correct value for period_count if tinyalsa fails to get it from the
+ // f_audio_source driver.
+ if (proxy->alsa_config.period_count == 0) {
+ proxy->alsa_config.period_count = 4;
+ }
+
proxy->pcm = NULL;
}