hal: Do not force mono for VoIP Rx with stock configuration
HAL forces mono configuration for VoIP. This is due to VoIP
topology being configured as mono. However, pure AOSP
targets support VoIP with stereo configuration. HAL forcing
mono would lead to mismatched configuration. Correct this by
forcing mono only on vendor enhanced targets.
Change-Id: Icc63e14469ef67b5d916cebdba56a45910dcf28d
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 2343603..89b3dbe 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -5288,7 +5288,9 @@
__func__, frames, frame_size, bytes_to_write);
if (out->usecase == USECASE_INCALL_MUSIC_UPLINK ||
- out->usecase == USECASE_INCALL_MUSIC_UPLINK2) {
+ out->usecase == USECASE_INCALL_MUSIC_UPLINK2 ||
+ (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP &&
+ !audio_extn_utils_is_vendor_enhanced_fwk())) {
size_t channel_count = audio_channel_count_from_out_mask(out->channel_mask);
int16_t *src = (int16_t *)buffer;
int16_t *dst = (int16_t *)buffer;
@@ -6933,7 +6935,8 @@
if (!voice_extn_is_compress_voip_supported()) {
if (out->sample_rate == 8000 || out->sample_rate == 16000 ||
out->sample_rate == 32000 || out->sample_rate == 48000) {
- out->channel_mask = AUDIO_CHANNEL_OUT_MONO;
+ out->channel_mask = audio_extn_utils_is_vendor_enhanced_fwk() ?
+ AUDIO_CHANNEL_OUT_MONO : AUDIO_CHANNEL_OUT_STEREO;
out->usecase = USECASE_AUDIO_PLAYBACK_VOIP;
out->format = AUDIO_FORMAT_PCM_16_BIT;