mpv icon indicating copy to clipboard operation
mpv copied to clipboard

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

Open Celmor opened this issue 2 years ago • 1 comments

Important Information

Provide following Information:

  • mpv version version 0.34.0-365-g369168b9be
  • Linux Distribution and Version 5.18.5-1-MANJARO
  • Source of the mpv binary mpv-build
  • Window Manager and version sway 1.8-dev-d726e506
  • GPU driver and version amdgpu 22.0.0-1

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

Celmor avatar Jul 07 '22 00:07 Celmor

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 avatar Jul 07 '22 00:07 Dudemanguy

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

Dudemanguy avatar Jan 09 '23 01:01 Dudemanguy