Bug 486257 - Stuttering with video playback in 24Hz / MPV
Summary: Stuttering with video playback in 24Hz / MPV
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: performance (show other bugs)
Version: 6.0.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-28 16:51 UTC by Atohmdiy
Modified: 2025-02-17 22:43 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
.csv (696.22 KB, text/csv)
2024-09-30 19:40 UTC, Atohmdiy
Details
kvin .csv files (649.00 KB, text/csv)
2024-12-08 11:40 UTC, Aljosa
Details
Second 60fps screen .csv (99.40 KB, text/csv)
2024-12-08 11:41 UTC, Aljosa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Atohmdiy 2024-04-28 16:51:00 UTC
SUMMARY
Since plasma 6.0.0 release, i am experiencing random stutter with fullscreen video playback with mpv and wayland. These stutter are very random and could be light to heavy depending of the video. I am using mpv-kscreen-doctor script to sync the refresh rate of my display to the video, which is often ~24Hz.

WHAT I TRIED :
- Everything i could try with mpv options : vo-gpu / vo-gpu-next, different hwdec, disable shaders, running with --no-config etc.
- Disabling HDR or VRR doesn't correct the issue.
- I am currently using X11 again with the xrandr script and my usual configuration and get no stuttering.
- Without the screen set to 24Hz, it seems there is no stuttering with higher refresh like 60Hz, so it seems related to 24Hz playback.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: CachyOS / Linux 6.8 / Plasma 6.0.4
Comment 1 Zamundaaa 2024-07-17 21:14:11 UTC
Do you still see this in 6.1?
Comment 2 Atohmdiy 2024-07-17 22:01:58 UTC
(In reply to Zamundaaa from comment #1)
> Do you still see this in 6.1?

Mostly fine now but there is still occasional stutter in "normal" condition.
There is also some stutter with heavy cpu load with gpu hw decoding.
Comment 3 Bug Janitor Service 2024-08-01 03:46:22 UTC
🐛🧹 ⚠️ 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!
Comment 4 Zamundaaa 2024-08-01 09:07:32 UTC
To turn that nag into something more useful, there are some fixes in 6.1.4 that might help with this. Could you check if they do?
Comment 5 Bug Janitor Service 2024-08-16 03:47:07 UTC
🐛🧹 ⚠️ 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!
Comment 6 Bug Janitor Service 2024-08-31 03:47:56 UTC
🐛🧹 This bug has been in NEEDSINFO status with no change for at least 30 days. Closing as RESOLVED WORKSFORME.
Comment 7 Atohmdiy 2024-08-31 11:52:15 UTC
I can tell you that this bug is still not resolve, i am still experiencing random stutter in 24hz video playback. It's hard to reproduce as it seems to stutter with specific video, mostly 4k uhd/hdr, but i also experience it in a few 1080p video.
Comment 8 Zamundaaa 2024-09-02 16:52:19 UTC
Okay. Could you set the KWIN_LOG_PERFORMANCE_DATA=1 environment variable, then reboot, play back a video in mpv at 24Hz, and then upload the *.csv file KWin dumps into your home directory here? It might at least uncover where the stutter is
Comment 9 Atohmdiy 2024-09-30 19:40:00 UTC
Created attachment 174240 [details]
.csv

(In reply to Zamundaaa from comment #8)
> Okay. Could you set the KWIN_LOG_PERFORMANCE_DATA=1 environment variable,
> then reboot, play back a video in mpv at 24Hz, and then upload the *.csv
> file KWin dumps into your home directory here? It might at least uncover
> where the stutter is

I find a first uhd/hdr video that has a ton of very fast stutter. But it seems there is a lot of these error reported in mpv term : 
[ffmpeg/video] hevc: First slice in a frame missing.
[ffmpeg/video] hevc: Multiple Dolby Vision RPUs found in one AU. Skipping previous.

I have another video (uhd/hdr) that show no error but has a lot of stutter

I send you the .csv files.

Both of these video have been tested under X11 and MPV to be sure.
Comment 10 Zamundaaa 2024-10-23 15:16:12 UTC
hm, the performance data says that 3.7% of all frames got dropped, and effectively all of them because KWin starts too late with rendering. I'm not sure what to do about that right now tbh, *something* must be keeping KWin's main thread busy while it's supposed to start rendering, but figuring out what that is or how to mitigate it is challenging.
That it only happens with the 24Hz mode is especially odd.
Comment 11 Atohmdiy 2024-10-23 16:00:37 UTC
(In reply to Zamundaaa from comment #10)
> hm, the performance data says that 3.7% of all frames got dropped, and
> effectively all of them because KWin starts too late with rendering. I'm not
> sure what to do about that right now tbh, *something* must be keeping KWin's
> main thread busy while it's supposed to start rendering, but figuring out
> what that is or how to mitigate it is challenging.
> That it only happens with the 24Hz mode is especially odd.

I was still using X11 until recently but i tried again a few days ago, as there was update with kwin. I don't see stutter anymore in one video that was almost unwatchable. I saw a few others video and it seems ok now. Of course i need to see more to be sure.
Comment 12 Aljosa 2024-12-08 11:38:16 UTC
It looks like I am experiencing the same issue: microstutters while playing a video in MPV. In my case, it only happens when MPV is set to vo=gpu and not when set to vo=gpu-next. You really need to look hard to see the microstutters, but from time to time a larger stutter occurs.
Comment 13 Aljosa 2024-12-08 11:40:01 UTC
Created attachment 176437 [details]
kvin .csv files

this is kvin .csv file
Comment 14 Aljosa 2024-12-08 11:41:49 UTC
Created attachment 176438 [details]
Second 60fps screen .csv

mpv was not playing on that screen. DP-2 is the screen where the mpv was playing at.
Comment 15 Atohmdiy 2025-02-17 22:40:23 UTC
The bug seems to have "appears" again. I just try in 6.3.0 and stutter is here...
Comment 16 Atohmdiy 2025-02-17 22:43:04 UTC
 I want to add i am using x11 for video playback since maybe 2 month. Stuttering is atrocious. Also using the video-sync=display-resample result is a lot worse.