client-sdk-react-native
client-sdk-react-native copied to clipboard
Echo Cancellation is not working with some Android phones
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.
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 which audio mode is the app set to? are you using communications?
@davidzhao we're using audio mode "inCommunication", some android phone works well while some others, like Samsungs, still pick echoes from the agent
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
This might be a problem with Samsung phones in general https://stackoverflow.com/questions/46560814/acousticechocanceler-on-samsung-devices-not-working
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
I'm still facing the same issue on iOS to iOS
also in Android to Android
@mits-lk did you found any solution to this?