Closed
Bug 943461
Opened 11 years ago
Closed 10 years ago
Camera LED doesn't turn off after stream.stop() is called
Categories
(Core :: WebRTC: Audio/Video, defect)
Tracking
()
VERIFIED
FIXED
mozilla29
Tracking | Status | |
---|---|---|
firefox26 | --- | unaffected |
firefox27 | --- | affected |
firefox28 | --- | affected |
People
(Reporter: sole, Assigned: roc)
References
()
Details
(Keywords: regression)
Attachments
(20 files, 3 obsolete files)
In Nightly 20131126, I get the camera stream with getUserMedia. Then I stop it and the video stops and everything, but the LED is still on. I can turn on the stream again with no issues but no matter how many times this is repeated, the LED will never turn off, unless I reload the page. This is the demo page I'm using to test "turning it off and on again": http://people.mozilla.org/~spenades/test_cases/gumhelper/demo/
Updated•11 years ago
|
Component: General → WebRTC
Product: Firefox → Core
Updated•11 years ago
|
Component: WebRTC → WebRTC: Audio/Video
Comment 1•11 years ago
|
||
Confirmed using gum_test.html. Regression happened in 27. 26 seems ok. Select Video. Share the video device. Hit Stop. NotifyFinished() isn't called (it should call GetUserMediaCallbackMediaStreamListener::NotifyFinished() in MediaManager.cpp). (Note: depending on the testcase, a GC may later cause it to be destroyed and shut down the camera.) This appears to be caused by bug 922601's landing, which changed the conditionals and loops surrounding the calls to NotifyFinished() in UpdateCurrentTime(). In particular, StreamTimeToGraphTime() is being used now (and the update of mCurrentTime was moved) and from stepping through the code, the Finished track keeps getting added to streamsReadyToFinish(), and never succeeds at the conditional and so NotifyFinished() isn't called. Roc: I'm on PTO this week. Can you look into this ASAP? We need to get this fixed and also get it uplifted to Aurora. Thanks!
Assignee: nobody → roc
Severity: normal → critical
status-firefox26:
--- → unaffected
status-firefox27:
--- → affected
status-firefox28:
--- → affected
Depends on: 922601
Flags: needinfo?(roc)
Keywords: regression
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → mozilla27
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Randell Jesup [:jesup] on PTO until Dec 1 from comment #1) > This appears to be caused by bug 922601's landing, which changed the > conditionals and loops surrounding the calls to NotifyFinished() in > UpdateCurrentTime(). In particular, StreamTimeToGraphTime() is being used > now (and the update of mCurrentTime was moved) and from stepping through the > code, the Finished track keeps getting added to streamsReadyToFinish(), and > never succeeds at the conditional and so NotifyFinished() isn't called. In StreamTimeToGraphTime(stream, stream->GetBufferEnd()), stream->GetBufferEnd() is returning STREAM_TIME_MAX because there are no tracks --- so in principle we know the contents of the buffer to the end of time, but the tracks are empty so there's nothing to play and we may as well finish now. I think this is an existing bug that bug 922601 revealed.
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8340853 -
Flags: review?(paul)
Updated•11 years ago
|
Attachment #8340853 -
Flags: review?(paul) → review+
Comment 4•11 years ago
|
||
Comment on attachment 8340853 [details] [diff] [review] fix [Approval Request Comment] Bug caused by (feature/regressing bug #): 922601 User impact if declined: Video camera fails to turn off until MediaStream gets GC'd. This can be concerning/confusing to users since they think they're still "on-camera" or "on-mic". Testing completed (on m-c, etc.): Not landed yet; preemptive Risk to taking this patch (and alternatives if risky): minimal; no real alternatives other than backing out the regressing bug or portion thereof String or IDL/UUID changes made by this patch: none
Attachment #8340853 -
Flags: approval-mozilla-aurora?
Updated•11 years ago
|
Attachment #8340853 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Comment 5•11 years ago
|
||
Comment on attachment 8340853 [details] [diff] [review] fix [approved too early, waiting on m-c landing]
Attachment #8340853 -
Flags: approval-mozilla-aurora+ → approval-mozilla-aurora?
Assignee | ||
Comment 6•11 years ago
|
||
Test failures on my try push. New patches coming.
Assignee | ||
Comment 7•11 years ago
|
||
Revised a bit. In particular the new StreamBuffer API was changed to return the time at which all tracks have finished playing out, because we'll need it later.
Attachment #8340853 -
Attachment is obsolete: true
Attachment #8340853 -
Flags: approval-mozilla-aurora?
Attachment #8342189 -
Flags: review?(paul)
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8342190 -
Flags: review?(paul)
Assignee | ||
Comment 9•11 years ago
|
||
Attachment #8342191 -
Flags: review?(paul)
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8342192 -
Flags: review?(paul)
Updated•11 years ago
|
Attachment #8342190 -
Flags: review?(paul) → review+
Updated•11 years ago
|
Attachment #8342191 -
Flags: review?(paul) → review+
Updated•11 years ago
|
Attachment #8342189 -
Flags: review?(paul) → review+
Updated•11 years ago
|
Attachment #8342192 -
Flags: review?(paul) → review+
Assignee | ||
Comment 12•11 years ago
|
||
These patches caused more test failures, revealing more underlying bugs, and my patches to fix those have caused more test failures. https://tbpl.mozilla.org/?tree=Try&rev=840608b86575 I think we should back out 922601 everywhere except nightly.
Comment 13•11 years ago
|
||
Any chance we can get this landed (and up to 27) before uplift, so we don't have to do a beta uplift request? I'm guessing we can back out 922601...
Flags: needinfo?(roc)
Assignee | ||
Comment 14•11 years ago
|
||
Requested backout of bug 922601 from Aurora in that bug.
Flags: needinfo?(roc)
Assignee | ||
Comment 15•11 years ago
|
||
In my attempt to make tests green, I have 7 more patches all fixing independent bugs, plus I found bug 947796 :-). I'll attach when I finally get green tests.
Assignee | ||
Comment 16•11 years ago
|
||
Alright, I finally have something green on try. https://tbpl.mozilla.org/?tree=Try&rev=785f7437cde4
Assignee | ||
Comment 17•11 years ago
|
||
Also https://tbpl.mozilla.org/?tree=Try&rev=04bbcd2f98e9
Assignee | ||
Comment 18•11 years ago
|
||
Attachment #8346127 -
Flags: review?(paul)
Assignee | ||
Comment 19•11 years ago
|
||
Attachment #8346128 -
Flags: review?(rlin)
Assignee | ||
Comment 20•11 years ago
|
||
Attachment #8346130 -
Flags: review?(cpearce)
Assignee | ||
Comment 21•11 years ago
|
||
Attachment #8346136 -
Flags: review?(paul)
Assignee | ||
Comment 22•11 years ago
|
||
Attachment #8346137 -
Flags: review?(paul)
Assignee | ||
Comment 23•11 years ago
|
||
Attachment #8346138 -
Flags: review?(paul)
Assignee | ||
Comment 24•11 years ago
|
||
Attachment #8346139 -
Flags: review?(paul)
Assignee | ||
Comment 25•11 years ago
|
||
Attachment #8346141 -
Flags: review?(karlt)
Assignee | ||
Comment 26•11 years ago
|
||
Attachment #8346142 -
Flags: review?(paul)
Assignee | ||
Comment 27•11 years ago
|
||
Attachment #8346143 -
Flags: review?(karlt)
Assignee | ||
Comment 28•11 years ago
|
||
Attachment #8346145 -
Flags: review?(cpearce)
Assignee | ||
Comment 29•11 years ago
|
||
Attachment #8346146 -
Flags: review?(cpearce)
Assignee | ||
Comment 30•11 years ago
|
||
Attachment #8346147 -
Flags: review?(cpearce)
Assignee | ||
Comment 31•11 years ago
|
||
Attachment #8346148 -
Flags: review?(karlt)
Assignee | ||
Comment 32•11 years ago
|
||
Attachment #8346150 -
Flags: review?(eitan)
Updated•11 years ago
|
Attachment #8346128 -
Flags: review?(rlin) → review+
Updated•11 years ago
|
Attachment #8346141 -
Flags: review?(karlt) → review+
Comment 33•11 years ago
|
||
Comment on attachment 8346148 [details] [diff] [review] Part 18: Ensure AudioBufferSourceNode's engine always produces an audio block when ProduceAudioBlock is called, and add an assertion to catch this kind of error directly Not so keen on uint16_t but it's debug only.
Attachment #8346148 -
Flags: review?(karlt) → review+
Comment 34•11 years ago
|
||
Comment on attachment 8346143 [details] [diff] [review] Part 14: Cleanup some cruft after part 11 Given this thread is running unconstrained at full CPU, I think it is important to stop this processing when done, instead of continuing to consume available CPU until messages have gone to the main thread and back. That would also stop audioprocess or onended events from firing after the specified length is processed.
Attachment #8346143 -
Flags: review?(karlt) → review-
Comment 35•11 years ago
|
||
If the changes to OfflineAudioContext processing is just to fix some tests that are currently getting lucky, then perhaps the tests can be adjusted to tolerate and fixed in another bug.
Updated•11 years ago
|
Attachment #8346130 -
Flags: review?(cpearce) → review+
Updated•11 years ago
|
Attachment #8346145 -
Flags: review?(cpearce) → review+
Updated•11 years ago
|
Attachment #8346146 -
Flags: review?(cpearce) → review+
Updated•11 years ago
|
Attachment #8346147 -
Flags: review?(cpearce) → review+
Updated•11 years ago
|
Attachment #8346136 -
Flags: review?(paul) → review+
Updated•11 years ago
|
Attachment #8346137 -
Flags: review?(paul) → review+
Updated•11 years ago
|
Attachment #8346138 -
Flags: review?(paul) → review+
Comment 36•11 years ago
|
||
Comment on attachment 8346139 [details] [diff] [review] Part 11: Don't tear down an OfflineAudioContext until its current time has actually reached its e nd, to ensure that all relevant stream state changes have been forwarded to the main thread Review of attachment 8346139 [details] [diff] [review]: ----------------------------------------------------------------- r+, but see comments. ::: content/media/webaudio/AudioDestinationNode.cpp @@ +63,5 @@ > if (mInputChannels.IsEmpty()) { > return; > } > > + if (mWriteIndex >= mLength) { Would it be possible to put an == here instead of the >=, and MOZ_ASSERT in case this invariant is not respected? @@ +100,5 @@ > PodZero(mInputChannels[i] + mWriteIndex, duration); > } > mWriteIndex += duration; > > + if (mWriteIndex >= mLength) { Same thing, I'm not sure sure this change is necessary, because we have: > const uint32_t duration = std::min(WEBAUDIO_BLOCK_SIZE, mLength - mWriteIndex); above. @@ +115,5 @@ > + context->Shutdown(); > + // Shutdown drops self reference, but the context is still referenced by aNode, > + // which is strongly referenced by the runnable that called > + // AudioDestinationNode::FireOfflineCompletionEvent. > + nit: trailing space.
Attachment #8346139 -
Flags: review?(paul) → review+
Updated•11 years ago
|
Attachment #8346127 -
Flags: review?(paul) → review+
Updated•11 years ago
|
Attachment #8346142 -
Flags: review?(paul) → review+
Comment 37•11 years ago
|
||
Comment on attachment 8346150 [details] [diff] [review] Part 19: nsSpeechTask should explicitly finish its audio track before finishing the stream Review of attachment 8346150 [details] [diff] [review]: ----------------------------------------------------------------- This causes SynthStreamListener::NotifyFinished() to not be called, and in turn no 'end' event is emitted. Not sure how to do that correctly.
Attachment #8346150 -
Flags: review?(eitan) → review-
Comment 38•11 years ago
|
||
Comment on attachment 8346150 [details] [diff] [review] Part 19: nsSpeechTask should explicitly finish its audio track before finishing the stream Review of attachment 8346150 [details] [diff] [review]: ----------------------------------------------------------------- I'm going check this again with the entire patch queue.
Attachment #8346150 -
Flags: review- → review?(eitan)
Comment 39•11 years ago
|
||
Comment on attachment 8346150 [details] [diff] [review] Part 19: nsSpeechTask should explicitly finish its audio track before finishing the stream Review of attachment 8346150 [details] [diff] [review]: ----------------------------------------------------------------- Tested, and it indeed works. Sorry for the earlier confusion. ::: content/media/webspeech/synth/nsSpeechTask.cpp @@ +214,5 @@ > void > nsSpeechTask::SendAudioImpl(int16_t* aData, uint32_t aDataLen) > { > if (aDataLen == 0) { > + mStream->EndTrack(1); How about mStream->EndAllTrackAndFinish() instead? Looks like it does the same thing.
Attachment #8346150 -
Flags: review?(eitan) → review+
Assignee | ||
Updated•11 years ago
|
Attachment #8346143 -
Attachment is obsolete: true
Assignee | ||
Comment 40•11 years ago
|
||
Fixes the issues raised by you and Karl. We shut down the offline MSG as soon as mCurrentTime has advanced far enough *and* all streams that have finished have sent notifications to the main thread. This is needed for AudioDestinationNode to get its finished notification and dispatch its event.
Attachment #8346139 -
Attachment is obsolete: true
Attachment #8349337 -
Flags: review?(paul)
Assignee | ||
Comment 41•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=91b6706ab3b9
Updated•11 years ago
|
Attachment #8349337 -
Flags: review?(paul) → review+
Assignee | ||
Comment 42•11 years ago
|
||
Assertion failures on Linux and Mac.
Assignee | ||
Comment 43•11 years ago
|
||
Attachment #8351622 -
Flags: review?(paul)
Assignee | ||
Comment 44•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=e5e1c848253d
Assignee | ||
Updated•11 years ago
|
Attachment #8351622 -
Flags: review?(karlt)
Assignee | ||
Comment 45•11 years ago
|
||
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #44) > https://tbpl.mozilla.org/?tree=Try&rev=e5e1c848253d This is green.
Updated•10 years ago
|
Attachment #8351622 -
Flags: review?(paul) → review+
Assignee | ||
Comment 46•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=656ca88e2708
Assignee | ||
Comment 47•10 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=cc58c0061f1c
Assignee | ||
Comment 48•10 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e526d37a9a19 https://hg.mozilla.org/integration/mozilla-inbound/rev/fcc3f7ba913e https://hg.mozilla.org/integration/mozilla-inbound/rev/aecddf4c53d8 https://hg.mozilla.org/integration/mozilla-inbound/rev/ac6bfc6f050e https://hg.mozilla.org/integration/mozilla-inbound/rev/08e5578eded8 https://hg.mozilla.org/integration/mozilla-inbound/rev/7590e388abaf https://hg.mozilla.org/integration/mozilla-inbound/rev/249b7a7cec00 https://hg.mozilla.org/integration/mozilla-inbound/rev/9811231a9449 https://hg.mozilla.org/integration/mozilla-inbound/rev/4378e7bf2afc https://hg.mozilla.org/integration/mozilla-inbound/rev/bed75e8c44b1 https://hg.mozilla.org/integration/mozilla-inbound/rev/939ac6298d2a https://hg.mozilla.org/integration/mozilla-inbound/rev/76bf4bf34926 https://hg.mozilla.org/integration/mozilla-inbound/rev/adc635735f62 https://hg.mozilla.org/integration/mozilla-inbound/rev/e911ac30c8c1 https://hg.mozilla.org/integration/mozilla-inbound/rev/6a6bae856337 https://hg.mozilla.org/integration/mozilla-inbound/rev/75ca7a7c5df7 https://hg.mozilla.org/integration/mozilla-inbound/rev/0279107b81d3 https://hg.mozilla.org/integration/mozilla-inbound/rev/7677ea877c08 https://hg.mozilla.org/integration/mozilla-inbound/rev/1ebe4da27dd5
Comment 49•10 years ago
|
||
Comment on attachment 8351622 [details] [diff] [review] Part 20: Don't revive an offline MediaStreamGraph that has finished. Instess any pending events using their RunInShutdown sequence Looks good, thanks.
Attachment #8351622 -
Flags: review?(karlt) → review+
Comment 50•10 years ago
|
||
Attachment #8356495 -
Flags: review?(roc)
Assignee | ||
Comment 51•10 years ago
|
||
Comment on attachment 8356495 [details] [diff] [review] part 21 don't copy messages from mCurrentTaskMessageQueue after it has been emptied Review of attachment 8356495 [details] [diff] [review]: ----------------------------------------------------------------- Thanks
Attachment #8356495 -
Flags: review?(roc) → review+
Comment 52•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e526d37a9a19 https://hg.mozilla.org/mozilla-central/rev/fcc3f7ba913e https://hg.mozilla.org/mozilla-central/rev/aecddf4c53d8 https://hg.mozilla.org/mozilla-central/rev/ac6bfc6f050e https://hg.mozilla.org/mozilla-central/rev/08e5578eded8 https://hg.mozilla.org/mozilla-central/rev/7590e388abaf https://hg.mozilla.org/mozilla-central/rev/249b7a7cec00 https://hg.mozilla.org/mozilla-central/rev/9811231a9449 https://hg.mozilla.org/mozilla-central/rev/4378e7bf2afc https://hg.mozilla.org/mozilla-central/rev/bed75e8c44b1 https://hg.mozilla.org/mozilla-central/rev/939ac6298d2a https://hg.mozilla.org/mozilla-central/rev/76bf4bf34926 https://hg.mozilla.org/mozilla-central/rev/adc635735f62 https://hg.mozilla.org/mozilla-central/rev/e911ac30c8c1 https://hg.mozilla.org/mozilla-central/rev/6a6bae856337 https://hg.mozilla.org/mozilla-central/rev/75ca7a7c5df7 https://hg.mozilla.org/mozilla-central/rev/0279107b81d3 https://hg.mozilla.org/mozilla-central/rev/7677ea877c08 https://hg.mozilla.org/mozilla-central/rev/1ebe4da27dd5
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Updated•10 years ago
|
Target Milestone: mozilla27 → mozilla29
Version: Trunk → 27 Branch
Comment 56•10 years ago
|
||
Reproduced the initial issue on a old Nightly build and verified that the issue is fixed on Firefox 29 beta 1, Firefox 28.0 and 27.0.1 using Windows 7 64bit, Ubuntu 13.10 64bit and Mac OS X 10.8.5.
Status: RESOLVED → VERIFIED
Keywords: verifyme
You need to log in
before you can comment on or make changes to this bug.
Description
•