Closed Bug 1759348 Opened 3 years ago Closed 3 years ago

video and audio skips on youtube

Categories

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

Firefox 98
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: mozer624, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:98.0) Gecko/20100101 Firefox/98.0

Steps to reproduce:

Have 2 windows, one with a video and the other used normally.

Recently the videos I watch will stutter and skip, all tabs and all windows will slow down. Feels like a memory leak as quitting and restoring session fixes the issue for a while. I only started noticing this since upgrading to macOS 12 Monterey but that could be a coincidence... I experience this issue multiple times a day every day.

Usually it will reproduce when I'm also using a website with a lot of content changes such as the live charts on tradingview.com, and also when I watch videos at 2x.

Actual results:

Audio/video skips and stutters until Firefox is quit.

Expected results:

No skipping

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.

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

If you can, capturing a 'media' performance profile would help in diagnosing the issue.

https://profiler.firefox.com/

Flags: needinfo?(mozer624)

https://share.firefox.dev/3u3dzTc

Just happened and I turned on the profiler when it started. Looks like it got up to 100% cpu for ~10 seconds, all I was doing was watching a youtube video and about 3mins in started stuttering. I played the video again while profiling to get more data.

Flags: needinfo?(mozer624)

I reproduced again by first having the profiler on before I saw the issue: https://share.firefox.dev/3KQ0Yd9

I played a video in one window and opened TradingView in another (reproducing what I initially reported). About 4 minutes into the video everything stopped. I stopped the profiler at 6 minutes in.

Blocks: media-triage

Hi, any chance you might be able to install Firefox Nightly and capture another profile? We get better debugging information out of the early builds. I would suggest launching Nightly in a separate profile to avoid messing with your default profile.

/Applications/Firefox.app/Contents/MacOS/firefox -no-remote -P "NAME_OF_YOUR_TEST_PROFILE"

Also, please post your about:support text so we can take a look at your hardware.

Flags: needinfo?(mozer624)
Attached file about-support

Attached is my about:support "about-support.txt" from my Firefox version 98.0.1. I'll install Nightly and clear the needinfo after I reproduce.

I've reproduced using Nightly https://share.firefox.dev/3iggimR

Flags: needinfo?(mozer624)

Nightly 100.0a1 (2022-03-16)

One thing to try is to disable the two youtube extensions you have to see if it helps -

SponsorBlock for YouTube - Skip Sponsorships
Enhancer for YouTube™

(In reply to Jim Mathies [:jimm] from comment #9)

One thing to try is to disable the two youtube extensions you have to see if it helps -

SponsorBlock for YouTube - Skip Sponsorships
Enhancer for YouTube™

I tried with these both disabled and still had similar issues. Also both of those extensions are marked as "Recommended", I know that doesn't mean they're perfect but just wanted to mention they've been reviewed.

I see "SkippedVideoDecode" markers in the later half of the profile. Interestingly these seem to correspond to "RequestDecode:V:720<h<=1080:kf,sw,vp9," markers.

Summary: video and audio skips → video and audio skips on youtube

There's also a bunch of "DiscardVideo" markers which also correspond to dropped frames.

Michael, can you look in about:telemetry for the "VIDEO_DROPPED_FRAMES_PROPORTION_EXPONENTIAL" histogram, copy it using the "Copy" button and paste it here?

Flags: needinfo?(mozer624)

I don't have that that key in my telemetry. Does it need to be enabled somewhere?

Flags: needinfo?(mozer624)

It should be in Firefox 98 and newer and you'll need to have stopped a video during the current run before the results will show up there.

Flags: needinfo?(mozer624)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #15)

It should be in Firefox 98 and newer and you'll need to have stopped a video during the current run before the results will show up there.

I do see this often on YouTube, but I experience this on other websites as well. Here's another profile https://share.firefox.dev/3wfY6SI and the telemetry:

VIDEO_DROPPED_FRAMES_PROPORTION_EXPONENTIAL
28 samples, average = 14.3, sum = 401

0 |######################### 17 61%
2 |# 1 4%
3 |# 1 4%
5 |# 1 4%
13 |# 1 4%
16 |# 1 4%
19 |# 1 4%
23 |# 1 4%
29 |# 1 4%
63 |### 2 7%
161 |# 1 4%
174 | 0 0%

Flags: needinfo?(mozer624)
Severity: -- → S4

(In reply to Michael Ozeryansky from comment #16)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #15)

It should be in Firefox 98 and newer and you'll need to have stopped a video during the current run before the results will show up there.

I do see this often on YouTube, but I experience this on other websites as well. Here's another profile https://share.firefox.dev/3wfY6SI and the telemetry:

VIDEO_DROPPED_FRAMES_PROPORTION_EXPONENTIAL
28 samples, average = 14.3, sum = 401

0 |######################### 17 61%
2 |# 1 4%
3 |# 1 4%
5 |# 1 4%
13 |# 1 4%
16 |# 1 4%
19 |# 1 4%
23 |# 1 4%
29 |# 1 4%
63 |### 2 7%
161 |# 1 4%
174 | 0 0%

We've been looking at these profiles a lot. Thus far we see that frames get dropped, but the load internally is low, implying something else is slowing things down. So far we haven't identified the source of the problem.

I wonder if there's something weird going on with your audio clock. Is it possible for you to check if the problem still happens with a different audio output device?

Flags: needinfo?(mozer624)

I've using my bluetooth headphones, when I tried using my speakers I still got choppy audio. I'm not sure if it's system related as everything starts to slow as well until I close a few tabs. Pausing the video for ~10 seconds makes the issue go away for a good while. Is there anything else I can measure to pin down a source of the cause?

Here's dropped frames after the issue occurred and while using a different audio source.

VIDEO_DROPPED_FRAMES_PROPORTION_EXPONENTIAL
12 samples, average = 1,000.6, sum = 12,007

0 |############# 1 8%
2 |############# 1 8%
43 |############# 1 8%
174 |############# 1 8%
188 |############# 1 8%
203 |######################### 2 17%
705 |############# 1 8%
1216 |############# 1 8%
2455 |############# 1 8%
2654 |############# 1 8%
3626 |############# 1 8%
3920 | 0 0%

Flags: needinfo?(mozer624)

Can you grab a new profile with the very latest Nightly? It also has some new telemetry so it would be good if you could also paste histograms for all the PROPORTION_EXPONENTIAL measurements.

Flags: needinfo?(mozer624)
No longer blocks: media-triage
Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE

It's been a while and I no longer have this issue exactly. One factor is that my computer was very hot and there was the 'kernal_task' process at a high CPU. From what I read that's a placeholder process that Macs use to reduce CPU availability to make the computer slow to self cool, as part of the normal overheating process. I took apart my laptop and cleaned out the dust in the fans and everything has been running cooler and faster ever since.

I'll leave it up to you to keep the ticket open/closed. In the future could the profile take into account the thermal state? While it's not a code related solution it did solve my issue.

https://developer.apple.com/library/archive/documentation/Performance/Conceptual/power_efficiency_guidelines_osx/RespondToThermalStateChanges.html

Flags: needinfo?(mozer624)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: