Closed
Bug 866514
Opened 10 years ago
Closed 10 years ago
getAudioTracks and getVideoTracks do not return the correct amount of tracks not too long after the media stream is given in JS
Categories
(Core :: WebRTC: Audio/Video, defect)
Core
WebRTC: Audio/Video
Tracking
()
VERIFIED
FIXED
mozilla23
People
(Reporter: jsmith, Assigned: roc)
References
Details
(Whiteboard: [WebRTC][blocking-webrtc-][qa-automation-blocked][parity-chrome])
Attachments
(5 files, 1 obsolete file)
1.01 KB,
text/html
|
Details | |
15.07 KB,
patch
|
jesup
:
review+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
13.21 KB,
patch
|
jesup
:
review+
|
Details | Diff | Splinter Review |
5.83 KB,
patch
|
jesup
:
review+
akeybl
:
approval-mozilla-aurora+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
5.88 KB,
patch
|
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
STR: 1. Load the attached test case 2. Inspect the console log Expected: Upon immediately getting access to the stream from the success callback in gUM, I'd expect that calling getAudioTracks or getVideoTracks should return the correct amount of tracks. Example - video only request should get 1 video track, 0 audio tracks. Actual: If you call getAudioTracks or getVideoTracks early in the timeframe when the stream is returned to JS, you will get the incorrect amount of tracks returned. I've seen this issue with the simple gUM test case attached and upon analyzing the various stream properties in PeerConnection while a handshake takes place.
Reporter | ||
Updated•10 years ago
|
tracking-firefox22:
--- → ?
tracking-firefox23:
--- → ?
Whiteboard: [WebRTC][blocking-webrtc+][qa-automation-blocked]
Reporter | ||
Updated•10 years ago
|
Whiteboard: [WebRTC][blocking-webrtc+][qa-automation-blocked] → [WebRTC][blocking-webrtc+][qa-automation-blocked][parity-chrome]
Assignee | ||
Comment 1•10 years ago
|
||
This is a bit of a problem because all stream setup is asynchronous. I think we might need to delay returning the MediaStream from the gUM callback until at least one MediaStreamTrack has appeared in its DOMMediaStream.
Updated•10 years ago
|
Assignee: nobody → roc
status-firefox21:
--- → disabled
status-firefox22:
--- → affected
status-firefox23:
--- → affected
Assignee | ||
Comment 2•10 years ago
|
||
This works. However, it does lead to the possibility of leaks due to a cycle involving the GetUserMediaRunnable, the TracksAvailableCallback, and the DOMMediaStream. The cycle will be removed as long as the required tracks eventually arrive, but if they don't, we'll leak :-(. The obvious way to fix that is to make GetUserMediaRunnable and TracksAvailableCallback participate in cycle collection. But currently no WebRTC code participates in cycle collection. I think it probably should, but someone has to make the call. This is hard to resolve in other ways. For one thing, I think the success and error getUserMediaCallbacks, since they wrap script objects, could also be involved in unexpected leaks though JS. Basically through the magic of JS expandos, any DOM/WebIDL object can have a path of strong references to any other DOM/WebIDL object.
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #745009 -
Flags: review?(rjesup)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #744114 -
Attachment is obsolete: true
Attachment #745010 -
Flags: review?(rjesup)
Assignee | ||
Comment 5•10 years ago
|
||
We need to manually keep the DOMMediaStream alive until the DOM tracks have been added, or it will be GCed and destroyed under us. But then there's a possibility of leaks if the DOM tracks are never added. So I jumped through some hoops to try to eliminate all possibility of leaks, by only waiting for the DOM tracks to be added if we can be really sure they will be added.
Updated•10 years ago
|
Attachment #745009 -
Flags: review?(rjesup) → review+
Updated•10 years ago
|
Attachment #745010 -
Flags: review?(rjesup) → review+
Assignee | ||
Comment 6•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/4609a4efeb39 https://hg.mozilla.org/integration/mozilla-inbound/rev/f110d0270f8e
Comment 7•10 years ago
|
||
Backed out: https://hg.mozilla.org/integration/mozilla-inbound/rev/e5972785237b https://hg.mozilla.org/integration/mozilla-inbound/rev/a081cfffeed0 for thread safety assertions on Windows XP and 7: https://tbpl.mozilla.org/php/getParsedLog.php?id=22605157&tree=Mozilla-Inbound https://tbpl.mozilla.org/php/getParsedLog.php?id=22604913&tree=Mozilla-Inbound https://tbpl.mozilla.org/php/getParsedLog.php?id=22605215&tree=Mozilla-Inbound https://tbpl.mozilla.org/php/getParsedLog.php?id=22604946&tree=Mozilla-Inbound and test failures on OSX: https://tbpl.mozilla.org/php/getParsedLog.php?id=22605176&tree=Mozilla-Inbound https://tbpl.mozilla.org/php/getParsedLog.php?id=22606107&tree=Mozilla-Inbound
Reporter | ||
Updated•10 years ago
|
Flags: in-testsuite?
Reporter | ||
Comment 8•10 years ago
|
||
Reporter | ||
Comment 9•10 years ago
|
||
Comment on attachment 745738 [details] [diff] [review] Basic gUM Media Stream Track Mochitests Here's some basic gUM mochitests to cover your patches up with some automation for media stream tracks.
Attachment #745738 -
Flags: review?(roc)
Assignee | ||
Comment 10•10 years ago
|
||
All the failures in comment #7 are the result of these patches. The thread-safety assertions should be easy to fix. The test failure is because a new stream returned by getUserMedia no longer has a currentTime of 0. E.g. if the video track is added after the audio track, we may have "played" some stream content while it was in the audio-only state. One way to fix this is to record the currentTime when all tracks were added and we returned the stream from getUserMedia, and subtract that from the currentTime we report via the DOM API. I'll try that. Sorry this is taking so long to land :-(
Assignee | ||
Comment 11•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/67d21aabfb75
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/67d21aabfb75 https://hg.mozilla.org/mozilla-central/rev/531c57d87cf4
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Reporter | ||
Comment 13•10 years ago
|
||
Roc - When you are ready, can you take a look at the mochitests included here?
Keywords: verifyme
Updated•10 years ago
|
Whiteboard: [WebRTC][blocking-webrtc+][qa-automation-blocked][parity-chrome] → [WebRTC][blocking-webrtc+][qa-automation-blocked][parity-chrome][webrtc-uplift]
Reporter | ||
Comment 14•10 years ago
|
||
lgtm on 5/9 nightly build
Comment 15•10 years ago
|
||
Comment on attachment 745009 [details] [diff] [review] Part 1: Add DOMMediaStream::OnTracksAvailableCallback [Approval Request Comment] Bug caused by (feature/regressing bug #): 834835 (already uplifted) User impact if declined: Crashes if GC runs after certain operations; or requiring backout of an important compatibility feature (bug 834835) Testing completed (on m-c, etc.): On MC. One regression (bug 870002) from either this bug, bug 8663224 or bug 868406 (all of which need uplift except bug 868406). The regression is windows-only, and refuses to produce a minidump; we're planning on taking a test machine offline to run the tests in a way that we can grab a dump. The regression only affects use of this new feature, and it has not been seen yet except on the test servers. Risk to taking this patch (and alternatives if risky): moderate - the risk is involved in resolving bug 870002 or deciding/finding-out that it's very hard to hit in practice (as opposed to tests). We can also back out this bug 866514 if it's found to be the cause, or back out all of these and bug 834835, though that would be a painful decision as it would push developers to use "back-door"/non-standard ways to figure out if a stream has video, or they'd write code that works in Chrome but not in Firefox. String or IDL/UUID changes made by this patch: none
Attachment #745009 -
Flags: approval-mozilla-aurora?
Comment 16•10 years ago
|
||
Comment on attachment 745009 [details] [diff] [review] Part 1: Add DOMMediaStream::OnTracksAvailableCallback This is going to be heading to Beta now (if approved) since Merge Day has completed.
Attachment #745009 -
Flags: approval-mozilla-aurora? → approval-mozilla-beta?
Updated•10 years ago
|
Attachment #745009 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Updated•10 years ago
|
Attachment #745738 -
Flags: review+
Comment 17•10 years ago
|
||
I suspect the test doesn't need separate review from roc
Reporter | ||
Comment 18•10 years ago
|
||
Comment on attachment 745738 [details] [diff] [review] Basic gUM Media Stream Track Mochitests Yeah, only one review is needed.
Attachment #745738 -
Flags: review?(roc)
Reporter | ||
Updated•10 years ago
|
Keywords: checkin-needed
Reporter | ||
Comment 19•10 years ago
|
||
Comment on attachment 745738 [details] [diff] [review] Basic gUM Media Stream Track Mochitests [Approval Request Comment] Bug caused by (feature/regressing bug #): N/A User impact if declined: No automated tests for this patch. Testing completed (on m-c, etc.): Tests pass locally. Risk to taking this patch (and alternatives if risky): None - this is a test only patch. String or IDL/UUID changes made by this patch: None
Attachment #745738 -
Flags: approval-mozilla-beta?
Attachment #745738 -
Flags: approval-mozilla-aurora?
Comment 20•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/b1f22b1e69ac
Flags: in-testsuite? → in-testsuite+
Keywords: checkin-needed
Comment 21•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-beta/rev/61d42001197a https://hg.mozilla.org/releases/mozilla-beta/rev/30b3a3038c02 We'll see if bug 870002 rears its ugly head on beta now.
Updated•10 years ago
|
Attachment #745738 -
Flags: approval-mozilla-beta?
Attachment #745738 -
Flags: approval-mozilla-beta+
Attachment #745738 -
Flags: approval-mozilla-aurora?
Attachment #745738 -
Flags: approval-mozilla-aurora+
Reporter | ||
Comment 22•10 years ago
|
||
checkin-needed to land the tests on aurora and beta
Keywords: checkin-needed
Reporter | ||
Updated•10 years ago
|
Comment 23•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/b1f22b1e69ac
Keywords: checkin-needed
Updated•10 years ago
|
Keywords: checkin-needed
Comment 24•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/154a0b681893 https://hg.mozilla.org/releases/mozilla-beta/rev/8f3fb4aa0107
Keywords: checkin-needed
Reporter | ||
Comment 25•10 years ago
|
||
Patch auto-verified by landing in comment 24.
Reporter | ||
Updated•10 years ago
|
Whiteboard: [WebRTC][blocking-webrtc+][qa-automation-blocked][parity-chrome][webrtc-uplift] → [WebRTC][blocking-webrtc+][qa-automation-blocked][parity-chrome]
Comment 26•10 years ago
|
||
Beta backout patch since we won't be able to solve this for Beta 4 barring a miracle. Try at https://tbpl.mozilla.org/?tree=Try&rev=a652c78969d2
Comment 27•10 years ago
|
||
Comment on attachment 756994 [details] [diff] [review] backout on beta due to bug 870002 [Approval Request Comment] Bug caused by (feature/regressing bug #): this bug User impact if declined: intermittent mochitest crashes, but getUserMedia tracks will appear in the stream before the success callback. If this backout lands, applications which depend on the tracks being available may be negatively affected until we can fix it. Testing completed (on m-c, etc.): Try submitted for backout. We didn't see failures on Beta until this landed. Risk to taking this patch (and alternatives if risky): minimal as we ran without it on beta for a while. I'm pinging Kairo and the stability people to see if we believe we may be hitting bug 870002 in the field and not getting or connecting the reports to this bug (given the lack of stack traceback, this seems possible). String or IDL/UUID changes made by this patch: none
Attachment #756994 -
Flags: approval-mozilla-beta?
Comment 28•10 years ago
|
||
Comment on attachment 756994 [details] [diff] [review] backout on beta due to bug 870002 Thanks for ensuring this backout gets in for the final 3 betas!
Attachment #756994 -
Flags: approval-mozilla-beta? → approval-mozilla-beta+
Updated•10 years ago
|
Whiteboard: [WebRTC][blocking-webrtc+][qa-automation-blocked][parity-chrome] → [WebRTC][blocking-webrtc-][qa-automation-blocked][parity-chrome]
Reporter | ||
Comment 30•10 years ago
|
||
I think you want disabled in this case.
Comment 31•10 years ago
|
||
https://hg.mozilla.org/releases/mozilla-beta/rev/f53c82908920 Relanded since this is now proven not the be the cause of bug 870002
You need to log in
before you can comment on or make changes to this bug.
Description
•