Closed Bug 1381638 Opened 9 years ago Closed 8 years ago

Severe audio distortion/slowdown/delay sharing mic in multiple tabs (regression)

Categories

(Core :: WebRTC: Audio/Video, defect, P2)

56 Branch
defect

Tracking

()

VERIFIED FIXED
mozilla57
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- unaffected
firefox56 + verified
firefox57 + verified
firefox58 --- verified

People

(Reporter: jib, Assigned: padenot)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files, 5 obsolete files)

STRs: 1. Open https://jsfiddle.net/jib1/6oy8dmg4/ + share mic, in 5 tabs 2. Snap fingers Expected result: Responsive feedback in speakers. Actual result: After 5th tab opens, severe distortion of audio where audio slows down to half speed, and there's a multi-second delay. Alternative STRs: 1. In about:config, set dom.ipc.processCount = 1 and close all tabs 2. Open https://jsfiddle.net/jib1/6oy8dmg4/ + share mic, in 2 tabs Reproduced on OSX and Windows 10. Regression range: Last good revision: 15cc8dd663627ec12ecd4be11a69f0caad8e4e11 First bad revision: 29ac12c81bcda10a981dfe3371f70a9b17a19edd https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=15cc8dd663627ec12ecd4be11a69f0caad8e4e11&tochange=29ac12c81bcda10a981dfe3371f70a9b17a19edd Workaround: Increase dom.ipc.processCount to prolong the inevitable (more tabs needed to reproduce).
Rank: 14
Assignee: nobody → padenot
This is an assigned P1 bug without activity in two weeks. If you intend to continue working on this bug for the current release/iteration/sprint, remove the 'stale-bug' keyword. Otherwise we'll reset the priority of the bug back to '--' on Monday, August 28th.
Keywords: stale-bug
Attachment #8902296 - Flags: review?(rjesup)
Attachment #8902296 - Flags: review?(jib)
Attachment #8902296 - Attachment is patch: true
Comment on attachment 8902296 [details] [diff] [review] Bug 1381638 - Disable msg-per-document. r?jib r?jesup Review of attachment 8902296 [details] [diff] [review]: ----------------------------------------------------------------- Wfm.
Attachment #8902296 - Flags: review?(jib) → review+
Comment on attachment 8902296 [details] [diff] [review] Bug 1381638 - Disable msg-per-document. r?jib r?jesup r+, but hold on landing it for the moment until we coordinate with billm
Attachment #8902296 - Flags: review?(rjesup) → review+
Comment on attachment 8902242 [details] Bug 1381638 - Prevent sharing multiple input devices in the same process. clearing r? as we went a different direction.
Attachment #8902242 - Flags: review?(jib)
Mass change P1->P2 to align with new Mozilla triage process
Priority: P1 → P2
[Tracking Requested - why for this release]: Severe audio regression when used concurrently in tabs.
Assignee: padenot → rjesup
Status: NEW → ASSIGNED
Comment on attachment 8902242 [details] Bug 1381638 - Prevent sharing multiple input devices in the same process. https://reviewboard.mozilla.org/r/173770/#review185556 Discussed with jesup, and we've decided to take this patch for now and try to get it to 56. It's got a better chance of being approved at this point than "regress quantum".
Attachment #8902242 - Flags: review+
Comment on attachment 8908773 [details] [diff] [review] don't dynamically switch to/from fast-path gUM audio wrong bug
Attachment #8908773 - Attachment is obsolete: true
Attachment #8908773 - Flags: review?(jib)
Assignee: rjesup → padenot
Comment on attachment 8902242 [details] Bug 1381638 - Prevent sharing multiple input devices in the same process. https://reviewboard.mozilla.org/r/173770/#review185620 Nevermind, it broke applyConstraints.
Attachment #8902242 - Flags: review+ → review-
Attachment #8902242 - Attachment is obsolete: true
Attachment #8902296 - Attachment is obsolete: true
Attachment #8908886 - Flags: review?(rjesup)
Attachment #8908886 - Attachment is obsolete: true
Attachment #8908886 - Flags: review?(rjesup)
Attachment #8908933 - Flags: review?(rjesup)
Comment on attachment 8908933 [details] [diff] [review] Bug 1381638 - Prevent sharing multiple input devices in the same process. Review of attachment 8908933 [details] [diff] [review]: ----------------------------------------------------------------- r+ with comment change and optional code change. File a new bug to resolve the issue, or land this one under leave-open and put that number in there ::: dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ +471,5 @@ > } > > + // Until we fix (or wallpaper) support for multiple mic input > + // (Bug 1238038) fail allocation for a second device by blocking > + // sources with different Graphs // Until we fix bug XXXXX we need to block a second tab (OuterWindow) // from opening an already-open device. If it's the same tab, they // will share a Graph(), and we can allow it. @@ +476,5 @@ > + { > + auto* graph = aStream->Graph(); > + > + for (auto& source: mSources) { > + if (source->Graph() != graph) { I don't mind checking them all.... but it's useless since this code ensures they all match, so you only need to check one. You could code it as "if (!mSources.Empty() && aStream->Graph() != mSource[0].Graph()) { return NS_ERROR....}" But I'll also take this
Attachment #8908933 - Flags: review?(rjesup) → review+
Depends on: 1400488
Carrying forward r=jesup.
Attachment #8908933 - Attachment is obsolete: true
Attachment #8908945 - Flags: review+
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/62efa118ea7f Prevent sharing multiple input devices in the same process. r=jesup
Keywords: checkin-needed
Comment on attachment 8908945 [details] [diff] [review] Bug 1381638 - Prevent sharing multiple input devices in the same process. Approval Request Comment [Feature/Bug causing the regression]: Bug 1330360 [User impact if declined]: Sharing microphone in multiple tabs causes severe distortion of mic audio where it slows down to half speed (Vader voice), and there's continual build-up of multi-second delay, rendering microphone unusable in both tabs until both are closed, when the two tabs are in the same content process. Does not happen if tabs are in separate content processes. Workaround is to close mic-access in both tabs and try again, or open a new tab and hope to get a different process, if available. In contrast, with this band-aid patch, we instead fail getUserMedia() mic requests with "NotReadableError: Concurrent mic process limit.", but only when this would happen, to prevent the audio distortion. The first tab continues to work, but the second page sees getUserMedia failing, which sites generally check for already (users denying permission), and the workaround is the same. The thinking here is this is less embarrassing, as severely distorted audio is a poor user experience, and is directly attributable to the browser. We chose this band-aid fix to avoid regressing quantum (which reverting the original patch would have done). [Is this code covered by automated tests?]: No. Testing use across content processes is difficult in the tree. [Has the fix been verified in Nightly?]: Verified locally. Still on inbound. [Needs manual test from QE? If yes, steps to reproduce]: Use steps in comment 0. I also verified multiple getUserMedia calls from the same page still works here: https://jsfiddle.net/jib1/wemt0fvs/ [List of other uplifts needed for the feature/fix]: None [Is the change risky?]: Not risky. [Why is the change risky/not risky?]: It is not risky, because the patch reuses an existing failure path. We also only fail when there already are one or more active streams using MediaEngineWebRTCMicrophoneSource in the same content process, AND our MSG is different from theirs (bug 1330360 has different MSGs per document). [String changes made/needed]: none
Attachment #8908945 - Flags: approval-mozilla-release?
Attachment #8908945 - Flags: approval-mozilla-beta?
Tracking since this sounds like a bad regression. I'll come back to approve this for m-r (56) tomorrow to make sure it has landed on m-c successfully. Right now, m-c and beta (both 57) are still going to be synced periodically, so we don't need special uplift to beta.
To add to manual test steps: I also verified multiple getUserMedia calls from page and an iframe still works here: https://jsfiddle.net/jib1/90rfbspz/
That worked.
Attachment #8909152 - Flags: review?(rjesup) → review?(na-g)
Comment on attachment 8909152 [details] [diff] [review] Bug 1381638 - Change browser_devices_get_user_media_in_frame.js to test cam then cam+mic instead of mic then cam+mic, to avoid bug 1400488. Review of attachment 8909152 [details] [diff] [review]: ----------------------------------------------------------------- lgtm
Attachment #8909152 - Flags: review?(na-g) → review+
Flags: needinfo?(padenot)
Keywords: checkin-needed
Flags: qe-verify+
Please see comment 18 for approval uplift request which still stands (subsequent activity was to fix a test that prevented landing).
Comment on attachment 8908945 [details] [diff] [review] Bug 1381638 - Prevent sharing multiple input devices in the same process. This makes a workaround possible for users with multiple tabs sharing audio. Let's take it for the 56 RC build later today.
Attachment #8908945 - Flags: approval-mozilla-release?
Attachment #8908945 - Flags: approval-mozilla-release+
Attachment #8908945 - Flags: approval-mozilla-beta?
Attachment #8908945 - Flags: approval-mozilla-beta-
Build ID: 20170921220243 User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0 Verified as fixed on Firefox Nightly 58.0a1 on Windows 10 x 64, Mac OS X 10.12 and Ubuntu 16.04 x64.
Status: RESOLVED → VERIFIED
I have reproduced this issue using Firefox nightly from 2017.07.17 on Mac OS X 10.12. I can confirm this issue is fixed, I verified using Firefox 56.0-build4 on Mac OS X 10.12, Windows 7 x64 (build x86), Windows 10 x64 and Ubuntu 16.04 x64
Verified fixed in Nightly 57.0a1 (20170920220431) on Windows 10x64, MacOSX 10.12.6 and Ubuntu 16.04 x64.
See Also: → 1406027
Depends on: 1406027
See Also: 1406027
This makes testing a little annoying. I used to be able to test between two Firefox tabs. Is the plan to eventually reinstate the previous behavior?
No longer blocks: 1330360
Regressed by: 1330360
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: