diff options
author | qctecmdr <qctecmdr@localhost> | 2021-01-12 23:35:17 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2021-01-12 23:35:17 -0800 |
commit | 8b0868f1df77b9feba1aa8a2b24a003c919d7608 (patch) | |
tree | d0e63cd7f5c50ced55ac38fd57727f880caeb149 | |
parent | feeb11639df4160701777a5abc05be345e74d1eb (diff) | |
parent | 8ae5489bb7f785ee394ec61b59f94fb0d60eb8e9 (diff) |
Merge "hal: re-route VOIP TX path for enabling correct VOIP EC port"
-rw-r--r-- | hal/audio_hw.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 78f11828..7c732456 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2021, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright (C) 2013 The Android Open Source Project @@ -2983,6 +2983,30 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) } enable_audio_route(adev, usecase); + if (uc_id == USECASE_AUDIO_PLAYBACK_VOIP) { + struct stream_in *voip_in = get_voice_communication_input(adev); + struct audio_usecase *voip_in_usecase = NULL; + voip_in_usecase = get_usecase_from_list(adev, USECASE_AUDIO_RECORD_VOIP); + if (voip_in != NULL && + voip_in_usecase != NULL && + !(out_snd_device == AUDIO_DEVICE_OUT_SPEAKER || + out_snd_device == AUDIO_DEVICE_OUT_SPEAKER_SAFE) && + (voip_in_usecase->in_snd_device == + platform_get_input_snd_device(adev->platform, voip_in, + &usecase->stream.out->device_list,usecase->type))) { + /* + * if VOIP TX is enabled before VOIP RX, needs to re-route the TX path + * for enabling echo-reference-voip with correct port + */ + ALOGD("%s: VOIP TX is enabled before VOIP RX,needs to re-route the TX path",__func__); + disable_audio_route(adev, voip_in_usecase); + disable_snd_device(adev, voip_in_usecase->in_snd_device); + enable_snd_device(adev, voip_in_usecase->in_snd_device); + enable_audio_route(adev, voip_in_usecase); + } + } + + audio_extn_qdsp_set_device(usecase); /* If input stream is already running then effect needs to be |