summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorSimon Wilson <simonwilson@google.com>2011-09-20 18:52:27 -0700
committerSimon Wilson <simonwilson@google.com>2011-09-20 19:13:28 -0700
commit50dbfeeaa0fde6244a0b2f7a591753d0112cadca (patch)
tree31c07c50f560c65a622e71a52829783273ce9eef /audio
parentd2610c75c1389ff323f2aa195b038d813a5291e2 (diff)
downloaddevice_samsung_tuna-50dbfeeaa0fde6244a0b2f7a591753d0112cadca.zip
device_samsung_tuna-50dbfeeaa0fde6244a0b2f7a591753d0112cadca.tar.gz
device_samsung_tuna-50dbfeeaa0fde6244a0b2f7a591753d0112cadca.tar.bz2
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
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c26
1 files changed, 21 insertions, 5 deletions
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,