mpv-player / mpv

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

vulkan-swapchain option on wayland buggy (causes blocks in mesa?) #10373

Open Celmor opened 2 years ago

Celmor commented 2 years ago

Important Information

Provide following Information:

Reproduction steps

--gpu-api=vulkan --vulkan-swap-mode=immediate --ao=pulse or vulkan-swap-mode=fifo

Expected behavior

audio continues when mpv is backgrounded

Actual behavior

audio hangs

Log file

relevant output

[vo/gpu/vulkan/libplacebo] Requested swap mode unsupported by this device, falling back to VK_PRESENT_MODE_FIFO_KHR
AO: [pulse] 44100Hz stereo 2ch float
...
Audio device underrun detected.

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

full-log

Dudemanguy commented 2 years ago

Using an opengl swapinterval of 1 (or greater) would also cause the same thing. This is why internally the wayland context set vulkan to mailbox and opengl to swapinterval 0 (it's just a wayland limitation). Now, it would be nicer if mpv could prevent users from overwriting this, but the code for setting presentation modes/swapintervals is shared between all platforms. It's not that this is impossible or anything, but it becomes something that has to touch more than just the wayland-specific files which is ugly imo.

Dudemanguy commented 1 year ago

Just for reference, there's actually a pending MR in mesa that would alleviate this pain of indefinite blocking.