Rk3588 kodi rkmpp accelerated decoding working out of box

Welp, I think I’ve applied the patches. What options do I need to use for ./configure?
Would ./configure --enable-rkmpp --enable-version3 --enable-libdrm be enough, or should some other flags be added?

In case you’re curious, daring, or want to retrace my steps, here’s the patches for ffmpeg=5.1.1. It seems to work, but I don’t really have a good idea what I’m doing…

Could you please share the steps for building Kodi as well?
I don’t have any of the options for “PRIME” and/or “DRM”, so I’m guessing I’ll need to rebuild it with some extra flags or something.

build with APP_RENDER_SYSTEM=gles

I’m also interested to know what compile options you used @amazingfate :grinning: ( I looked into the .deb build logs but I’m not sure all of those options are needed)

You can find the compile options in debian/rules from the source package.

1 Like

Will this only work on Ubuntu Jammy? I’m running the armbian bullseye CLI image and am wondering if this can apply there - including the rockchip-multimedia ppa for ubuntu jammy.

You have to compile those packages by yourself since all the source packages are in the repo.

Thanks for the super quick reply. That’s a bit beyond my knowledge right now but I will get there eventually.

For people that want to build kodi on their own, when using Armbian Jammy, for all build functions to work, you need to install those packages (the instructions on the Kodi website give a list that contains package names not found in this distro):
sudo apt install autoconf automake autopoint gettext autotools-dev cmake curl default-jre gawk gcc g++ cpp libflatbuffers-dev flattbuffers-compiler gdc gperf libasound2-dev libass-dev libavahi-client-dev libavahi-common-dev libbluetooth-dev libbluray-dev libbz2-dev libcdio-dev libcec-dev libp8-platform-dev libcrossguid-dev libcurl4-openssl-dev libcwiid-dev libdbus-1-dev libegl1-mesa-dev libenca-dev libflac-dev libfontconfig-dev libfmt-dev libfreetype6-dev libfribidi-dev libfstrcmp-dev libgcrypt20-dev libgif-dev libgles2-mesa-dev libglew-dev libglu1-mesa-dev libgnutls28-dev libgpg-error-dev libgtest-dev libiso9660-dev libjpeg-dev liblcms2-dev liblirc-dev libltdl-dev liblzo2-dev libmicrohttpd-dev libmysqlclient-dev libnfs-dev libogg-dev libomxil-bellagio-dev libpcre3-dev libplist-dev libpng-dev libpulse-dev libshairplay-dev libsmbclient-dev libspdlog-dev libsqlite3-dev libssl-dev libtag1-dev libtiff-dev libtinyxml-dev libtool libudev-dev libunistring-dev libva-dev libvdpau-dev libvorbis-dev libxkbcommon-dev libxmu-dev libxrandr-dev libxslt1-dev libxt-dev waylandpp-dev netcat wayland-protocols wipe lsb-release meson nasm ninja-build python3-dev python3-pil python3-minimal rapidjson-dev swig unzip uuid-dev zip zlib1g-dev libdav1d-dev libdrm-dev ccache libclang-dev libiso9660++-dev libcap-dev clang-tools clang-tidy libpipewire-0.3-dev libsndio-dev libmariadb-dev cppcheck
Hope that’s useful to someone.

1 Like

I just use one single command:
sudo apt build-dep kodi

1 Like

Didn’t know this, useful. Got this:
You must put some 'deb-src' URIs in your sources.list

So my command is for those who just downloaded a git repo.

Has anyone gotten hardware acceleration set up & usable by Jellyfin (in Docker, in my case) command line only OS? Curious what the setup/settings are to get it running.

It does somewhat work on armbian with the rkmpp ffmpeg you can find in the forums here. Just install jellyfin, said ffmpeg(only hwdecode), set jellyfin to use custom ffmpeg. Interestingly with hw decoding the software encoder is fast enough to do 1080p in Realtime(>30fps) for 1080p with the very fast h264 profile. No hw encode yet unfortunately

You may try this: https://hub.docker.com/r/jjm2473/jellyfin-mpp

Tried it and it soft-crashed my rock5 (it first started working and is still connected to the network but I can’t seem to even ping it). Will edit this post later to report what actually happened.
EDIT: it works but is too slow. Unusable even. Removing. Also, removing docker. Containers are the worst.

Thanks for this @John_Deaux, I’ll give that a go. I imagine that this is using VAAPI? And did you have to pass any devices/variables through docker in or to get this to work? Or because it’s making use of the system ffmpeg (which I imagine I will have to map as a volume to the container) there’s no additional device mappings needed?

I currently have the following in my compose file:

      # VAAPI Devices (examples)
      - /dev/dri/card0:/dev/dri/card0
      - /dev/dri/card1:/dev/dri/card1
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/renderD129:/dev/dri/renderD129
    group_add:
      - "109" #render group id

And in Jellyfin the VA-API device is set as /dev/dri/renderD128.

you shouldnt need to set anything in jellyfin, as I stated only hardware decode works, which boosts it just enough to do a veryfast profile 1080p encode in realtime. The encoding is still done with the cpu. AFAIR the ffmpeg with rkmpp has its own decoder which should be called something rkmpp_hwdec (just do ffmpeg -encoders | grep rk to find the right one). It is automatically used by ffmpeg
Word of warning - I did run into crashes on armbian, and I am not sure its because of ffmpeg, even though the crashdump seemed video decoder related. I do believe that jellyfin was indexing files and encountered a file that the hardware decoder didnt like. not sure though, I reverted back to debian and gave up with hw enc/dec for now, and instead use the jellyfin app on all devices. works for me

I’m not sure what I’m doing wrong when it comes to setting the custom ffmpeg in Jellyfin. I set up /usr/bin as a volume mapped to the docker container, then in Jellyfin I pointed the ffmpeg path to where it is mapped in the container. I can see the ffmpeg file in the Jellyfin file picker, but am always treated with the following error:

We’re unable to find FFmpeg using the path you’ve entered. FFprobe is also required and must exist in the same folder. These components are normally bundled together in the same download. Please check the path and try again.

I have tried setting chown as the standard user and even chmod 777 for testing purposes and still Jellyfin pitches the same error. What am I missing?

Try to attach to container and launch your mounted ffmpeg binary, and it will output smth like that /usr/lib/jellyfin-ffmpeg-custom/ffmpeg: error while loading shared libraries: libblas.so.3: cannot open shared object file: No such file or directory
This error means you need to provide (mount) libs for ffmpeg
E.x:

    volumes:
      - /usr/bin/ffmpeg:/usr/lib/jellyfin-ffmpeg-custom/ffmpeg:ro
      - /usr/bin/ffprobe:/usr/lib/jellyfin-ffmpeg-custom/ffprobe:ro
      - /usr/lib/aarch64-linux-gnu/:/usr/lib/aarch64-linux-gnu/:ro
      - /etc/alternatives/:/etc/alternatives/:ro

Also. this is still doesn’t work in my case due to another error (probably, cause I use edge kernel right now):

[vp9_rkmpp_decoder @ 0xaaaaecb19960] Failed to initialize MPP context (code = -1).
[vp9_rkmpp_decoder @ 0xaaaaecb19960] Failed to initialize RKMPP Codec.