echo cancellation on Jitsi not working after diconnecting AirPods
Categories
(Core :: WebRTC: Audio/Video, defect)
Tracking
()
People
(Reporter: karlt, Assigned: karlt)
References
Details
Attachments
(4 files)
Steps to reproduce:
- Start a WebRTC call on meet.jit.si from Laptop A within builtin microphone and speakers.
- Join the call from Laptop B, a Mac with system default audio output to AirPods.
The audio menu in Jitsi shows AirPods and MacBook Pro Speakers but neither are checked for Speakers. Audio on the call is good. - Put the AirPods away in their box. The system default audio output switches to the MacBook Pro Speakers and this becomes checked in Jitsi's audio menu.
- Speak into the microphone of Laptop A.
Expected: Hear little or nothing in speakers of Laptop A.
Actual: Hear clear echo in Laptop A, reproducible for at least 30 seconds.
This eventually resolves within several minutes.
Laptop B was using Firefox version 123.
This did not reproduce with media.setsinkid.enabled switched to false, in which case there is no option to display or change Speakers in Jitsi's audio menu.
I was not able to reproduce on Windows 11: on removal of a wired device, Jitsi does not place a check mark beside any speakers in its audio menu.
If step 3 is replaced with explicitly "Select MacBook Pro Speakers in Jitsi's audio menu", then a similar echo is heard but this resolves after a few seconds.
Comment 1•9 months ago
|
||
jib: Any chance this is a slightly more involved version of Bug 1879204?
Comment 2•9 months ago
•
|
||
I doubt it. Bug 1879204 is about letting apps detect the OS switching the system default, unrelated to setSinkId and echo. If we assume Jitsi isn't turning off echo cancellation — which seems fair to assume, though can be hard ruled out I suppose with repro steps of production sites — the lack of echo cancellation here seems like a bug in Firefox closer to bug 1879180 or bug 1880997.
This seems hard to repro in a fiddle without a second machine or headset to keep the expectation of echo low.
Karl, since you have a setup to repro this, any idea if this is a regression?
Assignee | ||
Comment 3•9 months ago
•
|
||
I observed this on a call with Dan, but I don't have a Mac or AirPods myself to reproduce.
The behavior change with "media.setsinkid.enabled" implies that setSinkId()
is involved here. There was a general AEC regression due to setSinkId()
becoming available in version 116 for bug 1498512. The general case was largely addressed in version 123 for bug 1849108. The lack of AEC with setSinkId()
over that period would obscure any other influencing changes.
I'll add some logging so we can check whether Jitsi is setting echoCancellation
off through constraints.
Assignee | ||
Comment 4•9 months ago
|
||
This restores logging of a constraint removed in
https://hg.mozilla.org/mozilla-central/rev/4c8284f52c8be9ab5d382a79067567374613cb4d#l3.12
It was still possible to determine whether echoCancellation was on from
the presence or absence of "AudioProcessing statistics" lines with
MediaManager:4 logging if more than half a second of audio was processed, but
this "Audio config" line is more explicit and collects associated info
together.
Updated•9 months ago
|
Updated•9 months ago
|
Assignee | ||
Comment 5•9 months ago
|
||
Assignee | ||
Updated•9 months ago
|
Comment 8•9 months ago
|
||
bugherder |
Updated•9 months ago
|
Comment 9•9 months ago
|
||
bugherder |
Assignee | ||
Comment 10•9 months ago
|
||
Comment 11•8 months ago
|
||
Comment 12•8 months ago
|
||
bugherder |
Assignee | ||
Comment 13•8 months ago
|
||
Dan and I reproduced this again with some logging.
- Jitsi doesn't always mark MacBook Pro Speakers with a check in its menu after step 3.
- When it does not mark MacBook Pro Speakers, the drift controller does not start and the problem does not occur.
- When it does mark MacBook Pro Speakers, AEC is configured on in the new "Mic source", and the MediaTrackGraph is using the output to the secondary device for AEC reverse stream, as expected.
When switching to MacBook Pro Speakers manually, the same symptoms do sometimes occur. When that happens, the drift controller is making some significant adjustments to the audio rate, so this may be related to bug 1880997 comment 11. The attached file contains logging from this case. The drift controller's buffering target increases to 720ms due to a few underruns.
- When buffering was increased from 90 to 180 ms, it quickly dropped to 117.8ms after 1 s and 41.6ms after 5s, even though the drift controller was slowing the consumption of data.
- Buffering increased to 87.57ms, but then underran.
- The 360ms of buffering then added was consumed within 8 seconds. The controller was slowing the consumption rate by 48000/48866.66 ~ 1.8% when the underrun occurred.
- When the desired 720ms of buffering was eventually reached (about 3.5 minutes after the start of the call, the controller increased the consumption rate by 48000/47736.03 ~ 0.55% to reduce the buffering.
Comment 14•8 months ago
|
||
Those underruns seem unexpected during normal operation. Were they triggered by some user action?
Assignee | ||
Comment 15•8 months ago
|
||
We don't have an explanation for the underruns. There were no further user changes after switching to the MacBook Pro Speakers, which triggered creation of the drift controller in the log. Underruns were still happening 1 minute after the switch, which was well after audio was successfully output to the speakers, and so would seem a long period for start-up issues. The system was an M1 Mac and wasn't doing any other heavy processing at the time.
Comment 16•2 months ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:karlt, maybe it's time to close this bug?
For more information, please visit BugBot documentation.
Assignee | ||
Updated•2 months ago
|
Description
•