CirrusLogic / tinyhal

Configurable audio HAL for Android
Apache License 2.0
32 stars 17 forks source link

tinyhal: audio: Impl channel adjustment for input sound flow #10

Closed AlexBobro closed 3 months ago

AlexBobro commented 4 years ago

Hello.

We have detected the issue on RCAR3 platform where high level applications can not capture a sound through Tinyhal with requested channel count less than 8. This occurs because the min-max interval for allowed channel count values is set to [8..8] in 'pcm3168a' driver, so pcm_open() function returns error in case requested count != 8. But only AUDIO_CHANNEL_IN_MONO & AUDIO_CHANNEL_IN_STEREO channel masks are supported by functionality in alsa_device_profile.c file ('alsa_utils' directory). So it is required to apply the current patch, which provides a channel adjustment for input sound by converting the N-channel flow (N - supported by driver) to requested Mono or Stereo flow. When this patch is merged, we will be able to fix described problem just by a setting IN_CHANNEL_COUNT_DEFAULT and 'in->hw_channel_count' to the value N supported by our driver.

AlexBobro commented 3 years ago

I have excluded from this PR the commits provided by @AntonDehtiarov in his PR#9. Also I've rebased this PR onto current CirrusLogic/master.