Hardware video decoding with VLC and va-api on AMDGPU on Arch Linux

Pawit Pornkitprasan
2 min readApr 4, 2020

--

The Issue

One thing that I haven’t got to work on my Arch installation is video acceleration using va-api on VLC.

VLC would throw the following error and fallback to VDPAU, another hardware video decoding API.

[00007f54a4001f70] glconv_vaapi_x11 gl error: vaDeriveImage: operation failed
[00007f54b0046080] main video output error: video output creation failed
[00007f54b4cca8e0] main decoder error: failed to create video output
Error messages from VLC

The Fix

Today I got curious and got Googling again. It seems that the issue was discovered and a patch was created by AMD to fix the issue. However, the fix isn’t correct and break some features on some other software so it was reverted out.

However, since I use VLC, I thought to create a build with that patch to test it out.

Based off Arch’s official PKGBUILD, I’ve modified it to apply the patch and build my own copy of libva-mesa-driver. You can find my modified PKGBUILD here: https://github.com/pawitp/libva-mesa-driver-vlc.

After building it and installing it with:

sudo pacman -U libva-mesa-driver-20.0.4-999-x86_64.pkg.tar.xz

VLC now decodes video using va-api correctly.

Extra: GitHub Actions

For the test, I’ve built the package on my machine in an Arch Linux Docker container since I didn’t want to pollute my installation with all the dependencies the compilation requires.

Then I’ve thought, why not try out the new CI integrated into GitHub, GitHub Actions? I wiped up a simple build script and after several tries, was able to build the package successfully, computing power courtesy of GitHub.

It’s super easy and powerful, since I can run the build in any Docker container I want!

--

--

No responses yet