diff options
author | Mike Lockwood <lockwood@google.com> | 2014-08-14 09:34:54 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2014-08-21 14:51:29 +0000 |
commit | 7de76b2d4d597b6984567e66208c9c0268ceaac9 (patch) | |
tree | 56802292446bf8a47e75fc7e6af5d8dd9aca0604 /modules | |
parent | af5187efbddfe7d47238ed28e48b13ca4b96b9fe (diff) | |
download | hardware_libhardware-7de76b2d4d597b6984567e66208c9c0268ceaac9.zip hardware_libhardware-7de76b2d4d597b6984567e66208c9c0268ceaac9.tar.gz hardware_libhardware-7de76b2d4d597b6984567e66208c9c0268ceaac9.tar.bz2 |
Quick hack fix for USB accessory audio support
tinyalsa fails to retrieve the correct value for the period count
from the f_audio_source driver and tries to use zero instead.
This wasn't a problem before because the usb audio HAL used hard coded values
that were compatible with the driver.
Bug: 16799652
Change-Id: I6f5b907a0699c58b071e9f419ed8e053a7d9dc77
Diffstat (limited to 'modules')
-rw-r--r-- | modules/usbaudio/alsa_device_proxy.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/usbaudio/alsa_device_proxy.c b/modules/usbaudio/alsa_device_proxy.c index 63a27e7..e15f093 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; } |