hal: Add incall stereo capture
Add mixer control to pass channel config to kernel
to support incall stereo capture.
Bug: 79869195
Test: voice call regression
Change-Id: Ic2c9ebfc42cfc7a6e0d1a9facb4d2658f6c343cb
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 8a2562f..209cae9 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -5006,6 +5006,18 @@
in->capture_handle = handle;
in->flags = flags;
+ ALOGV("%s: source = %d, config->channel_mask = %d", __func__, source, config->channel_mask);
+ if (source == AUDIO_SOURCE_VOICE_UPLINK ||
+ source == AUDIO_SOURCE_VOICE_DOWNLINK) {
+ /* Force channel config requested to mono if incall
+ record is being requested for only uplink/downlink */
+ if (config->channel_mask != AUDIO_CHANNEL_IN_MONO) {
+ config->channel_mask = AUDIO_CHANNEL_IN_MONO;
+ ret = -EINVAL;
+ goto err_open;
+ }
+ }
+
if (is_usb_dev && may_use_hifi_record) {
/* HiFi record selects an appropriate format, channel, rate combo
depending on sink capabilities*/