client-sdk-react-native icon indicating copy to clipboard operation
client-sdk-react-native copied to clipboard

Echo Cancellation is not working with some Android phones

Open iamianM opened this issue 10 months ago • 3 comments

Describe the bug

Echo Cancellation is not working with some Android phones with React Native. Similar to this issue: https://livekit-users.slack.com/archives/C07FVFGAUKX/p1733717251711189 Which was fixed in Swift with this PR: https://github.com/livekit/client-sdk-swift/pull/536/

The problem makes the AI unusable on some devices due to the AI speaking and then hearing itself and therefore going into a loop of talking to itself.

iamianM avatar Feb 05 '25 00:02 iamianM

This issue happens the entire call length and is only affected in speaker phone mode. I can confirm it happens on Samsung Z fold 3 and Samsung S20, but I think it affects a lot of Samsung devices, which make up like 90% of our Android users.

iamianM avatar Feb 08 '25 00:02 iamianM

@iamianM which audio mode is the app set to? are you using communications?

davidzhao avatar Feb 08 '25 00:02 davidzhao

@davidzhao we're using audio mode "inCommunication", some android phone works well while some others, like Samsungs, still pick echoes from the agent

pgrignaffini avatar Feb 11 '25 17:02 pgrignaffini

HI @davidliu
I'm also facing the same issue on an Android device. Getting lots of echo and unwanted voices like Giltchs in Samsung and some of the other deivces. Echo is also exist in ios devices as well

Here is my code useEffect(() => { let connect = async () => { // configure audio session prior to starting it. await AudioSession.configureAudio({ android: { preferredOutputList: ['speaker'], // See AudioManager // for details on audio and focus modes. audioTypeOptions: { manageAudioFocus: true, audioMode: 'normal', audioFocusMode: 'gain', audioStreamType: 'music', audioAttributesUsageType: 'media', audioAttributesContentType: 'unknown', }, }, }); await AudioSession.configureAudio({ios:{defaultOutput:"speaker"}}) await AudioSession.startAudioSession(); }; connect(); return () => { AudioSession.stopAudioSession(); }; }, []);

After that is making a WebRTC peer-to-peer connection.

Please help to resolve this As soon as you can

JahagirDS0 avatar Jul 25 '25 05:07 JahagirDS0

This might be a problem with Samsung phones in general https://stackoverflow.com/questions/46560814/acousticechocanceler-on-samsung-devices-not-working

AlexErrant avatar Aug 05 '25 13:08 AlexErrant

Same issue here — echo cancellation is not working. The AI ends up hearing its own voice and starts looping. Any update or solution for this? Thanks.

mits-lk avatar Nov 17 '25 12:11 mits-lk

@mits-lk
I'm still facing the same issue on iOS to iOS also in Android to Android

JahagirDS0 avatar Nov 17 '25 12:11 JahagirDS0

@mits-lk did you found any solution to this?

tarun7r avatar Nov 21 '25 14:11 tarun7r