How to solve Echo in Android webRTC audio when connected to multiple audio channels : <p>I have been using libjingle to make peer connection between four users to share data and also start audio channel.
It works ok most of the times but have issues of echo from one user which makes the call very unstable and hard to listen to users.</p>

<p>I have tried adding</p>

<pre><code>this.mediaConstraints.optional.add(new MediaConstraints.KeyValuePair("googNoiseSuppression", "true"));
this.mediaConstraints.optional.add(new MediaConstraints.KeyValuePair("googEchoCancellation", "true"));
</code></pre>

<p>I am adding these constraints in the optional parameters in case I add these in mandatory it disconnects the call and throws onRenegotiationNeeded method.</p>

<p>I have listed some cases such as :</p>

<p>1) This might be the cause of 1 user is in loudspeaker(or earphone is loud enough) that voice registers in mic and creates the echo. (But sometimes it happens without this reason as well)</p>

<p>2) There may be 1 audio channel registered twice and creating a reverb effect with same user sending data channel twice. (Cant find how to debug this, I count the audio channel and they are normal)</p>

<p>3) Two users are in the same room and echo happens (This is a normal case which happens but it's not a concern as its unavoidable)</p>

<p>I am looking for suggestions or solutions in case someone else got into such issue with Android webRTC library.</p>

<pre><code>implementation 'io.pristine:libjingle:9694@aar'
</code></pre>

<p>The library I am suing is this, but I also found out that latest webRTC official library is updated recently, would migrating to that solve any such issue ?</p>

<p>The latest library which I found is:</p>

<pre><code>implementation 'org.webrtc:google-webrtc:1.0.22672'
</code></pre>

<p>Any help would be highly appreciated.</p>

<p>Thanks</p>
