-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
framerate on variable refresh rate displays fluctuates and causes flickering #14075
Comments
#12005 (comment)
Note that your result is already much better than the Windows result mentioned. I don't think there is anything mpv can do about this. |
I'd be curious to see if you notice any difference using the drm backend with VRR directly instead of going through sway/wlroots but what nanahi said pretty much still stands. |
To make sure: You mean running with
I don't know anything about mpv's internals, especially not how the sync to the audio works. But couldn't one calculate when the next frame needs to be presented and (busy) wait until then using a sufficiently high-precision clock? Sort of like a self-imposed vsync. Maybe wayland's presentation time protocol could help? |
That's already what happens on wayland (minus the busy wait part). And mpv already uses presentation time too. |
Yeah, if we want to do something at certain time we would need to busy wait at least some part of the sleep duration. Normal sleep will never be accurate enough. It is doable, but this is precisely why display-sync exist, to avoid any timing issues and lock presentation to vsync. This is again the topic of frame limiter basically, that we had some time ago. |
I only used |
No, they are not compatible with VRR. |
In theory, the polling could be removed during the wayland loop and it becomes just purely a busy wait. I doubt that would change OP's results much at all though because it would still be dependent on whenever the compositor sends a frame callback. |
Important Information
Provide following Information:
Reproduction steps
mpv --no-config --video-sync=audio --log-file=output.txt 'https://www.youtube.com/watch?v=oaCfKda82nA'
Expected behavior
The framerate should be very close to 60Hz and vary very little. The screen should not flicker.
Actual behavior
Using drm_monitor I measured the timing when the vsyncs actually occur. Sway allows to enable/disable VRR using
swaymsg output * adaptive_sync on|off
. Inone can see that with VRR off, the framerate is stable at 120Hz, as expected. With VRR on it fluctuates around 60Hz.
Zooming in one can see the oscillations have an amplitude of around 2.5Hz. The exact amount varies with the video, but the phenomenon can be reproduced reliably. This fluctuation does not sound like much, but can be clearly seen on screen as flickering, especially in darker areas.
Log file
output.txt
Sample files
Occurs on any video I happened to look at, but the measurement was taken on this video.
The text was updated successfully, but these errors were encountered: