Skip to content
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

Stuttering during playback with wayland and 23.976Hz or 24Hz refresh rates. #15597

Closed
6 tasks done
adolfotregosa opened this issue Dec 30, 2024 · 8 comments
Closed
6 tasks done

Comments

@adolfotregosa
Copy link

adolfotregosa commented Dec 30, 2024

mpv Information

mpv --version
mpv v0.39.0 Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Dec 30 2024 18:37:37
libplacebo version: v7.349.0
FFmpeg version: git-2024-12-27-5f38c82536
FFmpeg library versions:
   libavcodec      61.28.100
   libavdevice     61.4.100
   libavfilter     10.6.101
   libavformat     61.9.102
   libavutil       59.53.100
   libswresample   5.4.100
   libswscale      8.13.100

Other Information

- Linux version: CachyOS Linux
- Kernel Version: 6.13.0-rc4-1-cachyos-rc
- GPU Model: AMD iGPU M780
- Mesa/GPU Driver Version: Mesa 24.3.2-cachyos1.2
- Window Manager and Version: kde 6.2.4 
- Source of mpv: tried both stock cachyos ffmpeg+mpv and self compiled 0.39 + latest ffmpeg 
- Latest known working version: none 
- Issue started after the following happened: I don't know. This computer is new to me.

At 23.976Hz or 24Hz refresh rates, videos stutter randomly. However, at 120Hz, they don't. On X11, it's fine as far as I can tell perfect. Using my other computer on the same TV, which has an Nvidia card, I don't see this issue on either X11 or Wayland, so I'm leaning towards it being something related to the AMD (i)GPU + wayland. I’ve tried all the combinations I could think of with --hwdec, --gpu-api, --vo, --video-sync and --gpu-context without any success. The issue is only present in wayland.

Any suggestions ??

EDIT: At 120Hz using a 24Hz sample file so it's a multiple, stutters are there, just not as pronounced.
Now I'm really out of ideas lol.

EDIT2:
mpv FPS_test_1080p24_L4.1.mkv --hwdec=auto --vo=gpu-next --video-sync=display-resample --gpu-context=x11egl
At least at 120Hz, this combination helps tremendously, at 24Hz , still stutters.

EDIT3:
I've tested so far CachyOS, Manjaro and Nobara 41 both kde and gnome flavors. I also tested FFmpeg and MPV github master code. The video jumps always happen when TV refresh rate is set to match videos like 23.976Hz or 24Hz under wayland but not X11.

EDIT4:
I tried the Debian-based Siduction KDE, and X11 works perfectly, with videos running 100% smoothly at 23.976 and 24Hz, no - - video-sync option whatsoever. In my opinion, the issue is Wayland-related, but I’m not sure whether the fault lies with AMD or Wayland.

Reproduction Steps

The computer must be connected to a TV or monitor capable of switching the refresh rate to 23.976Hz or 24Hz and running wayland. I use the well-known mpv-kscreen-doctor.lua script to achieve this automatically. https://gitlab.com/smaniottonicola/mpv-kscreen-doctor
Play the sample file I attached and simply watch the moving bars. At some point they stutter/jump badly.

Expected Behavior

No stutters

Actual Behavior

stutters

Log File

output.txt

Sample Files

FPS_test_1080p23.976_L4.zip
FPS_test_1080p24_L4.zip

I carefully read all instruction and confirm that I did the following:

  • I tested with the latest mpv version to validate that the issue is not already fixed.
  • I provided all required information including system and mpv version.
  • I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • I attached the full, untruncated log file.
  • I attached the backtrace in the case of a crash.
@aljus7
Copy link

aljus7 commented Jan 4, 2025

I had the same issues when I had KDE on my second computer. I think it's an issue with Plasma, since on Hyprland the playback is smooth as butter. I tried so hard to make MPV on Hyprland stutter, and I can't; even dragging windows around and messing with other stuff while playing does not make MPV stutter.

P.S.: I always use video-sync=display-resample with hardware decoding set to auto-safe and vo=gpu, also with interpolation turned on.

@adolfotregosa
Copy link
Author

adolfotregosa commented Jan 5, 2025

I had the same issues when I had KDE on my second computer. I think it's an issue with Plasma, since on Hyprland the playback is smooth as butter. I tried so hard to make MPV on Hyprland stutter, and I can't; even dragging windows around and messing with other stuff while playing does not make MPV stutter.

P.S.: I always use video-sync=display-resample with hardware decoding set to auto-safe and vo=gpu, also with interpolation turned on.

Thank you for the response.
I've been trying hard to find a solution. Today, I tested GNOME, and I experienced the same stutters, so it’s not related to Plasma.

Video-sync helps with smoothing the video but not with the large stutters; the video literally jumps. - - gpu-context=x11egl helps a lot but unfortunately does not fix the issue. When I manage to start X11 (this amd 7840u computer doesn’t like starting in X11), videos play fine at 23.976 and 24Hz. So, my conclusion is that it's related to Wayland. I guess I can try hyperland but that's not the objective because I only like kde.

@adolfotregosa adolfotregosa changed the title Stuttering during playback with plasma 6.2 + wayland and 23.976Hz or 24Hz refresh rates. Stuttering during playback with wayland and 23.976Hz or 24Hz refresh rates. Jan 5, 2025
@yeahnope
Copy link

Recently, I have a very similar issue on mpv v0.39.0-613-g7a59a12b76:
Watching 23.976 Hz content while

  • display is running at 90.001Hz: bad framepacing
  • display is running at 90.001Hz, and I constantly move the mouse: good framepacing
    • display is running at 90.001Hz, another window is on screen which updates at 90 Hz: good framepacing
  • display is running at 60.001Hz: good framepacing

I am also on an amd gpu (780M), and run sway (version 1.10-dev-30c85842). So far I have tried downgrading the gpu firmware and downgrading mesa packages to to 24.3.3-1, but nothing helped.

@llyyr
Copy link
Contributor

llyyr commented Jan 21, 2025

  • I constantly move the mouse: good framepacing

another window is on screen which updates at 90 Hz: good framepacing

Disable adaptive_sync in your sway config

@yeahnope
Copy link

I have just booted kernel 6.11.10 instead of 6.12.10 and the issue seems gone. @adolfotregosa given that you use 6.13.0 and are also using amd graphics, could you try a kernel <=6.11 and see if that fixes your issue? If yes this issue should probably be moved to https://gitlab.freedesktop.org/drm/amd/-/issues

@redcathode
Copy link

redcathode commented Jan 31, 2025

If it's of any use: I have the same issue (Ryzen 5 7640U, Radeon 760M, Fedora Silverblue, and 6.12.10), where constantly moving the mouse or having another monitor w/o VRR connected leads to good frame pacing. Disabling VRR in GNOME settings doesn't seem to do anything, though - are there any issues I should be watching on the AMD driver side?

@redcathode
Copy link

Updating to 6.12.11 seems to have fixed the issue for me.

Also, @adolfotregosa - I haven't tested this myself, but you may want to try booting with the kernel parameter amdgpu.dcdebugmask=0x400 as mentioned here.

@adolfotregosa
Copy link
Author

Updating to 6.12.11 seems to have fixed the issue for me.

Also, @adolfotregosa - I haven't tested this myself, but you may want to try booting with the kernel parameter amdgpu.dcdebugmask=0x400 as mentioned here.

Thank you, but I've given up. On X11, it works perfectly, but I can't continue to rely on X11. I ended up switching to a far less power-hungry computer than my old one for watching videos, and using an Nvidia card solved all my problems. So, for the time being, it’s Nvidia for me. Hopefully, AMD and HDMI 2.1 under linux will someday be a viable option on AMD cards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants