aws / amazon-chime-sdk-js

A JavaScript client library for integrating multi-party communications powered by the Amazon Chime service.
Apache License 2.0
701 stars 473 forks source link

Audio echo on Firefox #2742

Closed andreisergiu98 closed 4 months ago

andreisergiu98 commented 1 year ago

What happened and what did you expect to happen?

Hello!

When using the internal speaker and microphone of a laptop, the sound from the speakers is picked up and sent to the other attendees. From our tests this issue affects only Firefox on Mac and Linux.

Noise reduction won't do much either if the sound coming from the speakers is from another attendee speaking.

We did some tests with other providers like Twilio and Google Meets and they are not affected by the problem.

Have you reviewed our existing documentation?

Reproduction steps

Setup chime meeting demo.

Join from a laptop using firefox, mac/linux, internal speakers and mic.

Join with another attendee and start speaking.

Observe as you hear yourself from the first attendee.

Amazon Chime SDK for JavaScript version

3.14.1

What browsers are you seeing the problem on?

Firefox

Browser version

116.0.3

Meeting and Attendee ID Information.

No response

Browser console logs

No logs for now.

avinashmidathada commented 1 year ago

Hello, have you tried enabling Echo Reduction to see if that solves the issue?

andreisergiu98 commented 11 months ago

Tested it out and is not helping Firefox. The thing is that it seems Google Meets and Twilio are able to filter the sound from the speakers without additional client side ml processing. Chrome works just fine without noise reduction. It looks like the native echo cancellation is not working at all with Chime and Firefox.

andreisergiu98 commented 10 months ago

@avinashmidathada

I found out the root cause. It seems that when adding all MediaStreamTracks in a single MediaStream the native echo cancellation will stop working. Instead, if all MediaStreams are renderer as is into individual AudioElements it works perfectly.

This is also the reason why it works on Google Meets or Twilio, because they don't combine all streams into one.

It's easiest to reproduce the issue on MacOS, but the issue exists on Windows and Linux too.

I'd like to state that this issue should have a very high priority, because if a single user joins from Firefox he will ruin the experience for everybody else. As for the user, he has to pause himself every time he stops talking.

jwhitaker-gridcog commented 6 months ago

hey @andreisergiu98 , did you have a reproduction for this? Is it arguably something that's a Firefox problem / unexpected behaviour? I'm tempted to go log something on Mozilla's Bugzilla, if you had a working repro that would give me a big head start. (I'm no relation to either aws/mozilla, just some guy who wants to use slack huddles in his firefox)

hensmi-amazon commented 6 months ago

Sorry for delayed response. I was not able to reproduce on my M2 but I'm not sure if something was wrong in my setup. I basically left my laptop speakers and mic on, and then went into a different room, joined from another device, and spoke trying to see if there was any echo.

I looked at bugzilla and found a handful of reports:

Could you elaborate on

It seems that when adding all MediaStreamTracks in a single MediaStream the native echo cancellation will stop working. Instead, if all MediaStreams are renderer as is into individual AudioElements it works perfectly. Was this a application side change or a modification to the SDK?

hensmi-amazon commented 4 months ago

Resolving due to time and unknown existence of original issue, but this can easily be reopened if needed.