Sway, Weston & Xorg modesetting - mistimed frames in mpv due to vsync jitter spikes with Intel GPU
Originally reported here: https://github.com/mpv-player/mpv/issues/7106
Stutter free video playback is not possible on Gemini Lake (and likely also not on Skylake and others) in both Wayland and Xorg sessions with modesetting driver.
To reproduce, run mpv 0.30 via mpv --no-config --video-sync=display-resample --hwdec=vaapi http://www.oc-burner.de/ftp/Videos/juddertest/juddertest_60.mp4
on a ~60Hz display. There is stutter each few seconds, thus mpv's statistics recognize vsync jitter spikes and in the wake mistimed frames (either watch mpv's terminal output or enable LUA stats via Shift + i).
There is no stutter with xf86-video-intel DDX and there is no stutter either with AMD Polaris GPU (neither Wayland, nor Xorg modesetting DDX, so it's definitely Intel specific).
Question probably is if the issue stems from Mesa (e.g. GBM) or if there's something wrong in Intel kernel driver (wild guess: atomic pageflip?).
Tested on
Arch Linux
xorg 1.20.5-4 from Arch repo
weston 7.0.0
recent sway-git/wlroots-git