VLC/MPV with Hardware Acceleration (and VSync)

Hello everyone, I have a Banana Pi M5 and I want it to play videos on a big screen. Everything seems to be working, but I inspect that videos are tearing, i.e. they are played without vertical synchronization.

Now let me introduce my environment:

  1. Installed OS: Debian 10 Buster Lite
  2. VLC is installed via APT.
  3. Either it’s launched in terminal, thus using the Framebuffer vout, either it’s launched in minimal X enviroment (xorg, launching via startx command) with --vout=x11 parameter. The result is the same.

Like this videos are played somewhat well, in 60FPS, but as said before without VSync and thus teared, which is unacceptable for a big screen.

What I’ve tried to do:

  1. Compiling VLC myself with some hardware acceleration options. Didn’t succeed as there’s no well documentation how to do it (the only thing I could find are those old articles for Raspberry Pi as this one, but they won’t really work for Banana).
  2. Messing up with VLC launch options to see if it could enable VSync. It didn’t.
  3. Understanding which video driver is used and trying to reinstall it. After running glxinfo I’ve understood that there’s something wrong with the video driver itself, as I’ve obtained this string: OpenGL renderer string: llvmpipe (LLVM 7.0, 128 bits). It’s llvmpipe, which is a software accelerated interface for OpenGL, maybe that’s why I can’t use any kind of hardware acceleration. I’ve been looking for how to reinstall it to make it recognize as Mali G31 MP2 (which is our actual GPU on Banana Pi M5), but found nothing.
  4. Using MPV instead of VLC. I’ve tried to launch it with different vout modes, such as xv, x11, vdpau, gpu, sdl, vaapi, libmpv. Only x11 and sdl worked. gpu is told to be the best vout mode which uses all the GPU power, and is the default one, but it just doesn’t work in here. Instead, if launching MPV with no parameters, sdl mode is used which is too slow (like 5FPS or less). Interestingly, VLC works the same way, if not specifying vout mode upon starting in X mode, video is played at 5FPS (if launching in terminal it uses the framebuffer mode which is the same as x11). And x11 is something I’ve already seen in VLC, 60FPS and no VSync.

Well, after these failures I would like it if someone explained me what’s a problem here and how do I fix it. Have a good day!

llvmpipe means video is decoding video on the CPU not the dedicated IP blocks on the SoC. It’s likely the kernels in the OS images you’re testing are compiled without Amlogic media codec support enabled (as support is still experimental) and VLC/MPV depend upon ffmpeg libs which also need a pile of not-yet-upstream patches to work best with staging media codec drivers. Media support is the current achilles heel with upstream Amlogic kernels. The vendor kernel does support everything; but then you’re stuck with ancient versions of media apps that have to be hacked to run with the proprietary codec drivers and those old versions often have their share of bugs. TL/DR: the vendor kernel is rarely the solution.

Hello Christian,

Thank you for your reply! I’ve understood that problem was indeed about missing patches in the kernels and not actually using GPU.

But suddenly, I’ve found a solution: after trying to install Armbian again, I’ve seen that it now supports and comes with a Panfrost driver, i.e. it recognizes the GPU and uses it. MPV works perfectly with it. VLC doesn’t, but now it’s not a problem anymore with MPV.

Which version did you install? I am having almost same problems.