Rk3588 kodi rkmpp accelerated decoding working out of box

Yes, same here. I can play back jellyfish-40-mbps-hd-h264.mkv smoothly too. Maybe the below is of help? I’m also seeing a lot of pixellation and glitching while watching live HD TV (ff-h264).

This plays back jerky and when I seek in the video it results in a unresponsive black screen needing a reboot:

ID : 1
ID in the original source m : 4113 (0x1011)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 1 h 58 min
Bit rate mode : Variable
Bit rate : 33.2 Mb/s
Maximum bit rate : 37.2 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.669
Stream size : 27.6 GiB (87%)
Language : English
Default : No
Forced : No
Original source medium : Blu-ray

Audio #1
ID                          : 2
ID in the original source m : 4352 (0x1100)
Format                      : MLP FBA 16-ch
Format/Info                 : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name             : Dolby TrueHD with Dolby Atmos
Codec ID                    : A_TRUEHD
Duration                    : 1 h 58 min
Bit rate mode               : Variable
Bit rate                    : 3 810 kb/s
Maximum bit rate            : 7 158 kb/s
Channel(s)                  : 8 channels
Channel layout              : L R C LFE Ls Rs Lb Rb
Sampling rate               : 48.0 kHz
Frame rate                  : 1 200.000 FPS (40 SPF)
Bit depth                   : 24 bits
Compression mode            : Lossless
Stream size                 : 3.17 GiB (10%)
Title                       : Surround 7.1
Language                    : English
Default                     : Yes
Forced                      : No
Original source medium      : Blu-ray
Number of dynamic objects   : 11
Bed channel count           : 1 channel
Bed channel configuration   : LFE

but this plays back smooth and seeking in the video is fine:

Video
ID                          : 1
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : High@L4
Format settings             : CABAC / 4 Ref Frames
Format settings, CABAC      : Yes
Format settings, Reference  : 4 frames
Codec ID                    : V_MPEG4/ISO/AVC
Duration                    : 57 min 17 s
Bit rate mode               : Constant
Bit rate                    : 8 595 kb/s
Nominal bit rate            : 10 000 kb/s
Width                       : 1 920 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 16:9
Frame rate mode             : Constant
Frame rate                  : 24.000 FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.173
Stream size                 : 3.44 GiB (91%)
Default                     : Yes
Forced                      : No
Color range                 : Limited
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709
Audio
ID                          : 2
Format                      : E-AC-3
Format/Info                 : Enhanced AC-3
Commercial name             : Dolby Digital Plus
Codec ID                    : A_EAC3
Duration                    : 57 min 16 s
Bit rate mode               : Constant
Bit rate                    : 640 kb/s
Channel(s)                  : 6 channels
Channel layout              : L R C LFE Ls Rs
Sampling rate               : 48.0 kHz
Frame rate                  : 31.250 FPS (1536 SPF)
Compression mode            : Lossy
Stream size                 : 262 MiB (7%)
Language                    : English
Service kind                : Complete Main
Default                     : Yes
Forced                      : No

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.