androidaudiowebrtcwebrtc-android

WebRTC echo issues in Samsung S10, S21Ultra


We have an application which connects patient to doctor, doctor app is built on react, and patient app is build on Android.

I am using OPUS as audio codec, and VP8 as video Codec in our webRtc based application, but there is an echo issues 100% of the time in Samsung devices S10, S21 Ultra and having Android 11+.

By Echo I mean:

Doctor can hear his/her own voice back.

I have tried following:

            WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
            WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true);

Also, also set the audio manager mode to "MODE_IN_COMMUNICATION"

            audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);

Is ther anything to do with SDP manipulation? or is this a known bug in Samsung new devices?


Solution

  • So apparently echo issue is resolved by using the 3 flags below and "MODE_IN_COMMUNICATION"

    Tested on Samsung S21 Ultra.

            WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
            WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(true);
            WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true);
    
    
            // Audio Manager
            audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);