OrangePi5 video hardware acceleration

Hello
I have been a faitfull user od Dietpi for years now. It is simply the goto OS for SBCs or VM, but now I ran into a problem. I’m trying to use Frigate NVR on a OrangePi and I would like to use Dietpi for the OS. But since Dirtpi is very light weigth it seems to be missing drivers for hardware accelerated video decoding. I need /dev/video-enc0 and /dev/video-dec0. People run Frigate on OrangePi5 but everyone installs Joshua,s Ubuntu image for OPi5. I did it my self and it works great. That Ubuntu also has drivers for RKNN preinstalled. I would like to know how can I install these druvers to Dietpi?

Can you try to enable this device tree overlay: panthor-gpu

Add it to the overlays line in /boot/dietpiEnv.txt.

EDIT: You also need to adjust the overlay_prefix line to overlay_prefix=rockchip-rk3588. I really need to implement support for multiple prefixes, for those RK3588 boards, which have overlays with 3-4 different prefixes available, annoyingly :sweat_smile:.

1 Like

Like this?

rootdev=UUID=53ccee89-f9e3-4685-936d-4e23ed78a21e
rootfstype=ext4
# The init system logs to the console defined last.
consoleargs=console=ttyFIQ0,1500000 console=tty1
usbstoragequirks=
extraargs=net.ifnames=0
docker_optimizations=off
overlay_path=rockchip
overlay_prefix=rockchip-rk3588
overlays=panthor-gpu
user_overlays=

Yes!

Actually, Mesa 24.1 should have brought G610 support. And it (Mesa 24.2) is available via Bookworm backports. So for compatible userland libraries, this would likely be additionally needed:

cat << '_EOF_' > /etc/apt/preferences.d/dietpi-mesa
Package: src:mesa
Pin: release a=bookworm-backports
Pin-Priority: 500
_EOF_
apt upgrade

But likely applications like Chromium and FFmpeg would then also need to be compiled against them.

1 Like

Hello,
I’ve got an Orange pi 5 MAX, managed to successfully enable hardware acceleration by editing the dietEnv.txt file as mentioned in this thread and then installing the libgli-mesa-dri driver ( sudo apt-get --no-install-recommends install -t bookworm-backports libgl1-mesa-dri) but it seems that doing so breaks other packages (like libsdl2-dev for instance) forcing to me use the browser (only) for example. That, or installing libsdl2-dev first, then enabling hardware acceleration and making the browser completely unstable and broken, but with everything else working just fine. Is there a workaround for this or should I update the distro to sid and then enable hardware acceleration?
Used browser is “Brave”. “Everything else”= wine, dhewm3, eduke32. Thanks in advance.
-EDIT- I forgot to mention that I (also) tried to install the mentioned broken package via bookworm-backports but it (also) broke even more packages.
-EDIT2- Alright, I just tried updating it to sid first and then installing libgl1-mesa-dri after everything else. Now… browser works as intended but everything else is broken. So back to 1 I suppose.
-EDIT3- So it comes out I’ve figured out a solution to my problem – by (simply) installing every package via bookworm-backports and with the --no-install-recommends flag set up. Now everything is working as intended.
-EDIT4- Theres a problem however – the MESA_GL_VERSION_OVERRIDE doesn’t seem to be working at all. Changing it to 4.5 for example (still) gives me “opengl incompatible” errors.

1 Like

Does it help when you install all packages from backports (if available), by setting Package: * in the /etc/apt/preferences.d/dietpi-mesa?

Quite possible that there is otherwise a lengthy cascade of dependency conflicts. Usually I would try to pull only the really needed packages from backports, but at some point it is not worth the hassle. I mean they are very stable, well reviewed etc.

1 Like

I’m sooo sorry I haven’t tried it yet. I just got an Hailo-8L for my brithday and this thing occupied me fully. I will try your suggestions this week🤦‍♂️

1 Like

Usually I would try to pull only the really needed packages from backports

I’ve tried pulling (only) the broken packages or certain dependencies of a specific application but that either broke other unrelated applications, or all of em.

Does it help when you install all packages from backports (if available), by setting Package: * in the /etc/apt/preferences.d/dietpi-mesa ?

Haven’t tried it just yet but I’ll test it this afternoon.

1 Like

Alright, was a bit entertained on brainstorming new ways to come up with a “all-around” stable build, but yep – that (also) gave me the same previous problem. One thing breaks, the other does not. And the only way to have a “not so broken” system is to install everything via the bookworm-backports.

1 Like

Okay, at least we found a way then. I wonder whether we should offer this for all RK3588 Bookworm systems. On Trixie it will work OOTB then, on Bullseye no way without manually compiling everything. Probably a dietpi-config entry for enabling GPU acceleration via Bullseye backports, with a warning that this might cause incompatibilities with other applications, especially from 3rd party repos, which usually do not take into account backports.

1 Like

It’s always better to have more options I suppose, so I’d say it should be a thing. Then again (being more specific), the issues I’m having is related to opengl in wine applications and on certain emulators that requires opengl 4.5 (gives me a black screen when I try to run a game – rpcs3 emulator. Ryujinx just crashes.). And brave crashing when visiting certain links (suno.com for instance.). Outside of these issues, it’s perfectly stable.
Also I forgot to mention that I ran sway on a minimal install with a few extra lines added to environment values (via .bashrc) – export WLR_RENDERER=gles2, export DG_SESSION_TYPE=wayland, export GDK_BACKEND=wayland, export ELECTRON_OZONE_PLATFORM_HINT='wayland', export MESA_GL_VERSION_OVERRIDE='4.5' and export -p PAN_MESA_DEBUG='gofaster:gl3:forcepack:crc'. Maybe there is a “sweet spot” for a opengl env. value that can (oddly) work all around or adding a extra line or two can solve this…? I’m no way a linux expert but I do know there are some oddities that can happen regarding compatibility and whatnot.
If anything, I can report that I managed to run Crysis (a high-demanding game way back) on it in an acceptable framerate (20 to 25’ish) which is amusing considering how “wacky” the support is right now. And the lack of (decent) vulkan support.
I think I’ll try different versions, switch values back and forward and see if something improves. You said Trixie works OOTB – maybe it can make things more compatible if I start fresh from a trixie install.
-EDIT1- Alright, a short update – I’ve “fixed” my browsing issues by (simply) installing firefox (also via bookworm-backports) and firefox is much more stable and usable than brave. And it seems that I got “lucky” on my latest install since I managed to run a few x86_64 games but right now I simply cannot. It gives me some weird errors, regardless if I keep switching opengl versions back and forward. I’m starting to suspect that installing everything via bookworm-backports let wine completely unusable for some reason.

1 Like

Hey everyone,

I’m using video hardware acceleration on Orange Pi 5 Max for 2 months, without problem, on Jellyfin.

I followed this tutorial:

Rockchip VPU | Jellyfin

I installed this from the tutorial to work:

https://github.com/tsukumijima/libmali-rockchip/releases/download/v1.9-1-55611b0/libmali-valhall-g610-g13p0-gbm_1.9-1_arm64.deb

No problem at all, no overlay needed

…weird. This seems like proprietary, but I’ll give it a shot this afternoon. Will edit this post with results.
-EDIT- Alright, it didn’t worked. I’ve tried installing the wayland variant of that file and it (still) gave me a really bad performance – like hardware acceleration wasn’t enabled at all.