Speaker icon on tab playing audio disappears at youtube.com
Categories
(Core :: Audio/Video: Playback, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox90 | --- | fixed |
People
(Reporter: cylonskar, Assigned: alwu)
References
(Blocks 1 open bug)
Details
Attachments
(6 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:89.0) Gecko/20100101 Firefox/89.0
Steps to reproduce:
- Have a YouTube video as a background tab
- Have hardwaremediakeys enabled
- Pause and let the audio/speaker icon disappear on the tab
- Change the mouse focus to a different window/app
- Resume playback on YouTube using Play/Pause media keys
Actual results:
The speaker/audio icon disappears even though the audio is still playing.
The icon shows up again if the mouse cursor hovers over the playing tab.
Expected results:
The speaker/audio icon remains active as long as audio is playing (which is what happens on other sites like soundcloud.com).
Reporter | ||
Comment 1•4 years ago
|
||
Comment 2•4 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Assignee | ||
Comment 3•4 years ago
|
||
In your step1 Have a YouTube video as a background tab
, do you mean pin the tab and move to other foreground tabs? Because of Proton, the sound indicator seems only showing when the mouse is hovering on the tab. I can only see the sound indicator showing above the favicon when I pin a tab.
I couldn't reproduce this issue on Windows, MacOS and Linux, Would you mind to have a screen recording to let me see if I was doing anything wrong? Thank you.
Reporter | ||
Comment 4•4 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #3)
In your step1
Have a YouTube video as a background tab
, do you mean pin the tab and move to other foreground tabs? Because of Proton, the sound indicator seems only showing when the mouse is hovering on the tab. I can only see the sound indicator showing above the favicon when I pin a tab.I couldn't reproduce this issue on Windows, MacOS and Linux, Would you mind to have a screen recording to let me see if I was doing anything wrong? Thank you.
It happens both to the speaker icon when pinned and to the playing dialog when unpinned as long as the tab is in the background. I will attach the screen recording (the playing status disappears at 00:17 even though the sound/video is still playing). Thank you!
Reporter | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
Thank you for the recording! Following is the timeline in your recording.
- 9s : paused the video (the audio output became 0)
- 12s : the
playing
hint disappeared on the tab - 15s : started playing again (the audio output started showing output level, abd
playing
also appeared again on the tab) - 18s :
playing
disappeared again <--- (this was the issue) - 27s : hovered mouse onto the tab,
playing
appeared again
I can sometime reproduce this issue (not 100%, not sure why) Once the tab goes foreground again (even if switching tabs by keyboard shotcut, not by mouse hovering) the playing
would appear again.
Jared, I wonder if this is a regression bug by Proton. I did see Gecko notify audio-playback
when resuming media via media control. Would you mind to take a look on this?
Thank you.
Comment 7•4 years ago
|
||
I'm able to reproduce it but only by following those timing steps very closely. I think it has something to do with the 3 second interval. That's the same 3 second interval that we use for the delayed removal of the audio indicator.
The audio indicator is getting removed by the presence of the "soundplaying-scheduledremoval" attribute, which is only added in the "DOMAudioPlaybackStopped" event handler. I added logging and when this bug happens we receive a "DOMAudioPlaybackStarted" event followed by a "DOMAudioPlaybackStopped" event. We shouldn't get a "Stopped" event right after the "Started" event if the media is still playing. Note that I used the media keys on my keyboard when testing this.
I looked through all of the front-end code and I can't see where we could be getting a second message or not cleaning up between these. Could this be a regression from https://bugzilla.mozilla.org/show_bug.cgi?id=1578615 ?
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Ah, thank you for debugging that. If that is possibly related with the audio playback event, then I will debug it again.
Assignee | ||
Comment 9•4 years ago
|
||
Interesting, the root cause of this issue is actually from the pretty low level of the media stack.
tl;dr, this issue is related with suspending background video decoding.
So Gecko incorrectly dispatched another DOMAudioPlaybackStopped
event right after DOMAudioPlaybackStarted
event, because the media element explicitly stopped the audio channel agent due to this condition being false, which means the media element's ready state was lower than HAVE_CURRENT_DATA
.
That was caused by here because we couldn't find the image frame from image container that changed the ready state to HAVE_METADATA
again. (And the element would keep in this incorrectly state even if the element was playing!)
The call path of resetting the image in the image container was started from here in the SeekingState::SeekCompleted
. Why did seeking happen? That was because the MDSM entered the DormatState
first, which is used to release the decoder resource when the media is not playing. When leaving DormantState
, we would seek to the previous play position.
When video sink reset the current image in Redraw()
, then VideoFrameContainer
would clear the current frame because it found that image was empty. Why image was empty? Because the background video decoding had been suspended, the video we decoded were all fake data.
So this issue was introduced long time ago (since bug1346120), and it causes the background media element always being in a wrong ready state (HAVE_METADATA
), instead of HAVE_CURRENT_DATA
or any other higher states.
Assignee | ||
Comment 10•4 years ago
|
||
Using a non-null image can prevent element from changing its ready state incorrectlt to HAVE_METADATA
. See more detailed analysis in [1].
Assignee | ||
Comment 11•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Comment 13•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1a5d3062bbe1
https://hg.mozilla.org/mozilla-central/rev/9abb40a67736
Comment 15•3 years ago
|
||
Hey Alastor,
Bug 1744411 reported this same issue as not fixed. When I try to reproduce on macOS, I observe the "playing" text consistently on background tabs playing audio, but only get the speaker icon when hovering. Is this the expected behavior?
Assignee | ||
Comment 16•3 years ago
|
||
I believe that is a part of Proton design. Jared, could you help me confirm that? Because I think you know Proton design more than me. Thank you.
Comment 17•3 years ago
|
||
Yes. The speaker icon only appears when hovering, as the speaker doubles as a button to mute the tab. We wanted to show the favicon when not hovered because the favicon is used by many users to find a tab within the tabstrip.
Description
•