Linearize AudioContextOperation resolution
Categories
(Core :: Audio/Video: MediaStreamGraph, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox79 | --- | fixed |
People
(Reporter: karlt, Assigned: karlt)
References
(Blocks 4 open bugs)
Details
Attachments
(10 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
+++ This bug was initially created as a clone of Bug #1285290 +++
We still have a fast-path when something is still using the AudioCallbackDriver, where we tell the content to resolve the promise immediately without sending it to the GraphDriver.
This causes the events to not stay in order, and blow up the state change assert back in AudioContext::OnStateChanged
.
Assignee | ||
Comment 2•5 years ago
|
||
There is no change in behavior here because the default constructor is zero initialized
https://searchfox.org/mozilla-central/rev/bc3600def806859c31b2c7ac06e3d69271052a89/mfbt/Atomics.h#287
and None is zero.
https://searchfox.org/mozilla-central/rev/bc3600def806859c31b2c7ac06e3d69271052a89/dom/media/GraphDriver.h#763
Assignee | ||
Comment 3•5 years ago
|
||
This will be helpful when delaying resumption of tracks until there is an AudioCallbackDriver.
The memory for the array is also transferred to the callee to save an allocation.
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
The key change here is that AudioContextOperation promises for the same
AudioContext are resolved in order as long as the graph is running.
There is one remaining case where AudioContextOperation promises can be
resolved out of order, which is when
AudioContextOperationControlMessage::RunDuringShutdown() resolves a Close
operation shortly after Run() has queued its update via mUpdateRunnables.
mUpdateRunnables are run after controlMessagesToRunDuringShutdown.
https://searchfox.org/mozilla-central/rev/ea7f70dac1c5fd18400f6d2a92679777d4b21492/dom/media/MediaTrackGraph.cpp#1793,1803
Pending resume operations are now stored on the graph instead of on
mNextDriver. This means there is no need to move operations between drivers
when switching from one mNextDriver to another, the code for which was
previously missing.
Suspend operations are performed immediately, because even a callback driver
can render nothing. Tracks are not resumed until either there is an
AudioCallbackDriver to deliver the rendered audio or the Resume operation is
canceled by a subsequent Suspend.
While the graph is running, DispatchToMainThreadStableState() is used
consistently, whereas previously this was mixed with direct Dispatch() to the
main thread, which could have the runnable Run() before main thread state had
been updated for rendering up to the time of a Suspend.
Assignee | ||
Comment 6•5 years ago
|
||
Assignee | ||
Comment 7•5 years ago
|
||
This provides that a new track does not start processing before existing
tracks in the AudioContext, which may not be resumed until an
AudioCallbackDriver is running.
Depends on D79048
Assignee | ||
Comment 8•5 years ago
|
||
Depends on D79049
Assignee | ||
Comment 9•5 years ago
|
||
and re-enable OnStateChanged() transition assertions.
Assignee | ||
Comment 10•5 years ago
|
||
Assignee | ||
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 13•5 years ago
|
||
Comment 16•5 years ago
|
||
Comment 18•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/39f13a31bf2e
https://hg.mozilla.org/mozilla-central/rev/680987aac530
https://hg.mozilla.org/mozilla-central/rev/71426ce4b138
https://hg.mozilla.org/mozilla-central/rev/fdcd2a267d75
https://hg.mozilla.org/mozilla-central/rev/0edf554a7996
https://hg.mozilla.org/mozilla-central/rev/ce7f146ddc9f
https://hg.mozilla.org/mozilla-central/rev/6316b2fbd3b9
Comment 19•5 years ago
|
||
bugherder |
Description
•