From 1211eb8b499aa607f3360093bcf97089ef1eb9b4 Mon Sep 17 00:00:00 2001 From: Dheeraj CVR Date: Sat, 28 Sep 2013 18:24:01 +0530 Subject: i9300: audio: properly set routing and standby after voice call Disabling the voice call route using voicecall_default_disable is not sufficient since there are additional routes which are used during a voice call, which have to be properly disabled. Also, set the input device to standy which prevents the mic from not working for the first time after a voice call. This could also serve a potential fix for battery drain issues after voice call. Change-Id: I0acd41deafd49da50857d6fe6396c3b5270d911c --- audio/audio_hw.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 091849f..3b269f9 100755 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -535,11 +535,18 @@ static void select_mode(struct m0_audio_device *adev) end_call(adev); force_all_standby(adev); - /* Disable voicecall route */ - ALOGE("Disabling voicecall route"); + ALOGD("%s: set voicecall route: voicecall_default_disable", __func__); set_voicecall_route_by_array(adev->mixer, voicecall_default_disable, 1); + ALOGD("%s: set voicecall route: default_input_disable", __func__); + set_voicecall_route_by_array(adev->mixer, default_input_disable, 1); + ALOGD("%s: set voicecall route: headset_input_disable", __func__); + set_voicecall_route_by_array(adev->mixer, headset_input_disable, 1); + ALOGD("%s: set voicecall route: bt_disable", __func__); + set_voicecall_route_by_array(adev->mixer, bt_disable, 1); select_output_device(adev); + //Force Input Standby + adev->in_device = AUDIO_DEVICE_NONE; select_input_device(adev); } } @@ -3022,7 +3029,7 @@ static int adev_open(const hw_module_t* module, const char* name, pthread_mutex_lock(&adev->lock); adev->mode = AUDIO_MODE_NORMAL; adev->out_device = AUDIO_DEVICE_OUT_SPEAKER; - adev->in_device = AUDIO_DEVICE_IN_BUILTIN_MIC & ~AUDIO_DEVICE_BIT_IN; + adev->in_device = AUDIO_DEVICE_NONE; select_devices(adev); /* +30db boost for mics */ -- cgit v1.1