mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.87k stars 2.87k 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 5 months ago

CounterPillow commented 5 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 5 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 5 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 1 month 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 1 month 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.