From 97db870693753a7d90036fc19b769dd7e21f6157 Mon Sep 17 00:00:00 2001 From: Narsinga Rao Chella Date: Fri, 3 Oct 2014 13:34:45 -0700 Subject: hal: fix the input device selection for headphones Headset speaker output device and Speaker phone mic input device is an invalid device pair combination. Instead, select Handset mic input device for Headphones. Change-Id: I1bce425bd73d2f79b7dd78a7d5c701c43390b167 --- hal/msm8974/platform.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c index ff9076e0..92c80bd1 100644 --- a/hal/msm8974/platform.c +++ b/hal/msm8974/platform.c @@ -1659,7 +1659,8 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d goto exit; } } - if (out_device & AUDIO_DEVICE_OUT_EARPIECE) { + if (out_device & AUDIO_DEVICE_OUT_EARPIECE || + out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) { if (out_device & AUDIO_DEVICE_OUT_EARPIECE && audio_extn_should_use_handset_anc(channel_count)) { snd_device = SND_DEVICE_IN_AANC_HANDSET_MIC; @@ -1688,8 +1689,7 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d else snd_device = SND_DEVICE_IN_BT_SCO_MIC; } - } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER || - out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) { + } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) { if (my_data->fluence_type != FLUENCE_NONE && my_data->fluence_in_voice_call && my_data->fluence_in_spkr_mode) { @@ -1855,12 +1855,13 @@ snd_device_t platform_get_input_snd_device(void *platform, audio_devices_t out_d snd_device = SND_DEVICE_IN_HANDSET_MIC; } else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET) { snd_device = SND_DEVICE_IN_HEADSET_MIC; - } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER || - out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) { + } else if (out_device & AUDIO_DEVICE_OUT_SPEAKER) { if (channel_count == 2) snd_device = SND_DEVICE_IN_SPEAKER_STEREO_DMIC; else snd_device = SND_DEVICE_IN_SPEAKER_MIC; + } else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE) { + snd_device = SND_DEVICE_IN_HANDSET_MIC; } else if (out_device & AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) { if (adev->bt_wb_speech_enabled) { if (adev->bluetooth_nrec) -- cgit v1.2.3