No speaker icon on tab when autoplay disabled and playing podcast on specific website
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: basic.master, Unassigned, NeedInfo)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
69.73 KB,
text/plain
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:159.0) Gecko/20100101 Firefox/159.0
Steps to reproduce
- Have media.autoplay.default set to 5 and media.autoplay.blocking_policy set to 2.
- Open e.g. https://www.deutschlandfunk.de/nachrichten-45418.html in a new tab.
- Click on the blue "Hören" button: A playback panel at the webpage buttom gets visible.
- Click on the play button in that panel.
Note that this seems to affect the podcasts on this specific website. On other websites, I didn't see this problem.
Actual results
Audio playback starts, but the tab has no additional speaker icon.
When the round buttons left/right to the play button are used (in order to jump 15s back/forward), from that point on, the speaker icon is shown (as long as the audio is played).
The speaker icon also starts to be shown, after one pauses the audio, changes to a different tab, changes back to this tab, and resumes the playback. In contrast pausing/resuming the playback while staying on this tab all the time doesn't lead the speaker icon to be shown.
Expected results
Audio playback starts, and the tab should have an additional speaker icon, as long as the audio is played.
Comment 1•20 days 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 correct in case you think the bot is wrong.
Comment 2•20 days ago
|
||
| gecko-triage | ||
Thanks for the clear steps.
Analysis
The player panel on this page uses a plain <audio> element with an MP3 file. The tab speaker icon follows the audible state that the media element reports, see HTMLMediaElement.cpp. The 15s buttons of the panel mute the element, seek, and then unmute it. The code alone does not show which step misses the audible state on the first play.
Next steps
Stefan, could you please record a capture with the same autoplay prefs? Stop the capture when audio plays with no speaker icon. Do not use the 15s buttons before the capture stops.
Please capture a profile:
- Open
about:logging. - Under Log module selection, choose "Media playback" in the Logging preset: drop-down.
- Under Logging output, select "Logging to the Firefox Profiler".
- Click Start Logging.
- Reload the page. Then do the steps that show the problem.
- Click Stop Logging. The profile opens in the Firefox Profiler.
- Click Upload Local Profile. This is the share button.
- Copy the share URL. Add it to this bug.
The instruction video shows these steps.
Stefan, could you please also attach about:support?
- Open
about:support. - Click "Copy text to clipboard".
- Paste the text into a comment on this bug.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
Please find the profile here:
https://share.firefox.dev/4ejaoiy
And attached the output of about:support.
BTW it seems that the issue doesn't occur if one waits a few seconds between the particular steps.
Comment 5•19 days ago
|
||
| gecko-triage | ||
Thanks for the profile and about:support.
Analysis
The profile shows a race between two audio sinks in the media code. With these autoplay prefs, the first play() fails. After the click, the page sets currentTime = 0, calls play(), and sets currentTime = 0 again within 7 ms.
A seek that completes during playback starts an async init of a new AudioSink, see AudioSinkWrapper.cpp. The sink creator in MediaDecoderStateMachine.cpp moves mAudibleListener to each new sink when it creates the sink. In the profile, the listener moves to the second sink at 6.612s.
Then the first init finishes and its sink plays. The check in AudioSinkWrapper.cpp does not see that a newer Start superseded this init. The mAsyncDispatchSeq check in AudioSinkWrapper.cpp runs only before the init starts. The wrapper then shuts down the second sink as "unneeded".
At 6.785s the first sink logs "Notifying that audio is now audible". Nothing listens to that sink, so the element does not become audible and the tab shows no icon. AudioSink.cpp sends the event only on a change, so the event does not come again.
This explains each observation. The 15s buttons mute and unmute, and the unmute creates one new sink with the listener. A long pause probably makes the decoder dormant, and the resume then creates one new sink. A wait between the steps removes the overlap of the two seeks. The audio output is correct; only the audible state is wrong.
The probable cause is bug 2050845, which landed on 2026-07-03 for Firefox 154. It added the async init for a seek resume. Before it, a seek resume created the sink at once. No bisection confirms this, and the regression status is not known yet. The current tree has the same code.
Fix direction
- Connect the audible event to the sink that starts, not to the sink that the creator makes. When the listener moves, send the current audible state again.
- Also drop a superseded async init in the continuation. For example, check
mAsyncDispatchSeqagain there, or increase it inStop(). - A gtest in TestAudioSinkWrapper.cpp can show the race every time. Call
Start(SeekResume),Stop, andStart(SeekResume)before the first init completes. Then check which sink plays.
This bug blocks the autoplay meta bug 2023365.
Alastor, could you please look at this bug? Bug 2050845 added the async init path.
If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
Description
•