Resume decoded audio when device is replugged after setSinkId()
Categories
(Core :: Audio/Video: Playback, enhancement, P1)
Tracking
()
People
(Reporter: karlt, Assigned: karlt)
References
(Depends on 1 open bug)
Details
Attachments
(15 files)
1.14 KB,
text/html
|
Details | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
+++ This bug was initially created as a clone of Bug #1801190 +++
https://w3c.github.io/mediacapture-output/#algorithms-new-sink-available
New audio devices may become available to the user agent, or an audio device (identified by a media element's sinkId attribute) that had previously become unavailable may become available again, for example, if it is unplugged and later plugged back in.
In this scenario, the user agent must run the following steps:
- Let sinkId be the identifier for the newly available device.
- For each media element whose sinkId attribute is equal to sinkId:
- If the media element's paused attribute is false, start rendering this object's audio out of the device represented by the sinkId attribute.
STR:
- Set pref media.setsinkid.enabled true (unnecessary on Nightly, as this is the default).
- Load testcase.
- Play video.
- Click "Default system output..."
- Select a removable speaker device.
- Click "Allow".
- Remove and re-plug removable speaker device.
Expect: audio in speaker selected in 5.
Actual: no audio.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•1 year ago
|
||
Assignee | ||
Comment 2•1 year ago
|
||
Assignee | ||
Comment 3•1 year ago
|
||
Depends on D180650
Assignee | ||
Comment 4•1 year ago
|
||
to remove risk of leak.
Depends on D180651
Assignee | ||
Comment 5•1 year ago
|
||
Move Ensure() to Start() to clarify that muting and SetPlaying() should not
create a different promise for clients to watch.
Move ResolveIfExists() from Shutdown() to Stop() to make the behavior when
muted consistent with behavior when unmuted and with DecodedStream and
VideoSink.
Shutdown() asserts that Stop() has been called.
Depends on D180652
Assignee | ||
Comment 6•1 year ago
|
||
This naming uses "position" instead of "duration" to clarify that this does
not include remaining playback duration.
mPlayStartTime was reset on playback rate changes and muting changes, so was
not necessarily the start of playback.
Depends on D180653
Assignee | ||
Comment 7•1 year ago
|
||
for consistency with state before start and to simplify IsPlaying().
Depends on D180654
Assignee | ||
Comment 8•1 year ago
|
||
SetPlaying() and asynchronous sink creation no longer starts an AudioSink if
audio has ended.
The ended test with OnMuted() is now effective even when audio ended while
using system time for the clock, when mAudioEnded does not get set.
Depends on D180655
Assignee | ||
Comment 9•1 year ago
|
||
Tracking of the AudioSink's promise is now only performed if the AudioSink
successfully starts.
The existing mEndedPromiseHolder.RejectIfExists() does not behave as expected
because the AudioStream::Start() steals the promise even if it fails. This
will be addressed in the next patch to use separate ended promises for
AudioSink and AudioSinkWrapper.
Depends on D180656
Assignee | ||
Comment 10•1 year ago
|
||
In a future patch this will allow the AudioSinkWrapper to remain unended when
the AudioSink ends due to the device becoming unavailable, and to reopen
another AudioSink when the device becomes available again.
Re-enqueuing unplayed audio even when not required is favored over
the complexity of an otherwise unnecessary parameter.
Depends on D180657
Assignee | ||
Comment 11•1 year ago
|
||
This helps clarify the difference between mEndedPromiseHolder managed by
AudioSinkWrapper and mAudioSinkEndedRequest watching a promise managed by the
AudioSink/AudioStream.
Depends on D180658
Assignee | ||
Comment 12•1 year ago
|
||
This clarifies that the aStartTime parameter is not used in the async method.
Depends on D180659
Assignee | ||
Comment 13•1 year ago
|
||
This will simplify keeping track of a previous AudioSink's end time when
switching between clocks. OnAudioEnded() will also use this helper in a
future patch.
Depends on D180660
Assignee | ||
Comment 14•1 year ago
|
||
This last packet time is similar to the upper limit used with the return value
from AudioSink::GetEndTime(). It also now correctly returns zero, even when
muted (tested in test_background_video_resume_after_end_show_last_frame.html),
if there is no audio track, as documented in MediaSink.h.
Returning an advancing time was leading to incorrect durations when muted, as
now tested in test_seek_duration.html. MediaSink::GetEndTime() also needs to
cap the system clock so MDSM will not advance playback position beyond the end
of media. https://bugzilla.mozilla.org/show_bug.cgi?id=1386478#c6
Zero is no longer returned when the AudioSink callbacks have not yet started,
which would have the effect of briefly not advancing the current playback
position of a playing audio element when unmuting.
Depends on D180661
Assignee | ||
Comment 15•1 year ago
|
||
to keep current playback position progressing and to resume audio output on
replugging a removed device.
Depends on D180662
Comment 16•1 year ago
|
||
Comment 17•1 year ago
•
|
||
Backed out for causing mda failures
Backout link: https://hg.mozilla.org/integration/autoland/rev/2bdaa9d6ac390362734ba199115ca10186243e87
Assignee | ||
Comment 18•1 year ago
|
||
Thank you for flagging me.
Comment 19•1 year ago
|
||
Comment 20•1 year ago
|
||
Assignee | ||
Comment 21•1 year ago
|
||
https://phabricator.services.mozilla.com/D180653 needs to land with https://phabricator.services.mozilla.com/D180656 to avoid failures in dom/media/mediasource/test/test_BufferingWait.html, dom/media/test/test_background_video_ended_event.html, and dom/media/test/test_reset_src.html as reported in comment 17 and now documented in the commit message.
Comment 22•1 year ago
|
||
Updated•1 year ago
|
Comment 23•1 year ago
|
||
Comment 24•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Comment 25•1 year ago
|
||
bugherder |
Comment 26•1 year ago
|
||
Comment 27•1 year ago
|
||
Comment 28•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5ef69e37cbf5
https://hg.mozilla.org/mozilla-central/rev/d27814dbcf7f
https://hg.mozilla.org/mozilla-central/rev/81468f8b39fd
https://hg.mozilla.org/mozilla-central/rev/203bf275e99e
https://hg.mozilla.org/mozilla-central/rev/039e59ad276e
https://hg.mozilla.org/mozilla-central/rev/449ecd31e049
https://hg.mozilla.org/mozilla-central/rev/2b9574ef0cc1
https://hg.mozilla.org/mozilla-central/rev/ecdb4d9d26dc
Assignee | ||
Updated•1 year ago
|
Comment 29•1 year ago
|
||
Comment 30•1 year ago
|
||
bugherder |
Comment 31•1 year ago
|
||
Since nightly and release are affected, beta will likely be affected too.
For more information, please visit BugBot documentation.
Comment 32•1 year ago
|
||
:Karlt is this something you would like to nominate for 116 release notes?
Assignee | ||
Comment 33•1 year ago
|
||
The key change here will come into effect on release only when bug 1498512 is fixed, so that's the one to watch for release notes, thank you.
Updated•1 year ago
|
Description
•