vaapi doesn't work and Garbled output in vaapi-copy , waylandvk and vulkan (radv driver)
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Important Information
- mpv version : mpv 0.34.0
- Linux Distribution and Version : Void Linux 5.15.12_1
- Source of the mpv binary : distro
- If known which version of mpv introduced the problem : No
- Window Manager and version : sway 1.6.1
- GPU driver and version:
mesa 21.3.2
mesa-vulkan-radeon-21.3.2_1
amdvlk-2021.Q3.7_1
Context
I use ThinkPad E14 with i7-10510u processor which comes with AMD radeon rx 640 GPU discrete GPU . I run sway (v1.6.1) wayland compositor on it . I use mpv in sway.
Also , I can assure you that same problem persists in both voidlinux and archlinux ( I have tried mesa-git and mpv-git too).
With Intel GPU in sway , hardware acceleration works properly.
vaapi, wayland ,opengl-> works
vaapi, waylandvk , vulkan -> works
vaapi-copy , waylandvk , vulkan -> works
vaapi-copy , wayland , opengl -> works
And this issue is about problems all regarding amd radeon rx640 .
With amdgpu in sway though, I have two choices for vulkan driver (which works with mesa amdgpu driver) => RADV and amdvlk .
Here are the results of hardware acceleration with amdgpu + radv drivers .
amd radeon rx 640(radeon):
amdgpu + RADV:
vaapi, wayland ,opengl-> doesn't work(fallbacks to no hwaccel; radeonsi_drv_video.so init failed)
vaapi, waylandvk , vulkan -> doesn't work(garbled output and no vaapi)
vaapi-copy , waylandvk , vulkan -> works but garbled output
vaapi-copy , wayland , opengl -> works
----
vaapi , drm , opengl -> doesn't work; fallback to no hwaccel
vaapi, displayvk, vulkan -> doesn't work ; fallback to no hwaccel
vaapi-copy, drm , opengl -> works
vaapi-copy, displayvk , vulkan -> works
----
vaapi,x11egl, opengl -> works
vaapi, x11vk, vulkan -> doesn't work ; fallback to no hwaccel
vaapi-copy, x11egl, opengl -> works
vaapi-copy , x11vk , vulkan -> works
With amdgpu + amdvlk , things are little different ,
amdgpu + amdvlk:
vaapi, wayland ,opengl-> doesn't work(fallbacks to no hwaccel ; error message: radeonsi_drv_video.so init failed)
vaapi, waylandvk , vulkan -> doesn't work( no vaapi)
vaapi-copy , waylandvk , vulkan -> works
vaapi-copy , wayland , opengl -> works
----
vaapi , drm , opengl -> doesn't work; fallback to no hwaccel
vaapi, displayvk, vulkan -> doesn't work ; fallback to no hwaccel
vaapi-copy, drm , opengl -> works
vaapi-copy, displayvk , vulkan -> works
----
vaapi,x11egl, opengl -> works
vaapi, x11vk, vulkan -> doesn't work ; fallback to no hwaccel
vaapi-copy, x11egl, opengl -> works
vaapi-copy , x11vk , vulkan -> works
Briefly,
vaapiin amdgpu in both drivers radv/amdvlk in both opengl/vulkan doesn't work inwaylandsway (but vaapi-copy works in few cases that i mentioned above). Is it because my amd radeon rx640 is dedicated GPU ? But ,vaapi,x11egl, openglworks though ( why?)vaapi-copy , wayland , openglworks in amdgpu (mesa driver) in sway . It has nothing to do with vulkan. So, this point(2) is not a issue .- This point might be bug with RADV or with waylandvk gpu context in mpv.
vaapi-copy , waylandvk , vulkan in amdgpu+radv shows that vaapi is working . But, it produces garbled output.
Screenshot of vaapi-copy,waylandvk, vulkan , amdgpu+radv :

But, if we use amdvlk instead of radv here , it produces correct output.
Screenshot of vaapi-copy,waylandvk, vulkan , amdgpu+amdvlk :

-
I thought it was bug of vulkan implementation in radv. But, if we use
vaapi-copy, displayvk , waylandit uses wayland vaapi vulkan and displays properly under both radv and amdvlk. So, it might be more related to waylandvk with radv driver. Why displayvk works and why not waylandvk ? -
vaapi, x11vk, vulkandoesn't work . It fallbacks to sw rendering. Why doesn't it work(it must display through XWayland)? -
However
vaapi,x11egl, opengl,vaapi-copy, x11egl, openglandvaapi-copy , x11vk , vulkanwork in Xwayland in sway using amdgpu in both vulkan drivers.
How I have run?
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json DRI_PRIME=1 LIBVA_DRIVER_NAME=radeonsi mpv --no-config --hwdec=vaapi --gpu-context=waylandvk --gpu-api=vulkan --vaapi-device=/dev/dri/renderD129 filename
I have changed VK_ICD_FILENAMES to /usr/share/vulkan/icd.d/amd_icd64.json if i need to use amdvlk driver( i used to delete this driver when i needed to try radv ) and changed other parameters corresponding to situation.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report provides a reproduction command using mpv with vaapi, waylandvk, Vulkan, RADV, and amdvlk, but names no source file or test. Start by reproducing the listed combinations with the supplied command and compare the RADV and amdvlk results; done means identifying and fixing the cause of the RADV garbled output or documenting that it belongs to an external driver.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, linux
- Domain
- cli, computer-graphics, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100