Audio stutters when other tabs call `new AudioContext` [MaxxAudioAPO driver]
Categories
(Core :: Audio/Video: cubeb, defect, P3)
Tracking
()
People
(Reporter: tcampbell, Assigned: kinetik)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
|
222 bytes,
text/html
|
Details |
STR:
- Play music in a background tab. Both Spotify and YouTube reproduce for me.
- In a new tab navigate to https://ubuntu.com/blog/canonical-releases-landscape-24-04-lts
Expected:
Music continues to play
Actual:
Audio stutters for half a second / is chopped up
CPU isn't maxed when this happens (and when I do stress foreground tab to max out CPU, the audio still runs smooth). It is possible this is some weird pageload scheduling quirk but media team might have some ideas here.
| Reporter | ||
Comment 1•2 years ago
|
||
Here is a profile with Media Preset: https://share.firefox.dev/3WsI8lj
- I load the page normally, and also refresh it once. Each time there is a consistent stutter for me.
Comment 2•2 years ago
|
||
This shows up prominently here on the MDSM thread: https://share.firefox.dev/3wqWoAm
| Reporter | ||
Comment 3•2 years ago
|
||
Here is an ETW profile: https://profiler.firefox.com/public/2fz8n9rqs55d278db15veceqkhd3vzcztqase78
| Reporter | ||
Comment 5•2 years ago
|
||
Calling new AudioContext for the first time in a new process is all that is needed to trigger the stuttering.
| Reporter | ||
Comment 6•2 years ago
|
||
Here is a minimal version that hits the issue for me. This is all done in one page, but the stutter happens even if running in separate processes.
- Start audio playback with play button
- Hit "stutter' button
Comment 7•2 years ago
|
||
I think this is related with AudioIPC or Cubeb.
By checking the profiled result from the comment1, first you can notice that there are some AudioStream::GetPosition markers taking very long time, which blocks the MediaDecoderStateMachine thread so no audio decoding happened during that period of time. As no audio data were pushed into the audio queue, it caused the audio underrun in AudioIPC Client Callback thread (see AudioSink::PopFrames - Underrun 480 frames missing), which would push silence and result in audio stuttering.
I couldn't reproduce this issue on my Windows 11, but the reporter is also on a Windows 11. So I suspect that the different audio setup causes the problem. It's somehow understandable that the issue happens when creating a AudioContext because the underlying audio clock driver of AudioContext would open a new cubeb stream.
By further checking the flame graph, the most time we spent is inside the audio ipc code. That indicates on some audio setup, creating a new cubeb stream might affect the existing cubeb stream.
Comment 8•2 years ago
|
||
Matthew, would you mind to take a look on this issue? Thanks!
| Reporter | ||
Comment 9•2 years ago
|
||
Here is a simplified profile of the test case I attached: https://share.firefox.dev/3wiQIZn
The cubeb_stream_init calls are 1100ms and 600ms, and seem to block the AudioIPC Server RPC thread which results in results in the playing audio cutting out each time an new AudioIPC Client creates a stream object.
| Reporter | ||
Comment 10•2 years ago
|
||
Here is a pretty minimal ETW profile showing the problem: https://share.firefox.dev/4bcDKeA
The system I'm having trouble with is using the MaxxAudioAPO.dll driver which seems to take 500+ms to open the audio stream.
| Reporter | ||
Comment 12•2 years ago
•
|
||
Chrome ETW profile: https://share.firefox.dev/3wx2KOH
The audio playback in Chrome is smooth even though I see the same MaxxAudioAPO slowdown when creating streams (and new AudioContext does create the stream immediately similar to us). The Audio Device Thread seems to run along smoothly even as the new stream is created.
| Assignee | ||
Updated•2 years ago
|
Updated•1 year ago
|
Comment 14•3 months ago
|
||
Profiler of the issue/duplicate bug 2059968
https://www.mediafire.com/file/c3ft12cm9a978j4/Firefox+2026-08-13+04.53+profile.json(1).gz/file
Updated•9 days ago
|
Description
•