Open Bug 1774322 Opened 2 years ago Updated 4 months ago

Twitch.tv stream playback can stop or stutter when the window is unfocused or CPU is pressured

Categories

(Core :: Audio/Video: Playback, defect)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: lh.bennett, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0

Steps to reproduce:

Play a stream on Twitch.tv and either switch tabs or unfocus a dedicated window.

Actual results:

Audio and video has a chance to stop or stutter.

Expected results:

Normal Playback.

I've noticed this behavior for a while. The annoyance has finally gotten to me.

I tend to play PC Games and keep a Twitch stream rolling on a second monitor. This is common for most PC gamers these days, and quite a few still use Firefox over other browsers. Sometimes, regardless of whether I'm playing a game or not, a stream can stop or stutter when either switching tabs, when unfocusing a dedicated separate window or when the CPU is pressured.

The browser window can forget to paint the video, and the last frame is frozen in place. Additionally, audio can also stutter until pressing pause and play again. This is more likely to happen if the CPU sees a sudden spike in use from a separate app.

I understand that Twitch can be a buggy mess, but this behavior is fairly consistent enough to me to at least file a bug.

Blocks: twitch

The best way to identify a way to improve the behavior here is probably to get a performance profile.
Would you be able to try gathering a Firefox profiler run using the ‘Media’ profiler preset, please?
Once you have the profile run, could you use the share/upload button in the profiler then copy the link onto this bug?

When switching tabs, there can be a short delay before video resumes after cpu/power conserving measures, but this is not meant to affect affect audio. The preferences "media.suspend-bkgnd-video.enabled" and "media.suspend-bkgnd-video.delay-ms" control this behavior.
Focus changes should not be triggering this mechanism.

Severity: -- → S3
Keywords: perf

Someone on Reddit also noticed similar behavior with YouTube.
https://www.reddit.com/r/firefox/comments/vgcnxu/youtube_freezing_for_23_seconds_when_swapping/

I'll try to grab a profile of the behavior.

You need to log in before you can comment on or make changes to this bug.