From 73f72105c4b671624613cc132bfa86cfc956318b Mon Sep 17 00:00:00 2001 From: Bjorn Volcker Date: Wed, 3 Jun 2015 14:50:15 +0200 Subject: [PATCH] Actively turns off platform-AEC when DA-AEC is used When initiating a call default audio options are applied, which turns on platform-AEC if such exists. Then, if delay agnostic AEC (DA-AEC) is enabled through a media constraint no action with respect to platform-AEC is taken (a bug) and turning on SW AEC. Hence, we run both AECs. This CL makes sure the platform-AEC is disabled if we want to run DA-AEC. BUG= TESTED=locally on Nexus 4 and Nexus 6. R=henrika@webrtc.org, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/52049004 Cr-Commit-Position: refs/heads/master@{#9361} --- talk/media/webrtc/webrtcvoiceengine.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/talk/media/webrtc/webrtcvoiceengine.cc b/talk/media/webrtc/webrtcvoiceengine.cc index a429feebf..aad0d43aa 100644 --- a/talk/media/webrtc/webrtcvoiceengine.cc +++ b/talk/media/webrtc/webrtcvoiceengine.cc @@ -689,12 +689,14 @@ bool WebRtcVoiceEngine::ApplyOptions(const AudioOptions& options_in) { // TODO(henrika): investigate possibility to support built-in EC also // in combination with Open SL ES audio. const bool built_in_aec = voe_wrapper_->hw()->BuiltInAECIsAvailable(); - if (built_in_aec && !use_delay_agnostic_aec) { + if (built_in_aec) { // Built-in EC exists on this device and use_delay_agnostic_aec is not // overriding it. Enable/Disable it according to the echo_cancellation // audio option. - if (voe_wrapper_->hw()->EnableBuiltInAEC(echo_cancellation) == 0 && - echo_cancellation) { + const bool enable_built_in_aec = + echo_cancellation && !use_delay_agnostic_aec; + if (voe_wrapper_->hw()->EnableBuiltInAEC(enable_built_in_aec) == 0 && + enable_built_in_aec) { // Disable internal software EC if built-in EC is enabled, // i.e., replace the software EC with the built-in EC. options.echo_cancellation.Set(false);