mpv-player / mpv

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

gpu-next + vulkan under heavy system load leads to partially presented or out-of-order frames on amdgpu #13811

Open CounterPillow opened 8 months ago

CounterPillow commented 8 months ago

Important Information

Provide following Information:

Reproduction steps

Be on a Ryzen 7 Pro 3700U, have some CPU-heavy task running in the background making the whole SoC throttle to stay within its power envelope.

mpv --no-config --log-file=/tmp/mpvsucks-vulkanagain.log --gpu-api=vulkan --profile=high-quality --vo=gpu-next --hwdec=auto --ytdl-format='bestvideo[height<=1080]+bestaudio/best' https://www.youtube.com/watch?v=dpiYR1_CsiI

Glitches do not happen with OpenGL. Glitches do not happen with vo=dmabuf-wayland.

Glitches also occasionally occur without CPU heavy tasks in the background, probably due to something taking a little too long and ruining the timing.

Expected behavior

mpv drops the whole frame.

Actual behavior

mpv partially draws the frame, sometimes drawing a few frames in the future or past but only in parts, and is generally unpleasant to look at.

Log file

https://overviewer.org/~pillow/up/d916e5bf9c/mpvsucks-vulkanagain.log

Sample files

YouTube link in the repro command should suffice.

CounterPillow commented 8 months ago

And here's another logfile with both mpv and libplacebo updated to latest master and rebuilt without whatever weird shit keeps touching my git checkouts preventing the git pulls of ./rebuild from working: https://overviewer.org/~pillow/up/53b48aa64b/mpvsucks-vulkanupdated.log

zhangn1985 commented 7 months ago

same happens on arm device: Rk3288. --vo=gpu-next --gpu-hwdec-interop=drmprime very high system load compares with --vo=gpu --gpu-hwdec-interop=drmprime-overlay

with a cooling fan at full speed, system temperature still higher than 70C.

and also glitches.

voidastro4 commented 4 months ago

I have an issue which looks identical to the demo video provided here.

Ryzen 5000 U-series, amdgpu Sway. 4K screen, scale factor 2.

vo=gpu-next gpu-api=vulkan gpu-context=waylandvk hwdec=vulkan profile=gpu-hq

No system load. No load with video playing. hwdec appears irrelevant. Source is h264 480p video. Happens when playback speed is > ~2x Issue manifests when fullscreen or window size crosses a threshold.

commenting out profile=gpu-hq Resolves the issue.

kasper93 commented 3 months ago

Might be related to: https://github.com/Nevcairiel/LAVFilters/issues/496 https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/380 Unless it also happen without hwdec, which the above issues are mostly about.

CounterPillow commented 1 month ago

Only happens with hwdec, can still reproduce as of current master.

kasper93 commented 1 month ago

Can you reproduce with ffplay or ffmpeg?

CounterPillow commented 1 month ago

No, on account of ffplay crashing xwayland.

llyyr commented 1 month ago

This also only happens with hwdec=vaapi + gpu-next, and not with hwdec=vulkan + gpu-next as reported in IRC.