[wfh] The input source is switched after muting and un-muting the sound
Categories
(Core :: WebRTC: Audio/Video, defect, P2)
Tracking
()
People
(Reporter: danibodea, Assigned: achronop)
References
(Regression)
Details
(Keywords: regression, Whiteboard: [wfh])
Attachments
(2 files)
Note
- When the user mutes the test case app and unmutes it again, the input source (mic) will be switched from external to integrated.
Affected versions
- all latest versions of the 4 main channels
Affected platforms
- Ubuntu 18
Steps to reproduce
- USB headphones ready to use, but not inserted in the laptop.
- Load test case: https://jsfiddle.net/jib1/n7bmkjnf.
- Permit the integrated microphone.
- Connect the USB headphones.
Notice: The input and output are being switched to the headphones. - Mute and unmute the sound, from the checkbox in the fiddle's bottom-right section.
Expected result
- The input source is still from the headphones mic.
Actual result
- The input source is switched back to the integrated mic.
Additional notes
- Could not reproduce on Windows 10, on the same laptop.
- It WAS reproduced on another laptop with Ubuntu 18.
- For SV team: this was reproduced on Laptop595.
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Updated•5 years ago
|
Reporter | ||
Comment 1•5 years ago
|
||
I attempted providing a regression range, but I was unable to finish it due to missing builds.
These are my results:
39:43.77 INFO: Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=1a0c506d69a80ee792d73b4090eeb5e755f17bf8&tochange=c4c1a90df788b7634da5a89f417bf55198172640
41:22.34 INFO: There are no build artifacts on inbound for these changesets (they are probably too old).
I thought that mozregression might be out of date, updated it and retried. I got another regression range:
20:03.34 INFO: Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=c4c1a90df788b7634da5a89f417bf55198172640&tochange=37b33c4f58b9372ad8d4fa969ad7a86ae305790a
I think this is the best I can do. If you do want me to reattempt it, please NI me.
Comment 2•5 years ago
|
||
Wow that's an old regression.
This looks like a shortcoming of mitigations added way back for lack of headset detection.
Notice: The input and output are being switched to the headphones.
As I mention in bug 1628689 comment 2, we shouldn't be doing this in the first place, which may explain why the mitigation turns into a pumpkin after mute/unmute.
Paul, thoughts? As I mention in the other bug maybe we should enable "audiooutput"
enumeration to facilitate headset detection, even if setSinkId
is not ready?
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
(In reply to Jan-Ivar Bruaroey [:jib] (needinfo? me) from comment #2)
As I mention in bug 1628689 comment 2, we shouldn't be doing this in the first place, which may explain why the mitigation turns into a pumpkin after mute/unmute.
Oh, this is the use case that I have asked for in Bug 1628689#c3. As I said we can do it if we want to.
Assignee | ||
Comment 4•5 years ago
|
||
Regarding the reported error, I cannot reproduce. I have tried the latest Nightly and Release. I am on fedora. Have you tried it on Nightly.
Updated•5 years ago
|
Comment 5•5 years ago
|
||
Hi Jan-Ivar, can you please (let) triage this bug? Thank you!
Updated•5 years ago
|
Comment hidden (obsolete) |
Comment 7•5 years ago
|
||
The fact that muting and unmuting changes source is clearly a bug from a user's perspective that I think we should remedy asap.
From my view, I see two ways to fix this (assuming my theory in comment 2 is correct):
- Improve our non-spec headset-magic mitigation, to survive mute/unmute (dig down further)
- Remove our non-spec headset-magic mitigation (dig up) and fix bug 1630289 instead to fix real WebRTC sites (not jsfiddle)
- Note: this won't fix jsfiddle in comment 0 since
Notice: The input and output are being switched to the headphones.
in step 4 is a spec violation, since it is up sites not browsers to do these switches (see bug 1630289).
- Note: this won't fix jsfiddle in comment 0 since
But I think Paul and/or Alex need to weigh in on whether this makes sense, since they're the experts on our implementation here. Another wrinkle is some OSes (macOS) appears to do some headset magic of their own, so I don't know how that fits in to all this.
Assignee | ||
Comment 8•5 years ago
|
||
Looking at the description again the problem is in step 4 that the input changes when the new input (the one in the headset) is plugged in.
Comment 9•5 years ago
|
||
(In reply to Alex Chronopoulos [:achronop] from comment #8)
Looking at the description again the problem is in step 4 that the input changes when the new input (the one in the headset) is plugged in.
That's not how I read the original report. Step 4 comments that the input source switches to the headphones, and the expected result is that the input source stays with the headphones. But instead it switches back to the mic, apparently while muting and unmuting as given in the bug title.
But this makes me realize that my bug is different; I'm talking about outputs, not inputs.
Comment 10•5 years ago
|
||
Step 4 comments that the input source switches to the headphones, and the expected result is that the input source stays with the headphones.
Can you show me spec support that says browsers should automatically switch an existing input source to headphones in the first place?
The gUM spec says: "Once selected, the source of the MediaStreamTrack MUST NOT change."
Even Chrome with its smart "Default" device respects this (I'm on mac):
Microphone (live): Default - MacBook Pro Microphone (Built-in)
That is: if I activate my airpods after starting that jsfiddle, the input source stays the same (laptop mic). I have to refresh the page to switch it:
Microphone (live): Default - JIB’s AirPods (Bluetooth)
Firefox doesn't even have this special device, so this is even more true in our model (the fiddle works the same way in Firefox).
Comment 11•5 years ago
|
||
So if linux works differently from comment 10 then that's the bug imho.
Comment 12•5 years ago
|
||
We've analyzed with alex yesterday that the way pulseaudio is configured on ubuntu by default auto-switches.
Assignee | ||
Comment 13•5 years ago
|
||
Yeah, Ubuntu has an extra configuration for hot-plugin. We can disable moving to the default device in cubeb level. I'll create patch.
Assignee | ||
Comment 14•5 years ago
|
||
Jan-Ivar, do you have an opinion about whether we need to disable moving for both input and output, or just input?
Assignee | ||
Comment 15•5 years ago
•
|
||
I take back the question to Jan-Ivar. We need the output to switch to the default device for playback also. When setSinkId
is in place we can consider it again.
Comment 16•5 years ago
•
|
||
Yeah these are separate questions I think. For one, the audio output spec has a clear concept of OS default in the API, and the notion that it may change. E.g. a user "is using a laptop with system audio directed to a USB headset".
Disclaimer on the mic question: I don't have a linux box. If someone who does could check how Chrome works on linux (ubuntu and/or other flavors) with the fiddle in comment 10 that would be great. If there's a strong OS pattern here perhaps it outweighs cross-platform web compat.
Assignee | ||
Comment 17•4 years ago
|
||
The fix for this one has landed upstream in https://github.com/djg/cubeb-pulse-rs/pull/54
Assignee | ||
Comment 18•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 19•4 years ago
|
||
Depends on D71929
Comment 20•4 years ago
|
||
Pushed by achronopoulos@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9b5ba030372a Update cubeb-pulse-rs. r=padenot https://hg.mozilla.org/integration/autoland/rev/2203d818a3b4 mach vendor rust. r=padenot
Comment 21•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9b5ba030372a
https://hg.mozilla.org/mozilla-central/rev/2203d818a3b4
Updated•4 years ago
|
Reporter | ||
Comment 22•4 years ago
|
||
I can confirm the verification of this fix. Thank you.
Description
•