mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Both gpu-next and hwdec=vulkan causes unstable refresh rate on a monitor in adaptive-sync mode.

Open laichiaheng opened this issue 1 year ago • 6 comments

mpv Information

mpv v0.38.0-711-g67e087dcae Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.349.0 (v7.349.0-5-g82bf46ae)
FFmpeg version: N-116730-g7e5410eadb
FFmpeg library versions:
   libavcodec      61.11.100
   libavdevice     61.2.100
   libavfilter     10.2.102
   libavformat     61.5.101
   libavutil       59.34.100
   libswresample   5.2.100
   libswscale      8.2.100

Other Information

- Linux version: Arch Linux
- Kernel Version: 6.10.5-zen1-1-zen
- GPU Model: [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c0)
- Mesa/GPU Driver Version:Mesa 24.1.6-arch1.1
- Window Manager and Version: KWin 6.1.4-1
- Source mpv: AUR mpv-build-git
- Introduced in version:

Reproduction Steps

It causes unstable refresh rate in adaptive sync mode. There are 5 situations that I have tested.

  1. vo=gpu + no hwdec + target-colorspace-hint=yes = stable.
  2. vo=gpu-next + no hwdec + target-colorspace-hint=yes = unstable.
  3. vo=gpu-next + hwdec=vaapi + target-colorspace-hint=yes = stable.
  4. vo=gpu-next + hwdec=vulkan + gpu-context=waylandvk + target-colorspace-hint=yes = unstable
  5. vo=gpu-next + no hwdec + gpu-context=waylandvk + target-colorspace-hint=yes = stable

Expected Behavior

No matter gpu-next or hwdec=vulkan, the refresh rate should be as stable as default.

Actual Behavior

They causes issue in adaptive sync mode.

Log File

  1. vo=gpu.log
  2. vo=gpu-next.log
  3. vo=gpu-next_hwdec=vaapi.log
  4. vo=gpu-next_hwdec=vulkan.log
  5. vo=gpu-next_no-hwdec_waylandvk.log

Sample Files

Any videos, but you can search [email protected]_15200kbps_fmp4

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

  • [X] I tested with the latest mpv version to validate that the issue is not already fixed.
  • [X] I provided all required information including system and mpv version.
  • [X] 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.
  • [X] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • [X] I attached the full, untruncated log file.
  • [X] I attached the backtrace in the case of a crash.

laichiaheng avatar Aug 19 '24 15:08 laichiaheng

What does "unstable" mean and how are you checking your refresh rate? And what is your configured modeline?

llyyr avatar Aug 19 '24 15:08 llyyr

What does "unstable" mean and how are you checking your refresh rate? And what is your configured modeline?

The OSD on my monitor. https://youtu.be/EtiwF7JNKag

If the videos is at 60fps, the refresh rate should be near 60Hz, it does show on the stable result.

laichiaheng avatar Aug 19 '24 15:08 laichiaheng

target-colorspace-hint=yes

Is this relevant to reproducing the issue? Also I can't reproduce on sway, can you try another compositor?

llyyr avatar Aug 19 '24 15:08 llyyr

target-colorspace-hint=yes

Is this relevant to reproducing the issue?

After removing target-colorspace-hint=yes, the refresh rate is much stable, but not as stable as those stable results. I need it to play HDR videos on HDR monitor.

Also I can't reproduce on sway, can you try another compositor?

It also happens on Gnome46.

laichiaheng avatar Aug 19 '24 15:08 laichiaheng

What does "unstable" mean and how are you checking your refresh rate? And what is your configured modeline?

It is how a stable refresh rate looks like: https://youtu.be/_x7xZ2PGk2E

laichiaheng avatar Aug 19 '24 15:08 laichiaheng

By the way, ENABLE_HDR_WSI=1 is in /etc/environment, with it, I can watch HDR videos directly in KDE Plasma6.1. It shouldn't be the reason to cause the problem, becasue Gnome has the problem, too.

laichiaheng avatar Aug 19 '24 16:08 laichiaheng

Is this still an issue? I still can't reproduce this. If this only occurs with target-colorspace-hint=yes then the issue is most likely elsewhere

llyyr avatar Nov 23 '24 16:11 llyyr

vo=gpu + no hwdec + target-colorspace-hint=yes = stable.

target-colorspace-hint=yes does nothing for vo=gpu.

Does your monitor have issues with VRR and HDR enabled? mpv literally does not care about VRR, so only thing that differs is enabling HDR apparently, in your monitor.

Highly doubt gpu-next is a factor here.

kasper93 avatar Nov 23 '24 17:11 kasper93

Same problem here. With gnome wayland session. gpu-next nvdec context=x11vk combination works smooth, gpu-next nvdec context=waylandvk stutters. Btw, waylandvk seems to have better color.

tramchamploo avatar Sep 23 '25 07:09 tramchamploo