audio: Select device based on supported mic count
source_mic_type is obtained using max mic count. Default value
is dual mic.
If fluence is enabled, device is selected based on fluence type set
and mic count supported.
For VoiceRecognition source, channel count should be 1 to enable
fluence.
Add support for 3 and 4 channel recording.
Change-Id: I4c7229230b79830a66e25cc49d80f1e7090c0212
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index ad565de..2a7895c 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2009,6 +2009,8 @@
switch (channel_count) {
case 1:
case 2:
+ case 3:
+ case 4:
case 6:
break;
default:
@@ -3985,8 +3987,10 @@
bool is_low_latency = false;
*stream_in = NULL;
- if (check_input_parameters(config->sample_rate, config->format, channel_count) != 0)
+ if (check_input_parameters(config->sample_rate, config->format, channel_count) != 0) {
+ ALOGE("%s: invalid input parameters", __func__);
return -EINVAL;
+ }
in = (struct stream_in *)calloc(1, sizeof(struct stream_in));