diff options
author | Ravi Kumar Alamanda <ralama@codeaurora.org> | 2015-09-24 19:17:26 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-09-25 14:41:22 -0700 |
commit | a2981bac4344d124b1448b0d0673c220805cfd13 (patch) | |
tree | e8a46c7a045113f3ebc7d6f9901f6b0d678ce811 | |
parent | dcd9804c334b860b4a8a5fabfb70d4d848b4edbd (diff) | |
download | hardware_qcom_audio-a2981bac4344d124b1448b0d0673c220805cfd13.tar.gz hardware_qcom_audio-a2981bac4344d124b1448b0d0673c220805cfd13.tar.bz2 hardware_qcom_audio-a2981bac4344d124b1448b0d0673c220805cfd13.zip |
hal: Fix EC not working with some VoIP app
Echo reference must be before starting input stream. But in
some cases, input stream is started first and then the output
stream. As the primary output is not started, echo reference is
set based on AUDIO_DEVICE_NONE.
Fix by using primary output's device even if it is in standby.
Bug: 23720819
Change-Id: I1cf2b93ea52219489964e09ee671ef008e81255c
-rw-r--r-- | hal/audio_hw.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 3b8d6e08..d44eeb45 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -649,12 +649,13 @@ int select_devices(struct audio_device *adev, out_snd_device = SND_DEVICE_NONE; if (in_snd_device == SND_DEVICE_NONE) { audio_devices_t out_device = AUDIO_DEVICE_NONE; - if (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION && - adev->primary_output && !adev->primary_output->standby) { - out_device = adev->primary_output->devices; + if (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION) { platform_set_echo_reference(adev, false, AUDIO_DEVICE_NONE); - } else if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) { - out_device = AUDIO_DEVICE_OUT_TELEPHONY_TX; + if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) { + out_device = AUDIO_DEVICE_OUT_TELEPHONY_TX; + } else if (adev->primary_output) { + out_device = adev->primary_output->devices; + } } in_snd_device = platform_get_input_snd_device(adev->platform, out_device); } |