livekit / client-sdk-android

LiveKit SDK for Android
https://docs.livekit.io
Apache License 2.0
169 stars 68 forks source link

if both parties choose to turn on the speaker: Speakerphone, there will be loud noise #271

Closed wzJun1 closed 7 months ago

wzJun1 commented 11 months ago

Describe the bug

if both parties choose to turn on the speaker: Speakerphone, there will be loud noise.

The same problem occurs in sample-app, even if the distance is far.

but this is not the case in version 1.2.0.

To Reproduce Steps to reproduce the behavior:

  1. Select Audio Device: Speakerphone

Device Info:

davidliu commented 11 months ago

Are you talking about two speakerphones close by, causing microphone feedback?

wzJun1 commented 11 months ago

@davidliu

No, they are not close. The distance between the two mobile phones may be 10-15 meters. There will still be obvious noise and loud sound as long as both parties turn on the speakers.

When I tested it in the sample App, I also found the same problem.

davidzhao commented 11 months ago

This is expected.. echo cancellation cannot cancel feedback from another device nearby.

That is a limitation of audio stack on mobile devices today.

wzJun1 commented 11 months ago

This is expected.. echo cancellation cannot cancel feedback from another device nearby.

That is a limitation of audio stack on mobile devices today.

Why doesn't 1.2.0 have this problem?

At the same distance, the version only changed from 1.2.0 to 1.4.0

davidzhao commented 11 months ago

interesting, does 1.2.0 not show any feedback at all? There are quite a few changes since then. Some are related to the audio stack.

Which audio mode are you using?

wzJun1 commented 11 months ago

@davidzhao

No parameters are given, everything is default

wzJun1 commented 11 months ago

I have tested that the sample App of 1.2.0 and the sample App of 1.4.0 can be reproduced without modifying anything. You can test it by running it directly and turning on the speaker.

https://github.com/livekit/client-sdk-android/tree/main/sample-app

mayurappscripde commented 11 months ago

Facing same issue

mayurappscripde commented 11 months ago

It will work normal if you set audioHandler.audioMode = AudioManager.MODE_NORMAL. here default mode is MODE_IN_COMMUNICATION. it cause an issue

wzJun1 commented 11 months ago

It will work normal if you set audioHandler.audioMode = AudioManager.MODE_NORMAL. here default mode is MODE_IN_COMMUNICATION. it cause an issue

Really? I'll give it a try, thank you

initpwn commented 10 months ago

Any update on this? We're facing the same issue. Both parties are distant, getting loud noise on speaker mode.

wzJun1 commented 8 months ago

@mayurappscripde @initpwn @davidzhao

Invalid.

I reset audiomode = AudioManager.MODE_NORMAL, it doesn't work. noise still loud.

I found that the android demo also has this issue, Including the latest version 1.5.3, haven't the staff noticed it?

It will work normal if you set audioHandler.audioMode = AudioManager.MODE_NORMAL. here default mode is MODE_IN_COMMUNICATION. it cause an issue

wzJun1 commented 7 months ago

fixed by 1.6.0 #298