[Wayland] Frame drops/stuttering on YouTube and WebGL with hybrid graphics (fixed by disabling vsync)
Categories
(Core :: Graphics: CanvasWebGL, defect)
Tracking
()
People
(Reporter: petrufagurel, Unassigned, NeedInfo)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
Steps to reproduce:
System Information:
OS: Ubuntu 26.04 LTS
Display Server: Wayland
GPU: Hybrid Intel / Nvidia RTX Blackwell 3000 PRO
Steps to reproduce:
Open Firefox on Wayland with default settings.
Play a YouTube video or run a WebGL browser game.
Go to about:config and set widget.wayland.vsync.enabled to false. Restart Firefox.
Play the same video/game.
BROKEN (V-Sync TRUE, dropping frames): https://share.firefox.dev/4y73HIE
SEMI-WORKING (V-Sync FALSE, fewer dropped frames): https://share.firefox.dev/4v87y5i
Actual results:
With vsync enabled : stuttering, dropped frames, and lag.
Expected results:
Without v-sync enabled: the stuttering is reduced(not completely).
On Ubuntu 26.04 with Chromium frames are still dropped at the same pace as Firefox with v-sync disabled.
On the same laptop on Windows 11, no frames dropped are present.
Comment 1•4 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Graphics: CanvasWebGL' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•4 months ago
|
||
Any thoughts on this? I haven't looked into the vsync code for Wayland, I'm familiar with vsync code for Windows so I know some of the problem space but not the specifics here.
Comment 3•4 months ago
|
||
Please run on terminal with MOZ_LOG="WidgetVSync:5" env variable and check the fps reported - it should roughly match the screen fps.
You may also try VSync tester - https://www.vsynctester.com/
Hello,
I have recorded in a file using MOZ_LOG="WidgetVSync:5". It records everything, even static pages. This file is in the attachments. On Youtube the video recorded is https://youtu.be/1La4QzGeaaQ?si=_fTegYOZVN2F_SPm at 4K 60fps.
Comment 6•4 months ago
|
||
The vsync log looks correctly. Please try https://www.vsynctester.com/ - is the VSync correct there?
Comment 9•4 months ago
|
||
(In reply to Nat from comment #8)
It is mainly correct, rarely it is red or cyan.
Then it may not be an issue with VSync then.
Please run on terminal with MOZ_LOG="FFmpegVideo:5" env variable, do video playback and attach the log here.
Also do you see the lagging if you play a saved clip from disk?
Thanks.
| Reporter | ||
Comment 10•2 months ago
|
||
Hi Martin,
Yes, it also happens with a local video. I tested a 20-second 4K60 H.264 clip with fresh Firefox profiles:
- Wayland VSync enabled: 17 and 49 dropped frames.
- Wayland VSync disabled: zero drops in both runs.
The FFmpeg logs show hardware decoding working. I also reproduced the problem with the official Firefox 155.0.1 build outside Snap.
The VSync timing looks mostly normal, but the profiler shows Firefox skipping video frames. I have the FFmpeg logs available.
| Reporter | ||
Comment 11•2 months ago
|
||
FFMPEG log
Comment 12•2 months ago
|
||
Hi Nat,
I am experiencing the exact same issue on Fedora 44 Workstation. I also tested Chromium based browsers and unfortunately the issue persists there as well. The only browser where this does not reproduce is GNOME Web (Epiphany). Could you please test this on your end?
Comment 13•2 months ago
|
||
Yes, the decode looks correct and working - so the difference may be really the vsync, but it also shows ~60hz sync.
Comment 14•2 months ago
|
||
Can you try to enable vsync but disable HW video decoding? (media.hardware-video-decoding.enabled -> false at about:config).
Description
•