Rk3588 kodi rkmpp accelerated decoding working out of box

You have to install armbian jammy.
There are two ppa:
1, panfork that provides gles driver:


2, rockchip multimedia that provides ffmpeg and kodi:

sudo add-apt-repository ppa:liujianfeng1994/panfork-mesa
sudo add-apt-repository ppa:liujianfeng1994/rockchip-multimedia
sudo apt update
sudo apt dist-upgrade
sudo apt install kodi

To enable kodi hardware decode you have to run kodi under gbm or wayland.

============Updated on 20221204===================
See this post for updated detailed steps:

============Updated on 20230206===================
rockchip-multimedia has become a universal ppa for rockchip legacy kernel. Here is the introduction: Introduction to rockchip-multimedia ppa for ubuntu jammy
I provide a new package rockchip-multimedia-config to do all the system configs such as udev rules, chromium v4l2 devices creation. Just install this package and reboot, you are good to go.

5 Likes

thanks for the hint, used this : https://gitlab.com/panfork/mesa on radxa debian X11 image made OpenGLES, mpp DRM decoding worked too for my usage ! :slight_smile:

and

echo "performance" > /sys/class/devfreq/fb000000.gpu/governor

made it perfect

Could you explain how you got hardware accelration working on the debian radxa image ? I installed panfork switched xorg to the main debian repo version and can get xfce working, glmark2 also works, albeit slower than with radxa blobs (or whatever they use)

However I cannot get mpv to use gpu hardware decoding (command used: mpv --hwdec=rkmpp --vo=gpu --loop BigBuckBunny_2000hevc.mp4 ), cpu utilization is quite high (if I use an x265 file it goes up to 500%)

you tried using --vo=gpu --gpu-api=opengl --opengl-es=auto or --opengl-es=yes ? just a quick thought will make some tests later and report back.

EDIT: can’t get mpv to hardware decode too, may need to recompile maybe when using with panfork…

vo=gpu
hwdec=rkmpp
gpu-api=opengl
gpu-context=drm
opengl-es=yes

Hi, thanks for your quick reply (and tests!), and I already tried the additional flags you suggested. ( I also tried various gstreamer commands but it doesn’t help either)

Then what do you mean that drm decoding works ? With kodi ? How did you install it ?

I think that when we figure out how to do (if we do), we should write-up a how-to, ressources are all scattered here and there.

Kodi should be able to pass any decoded frames using hardware decoder to a DRM plane using initial post and precompiled packages, I’ve not tested this use case sadly. You may try using Armbian: https://www.armbian.com/rock-5b/ as recommended in initial post

Hi, I will try armbian but I still don’t quite understand in what sort of scenario you were able to use hardware (vpu?) decoding.

I’ve ported Shadow Ghost device (https://help.shadow.tech/hc/en-gb/articles/360017032933-Shadow-Ghost-Technical-Specifications), product that has been discontinued and was based on RK3399 to RK3588, it’s baked by a custom librockchip_mpp and use H264/H265 hardware decoder to stream a full featured Windows 10 Gaming VM on it (https://shadow.tech), works wonderful.

I see … Is this any better than using moonlight/parsec ?
Anyway if h264 decoding works with your solution it should work fine with mpv (provided everything is compatible/found), i’m puzzled. I’ve spent too much time on this, either I’ll switch to armbian (with caveats, not sure it’s as smooth as radxa debian) or find until someone more knowledgeable finds a fix …

I have armbian jammy GNOME running. Logged into a wayland session. How do I get kodi ff-h264 hardware decoding enabled? Currently I see it’s running ff-h264-drm-prime(SW). I’ve followed the steps in the first post.

would be something a kodi 19 with mpp support ! did someone pick it up after 18.4 ?

or is this just mpp and maybey some vop1 patches

and just a kodi with sw due the lack of mpp support ?

how about the vop2 driver did that suddenley being ported to have hw in kodi ?

You can see this post: https://forum.armbian.com/topic/24802-kodi-for-rk35xx-510-legacy-kernel/.
I’ve updated the ppa yesterday so make sure you have the latest ffmpeg.
To support 10 bit videos you have to run kodi in gbm mode. You can move /usr/share/xsessions/kodi.desktop to /usr/share/wayland-sessions/kodi.desktop and start kodi from lightdm or gdm. Or you can just run kodi from tty.
Don’t forget to add the udev rules, and set kodi render method to Direct to Plane

Vop2 driver supports drm formats for yuv420 and yuv420 10bit, so kodi can support drm prime as long as ffmpeg supports these drm formats.

Thank you for the PPA!
Would it be possible to make a “kinetic” variant of the repo as well, since “jammy” packages seem to lack some dependencies (e.g. kinetic uses libsrt1.5 instead of libsrt1.4, and so on)?

Kinetic is a ubuntu release which will get EOL next year, I don’t want to support this non-LTS release. You can download the source package from my ppa and build it by yourself.

cool

now i get it :slight_smile:

Thank you! I’ve got h264 hardware decoding working using your instructions :slightly_smiling_face:

btw the method in the original post not longer works. As of yesterday videos in Kodi play but with a black screen. The info in the pink box on the armbian website (https://www.armbian.com/rock-5b/) will need updating.

Can something be done about the jerkiness playing back h264 videos with high bitrate ~20MB/s? Low bitrate 5-10MB/s playback is fine.

1 Like

I can play jellyfish-40-mbps-hd-h264.mkv smoothly.

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