mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
28.77k stars 2.93k forks source link

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

Open laichiaheng opened 3 months ago

laichiaheng commented 3 months ago

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 P81_GlassBlowing2_3840x2160@59.94fps_15200kbps_fmp4

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

llyyr commented 3 months ago

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

laichiaheng commented 3 months ago

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.

llyyr commented 3 months ago

target-colorspace-hint=yes

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

laichiaheng commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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.

llyyr commented 5 days ago

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

kasper93 commented 5 days ago

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

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

Does you 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.