title: WebRTC Android echo cancellation
body: <p>I would like to implement voice and video calling in android. I used this example project as reference: <a href="https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-android" rel="nofollow noreferrer">Amazon Kinesis Video Streams Android WebRTC SDK</a>
  Problem is that the microphone picks up the remote sounds which results in an extreme echoing effect. 
  We use this version:</p>
  
  <pre><code>org.webrtc:google-webrtc:1.0.30039
  </code></pre>
  
  <p>The AudioManager is in this mode:</p>
  
  <pre><code>audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
  audioManager.setSpeakerphoneOn(false);
  </code></pre>
  
  <p>This is what we tried without any effect:</p>
  
  <pre><code>WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
  WebRtcAudioUtils.useWebRtcBasedAcousticEchoCanceler();
  WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(true);
  WebRtcAudioUtils.useWebRtcBasedAutomaticGainControl();
  WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true);
  WebRtcAudioUtils.useWebRtcBasedNoiseSuppressor();
  WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googEchoCancellation", "true"));
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googEchoCancellation2", "true"));
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googDAEchoCancellation", "true"));
  
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googTypingNoiseDetection", "true"));
  
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googAutoGainControl", "true"));
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googAutoGainControl2", "true"));
  
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googNoiseSuppression", "true"));
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googNoiseSuppression2", "true"));
  
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googAudioMirroring", "false"));
  audioConstraints.mandatory.add(new MediaConstraints.KeyValuePair("googHighpassFilter", "true"));
  </code></pre>
  
  <p>I'm really lost here. How can I activate echo cancellation in android?</p>