From 50dbfeeaa0fde6244a0b2f7a591753d0112cadca Mon Sep 17 00:00:00 2001 From: Simon Wilson Date: Tue, 20 Sep 2011 18:52:27 -0700 Subject: audio: use right capture path for sub mic The sub mic is on the right capture path, so when the front end portion of the route is selected, the mic choice must be taken into account. Fixes the lack of sound in camcorder. Fixes bug 5350006 Change-Id: I347922af04a0114a8e269b9edea3eec260175f79 --- audio/audio_hw.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index df4ce44..ead714a 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -320,7 +320,7 @@ struct route_setting mm_ul2_bt[] = { }, }; -struct route_setting mm_ul2_amic[] = { +struct route_setting mm_ul2_amic_left[] = { { .ctl_name = MIXER_MUX_UL10, .strval = MIXER_AMIC0, @@ -334,6 +334,20 @@ struct route_setting mm_ul2_amic[] = { }, }; +struct route_setting mm_ul2_amic_right[] = { + { + .ctl_name = MIXER_MUX_UL10, + .strval = MIXER_AMIC1, + }, + { + .ctl_name = MIXER_MUX_UL11, + .strval = MIXER_AMIC1, + }, + { + .ctl_name = NULL, + }, +}; + /* VX UL front-end paths */ struct route_setting vx_ul_amic_left[] = { { @@ -856,7 +870,6 @@ static void select_input_device(struct tuna_audio_device *adev) int main_mic_on = 0; int sub_mic_on = 0; int bt_on = adev->devices & AUDIO_DEVICE_IN_ALL_SCO; - int anlg_mic_on; if (!bt_on) { if ((adev->mode != AUDIO_MODE_IN_CALL) && (adev->active_input != 0)) { @@ -871,8 +884,6 @@ static void select_input_device(struct tuna_audio_device *adev) } } - anlg_mic_on = headset_on | main_mic_on | sub_mic_on; - /* tear down call stream before changing route, * otherwise microphone does not function */ @@ -886,7 +897,12 @@ static void select_input_device(struct tuna_audio_device *adev) set_route_by_array(adev->mixer, mm_ul2_bt, 1); else { /* Select front end */ - set_route_by_array(adev->mixer, mm_ul2_amic, anlg_mic_on); + if (main_mic_on || headset_on) + set_route_by_array(adev->mixer, mm_ul2_amic_left, 1); + else if (sub_mic_on) + set_route_by_array(adev->mixer, mm_ul2_amic_right, 1); + else + set_route_by_array(adev->mixer, mm_ul2_amic_left, 0); /* Select back end */ mixer_ctl_set_enum_by_string(adev->mixer_ctls.right_capture, -- cgit v1.1