SUMMARY On a slow notebook with Intel Gen 9.5 Gemini Lake graphics, video playback in mpv stutters vs. Xorg uncomposited. STEPS TO REPRODUCE 1. Use mpv (ideally recent git-master build, including recent libplacebo git-master) to play a 1080p 24fps video on a 1080p 48Hz display with this basic mpv config: vo=gpu-next hwdec=vaapi gpu-api=opengl sigmoid-upscaling=no linear-downscaling=no correct-downscaling=no cscale=bilinear scale=bilinear dscale=bilinear video-sync=display-resample 2. Judge playback result or enable mpv stats overlay with shift + i OBSERVED RESULT On Wayland, playback stutters and mpv reports mistimed/delayed frames in its stats. EXPECTED RESULT It shouldn't stutter. On uncomposited Xorg fullscreen, playback is without stutter and without tearing. Also on Windows, mpv D3D11 can play such videos with the provided config on the same device without stutter, also in windowed mode. This used to work also on KWin Wayland, back in the Plasma 5 days with manually configured maximum compositor latency. It shouldn't be related to thermal or power throttling, as power draw during video playback is just 3.5 Watts. Can test env vars and also patches that work against the stable KWin build, or soon 6.5 beta. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Arch kernel 6.16.4 KDE Plasma Version: 6.4.4 KDE Frameworks Version: 6.17.0 Qt Version: 6.9.2
Please set https://invent.kde.org/plasma/kwin/-/wikis/Environment-Variables#kwin_log_performance_data and record some performance data about KWin's presentation while playing a video that stutters.
Created attachment 184650 [details] kwin performance log
Hope this helps. I figured it might make sense to test with 59.94Hz/fps video instead, as this triggers more mistimed frames. I also checked again for it to play smoothly on xorg, which it does (with xf86-video-intel DDX at least). mpv stats also don't recognize every single stutter occurrence I can discern visually.
๐๐งน โ ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME. For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging. Thank you for helping us make KDE software even better for everyone!
Not noticing an improvement with 6.4.90. Attaching one more performance log. This time with ICC profile calibration on, which makes the issue more distinct, despite the GPU still not being maxed out and SoC power draw well below its 6W limit.
Created attachment 185294 [details] stats with ICC correction
The GPU seems to be doing fine, the majority of dropped frames comes from the commit thread waking up too late (or the atomic commit taking too long): - total of 942 frames - dropped 59 frames (6.3%) - 52 because of too late commits (5.5%) - 4 because of late rendering start (0.42%) - 3 because of render times (0.32%) - 8698us average render time - 8946us median render time The max render time is also not exactly great though, at 32ms. I'm not entirely sure how to attempt to rectify this tbh. Maybe the safety margin calculation needs to be even more conservative... but on your hardware, it's already never even going below 2.5ms. Still, you can test with setting https://invent.kde.org/plasma/kwin/-/wikis/Environment-Variables#kwin_drm_override_safety_margin to some higher value. 4000 could maybe work.
Setting KWIN_DRM_OVERRIDE_SAFETY_MARGIN=4000 indeed does massively improve the situation.