Open Bug 1887942 Opened 2 years ago Updated 1 year ago

YouTube videos drops frames and freezes at 1.75x with NVIDIA GeForce RTX 3080

Categories

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

Firefox 124
defect

Tracking

()

UNCONFIRMED

People

(Reporter: hanchenlu, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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

Steps to reproduce:

Lately, I've noticed more and more occasional video freezes while watching videos on Youtube. It occurs sporadically, but I've noticed it being more prevalent on certain channels that I watch. The most consistent channel that I've been having issues with is Bricky (https://www.youtube.com/@Bricky), whose latest videos I've all had this problem.

The most consistent way that I can reproduce the issue:

  1. Open Youtube video
  2. Increase video playback speed to 1.75x
  3. Right click> open Stats for Nerds
  4. Click away onto another window
  5. Observe dropped frames increasing roughly 2-4 per second
  6. Eventually see video freeze for up to a second or more while audio still plays normally

Actual results:

See description above. While the dropped frames normally aren't noticeable, especially because of the increased playback speed, the occasionally video freezes are. I've run the profiler to capture performance and have uploaded them below. It appears that garbage collection has something to do with the major freezes, not sure about the minor dropped frames.

https://share.firefox.dev/3x9YyVd
https://share.firefox.dev/3VxGIW4
https://share.firefox.dev/4cwOe9I
https://share.firefox.dev/4ab1rDA

Just checked the profiler links above and it looks like they aren't working. Uploaded them to Google Drive with link below:
https://drive.google.com/drive/folders/1GW6sJ5BKskjUe4Ar6yDMHBX3KadbmH-k?usp=sharing

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

May not be garbage collector after all. Just captured another big freeze and nothing in the profiler suggests garbage collection. I started wiggling the mouse after I noticed the video freezing, though it's noticeable in the renderer track of the GPU Process. Link below, and the file is in the Google Drive folder as well.

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

One more for good measure, this time I used the Graphics setting instead of Media.
https://share.firefox.dev/3TxBKpW

(In reply to hanchenlu from comment #3)

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

MediaSupervisor #103 has a RequestVideoData SkipVideoDemuxToNextKeyFrame marker after 8.5s, then MediaSupervisor #101 has a RequestDecode:V:720<h<=1080:kf,hw,vp9, marker then there are a couple more RequestDemux:V and RequestDecode:V and then video demux/decode activity seems to stop, with no subsequent CopyDemuxedData:V:720<h<=1080: markers.

Blocks: media-triage
Summary: YouTube videos drops frames and freezes possibly due to garbage collection → YouTube videos drops frames and freezes

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)
Summary: YouTube videos drops frames and freezes → YouTube videos drops frames and freezes at 1.75x
Flags: needinfo?(alwu)

Further details for refining, I believe this only appears on VP9 encoded video with frame rates greater than 30fps. I don't see this showing up as an issue when the Stats for Nerds window shows the video as AV1 nor any video at 30fps or lower. I've seen frame skips in 50fps video, but I don't think I've come across video freezes just yet.

Also as further details to help narrow this down, it also appears to only skip frames when the video is in theater or full screen mode. When I have the video open at regular size, I do not get frame skipping or freezes. Also including another log to help diagnose the issue.

https://share.firefox.dev/4cUz1jg

Hi, would you mind to provide your about:support? Also, is this issue 100% reproducible? or it happens after using Firefox for a while? If the case is latter, could you try to disable the pref gfx.direct3d11.reuse-decoder-device and then restart Firefox to see if it helps? Thanks!

Flags: needinfo?(alwu) → needinfo?(hanchenlu)
Attached file About:Support Raw Data

It's pretty reproducible, yeah, even when I closed and restarted Firefox. I disabled the preference you listed and so far it looks like it's working, especially with the latest video I noticed where it was really bad
https://youtu.be/NkbbbtjsD44?feature=shared

Flags: needinfo?(hanchenlu)

I'd also like to confirm with you, does this issue happen on other browsers as well? Or only on Firefox? From the profiled result in the comment8, I can see the problem is the hardware video decoding was too slow so that we couldn't catch up with 1.7x playback speed.

Also, you said "It's pretty reproducible", so I suppose the issue won't happen when you just restart Firefox? but it could happen soon after you start playing a couple of videos? Thank you!

Flags: needinfo?(hanchenlu)

As far as I can determine it's only Firefox. I used the same video as in my last comment in Chrome and it didn't drop frames during fullscreen, 1.75x speed playback.

When I mean pretty reproducible, I mean that when I've found a video where frame drops and freezes occur it will continue to do so even when I just closed and reopened Firefox. If you need me to do a profile refresh I can give that a try as well. The one time I can think of where a test video of mine no longer dropped frames is when Youtube started to serve me the AV1 encode rather than the VP9 one.

Another bit of detail when it comes to reproducibility, though, is that I noticed that it no longer drops frames if I've moved my mouse and the controls overlay for Youtube appears. If the controls for play/pause, timeline seeking, caption toggle, settings, etc. is on screen the dropped frames count no longer increases as the video progresses. Let me know if there's any other details you need from me, happy to provide more.

Nevermind, scratch the controls overlay bit. It seems to be the case for one of my test videos and not the other. It's inconsistent

Thanks for those detailed information! Could you help me give an update of how thing goes after using Firefox a while with disabled pref gfx.direct3d11.reuse-decoder-device so that we can verify whether disabling the pref really fixes the issue or not?

See Also: → 1890622

Will do! I've re-disabled it and will report back if the issue persists

Flags: needinfo?(hanchenlu)

Hi hanchenlu, can you also check if media.wmf.zero-copy-nv12-textures = false in about:config and restart Firefox address the problem for you?

Flags: needinfo?(hanchenlu)

(In reply to Sotaro Ikeda [:sotaro] from comment #17)

Hi hanchenlu, can you also check if media.wmf.zero-copy-nv12-textures = false in about:config and restart Firefox address the problem for you?

Hi! Finally gotten around to testing this. It looks like setting that flag to false doesn't help. It looks like changing the gfx.direct3d11.reuse-decoder-device flag was the most successful. I hadn't gotten any frame drop issues when I changed that flag to false. And when I set it back to true it took about a day of watching Youtube videos again for the issue to pop up (it didn't help that Youtube started serving me AV1 versions of some of the test videos I used to regularly reproduce the frame drops). I changed your config flag to false and the frame drops were still occuring.

I do believe it's something to do issue 1890622 where it takes some time before performance degrades, but it seems to persist through restarts of Firefox for me. I can close and reopen Firefox and the issue will persist. I've also reset my graphics driver with the Win + Ctrl + Shift + B shortcut and that doesn't solve it, either. I don't restart my computer often, but maybe that would reset the performance back to normal before it degrades again. I might give that a try when I have the chance.

Flags: needinfo?(hanchenlu)

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(jmathies)
Blocks: video-perf
No longer blocks: media-triage
Severity: -- → S3
Flags: needinfo?(jmathies)
Depends on: 1896823

deleted

Summary: YouTube videos drops frames and freezes at 1.75x → YouTube videos drops frames and freezes at 1.75x with NVIDIA GeForce RTX 3080
No longer depends on: 1896823

If current WMF api usage affect to the problem, Bug 1893427 seems to address the problem.

See Also: → hw-ffvpx
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: