Video hardware decode is only support in kodi gbm mode now, but still not working out of box because of 2 reasons: 1, mesa is compiled with swrast support, so kodi gbm will start in software rendering, which doesn’t support gpu rendering. I’ve confirmed that mesa has nothing to do with kodi hardware acceleration.
2, kodi from debian is build with -DAPP_RENDER_SYSTEM=gl, but we need gles instead.
So I’ve rebuild mesa without swrast and kodi with gles render system. After install missing font packages fonts-noto-core fonts-roboto-hinted fonts-noto-mono, I can start kodi gbm by running command kodi-standalone --windowing=gbm. At first my screen is black with no video input, replugging the HDMI would help showing the kodi window.
In Settings -> Player -> Videos, enable Allow using DRM PRIME decoder and Allow hardware acceleration with DRM PRIME, you can now play h264 video up to 1080p@60fps with hardware decode. I can play bbb_sunflower_1080p_60fps_normal.mp4 with cpu load less than 40%.
Can you also build Chromium or Firefox with hardware decode or 3D support?
Kodi, ffmpeg could also work for Armbian Jammy on RockPi 4, right or other changes needed?
Do you have Armbian Jammy for RockPi 4 with these patches perhaps - https://github.com/armbian/build/pull/3893
Chromium from this ppa: https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-beta has panfrost support. Hardware decode is not well supported by chromium, but people are working on it: https://bugzilla.redhat.com/show_bug.cgi?id=2071126. I tried to build a verion of chromium with patch https://chromium-review.googlesource.com/c/chromium/src/+/3380426/4, but hardware decode doesn’t work.
The patches you mentioned add the support for HEVC 10-bit HDR, which is not supported by rk3568 mainline kernel by now, so I don’t care about it. My kodi and ffmpeg should work on rockpi4 without other changes. To get HEVC 10-bit HDR support you have to wait for the pull request getting merged and install the new kernel with those patches.
we used armbian 22.05,linux 5.17.9.We tested the mainline Linux VPU decoding capability on the rock 3a board(soc rk3568). We used ffmpeg from https://github.com/jernejsk/FFmpeg and configuration:–enable-libdrm --enable-libv4l2 --enable-v4l2-request --enable-libudev --enable-static --disable-sharedb0. When we use the following command prompt an error:
Successfully opened the file.
Device creation failed: -14.
[h264 @ 0xaaaaac42f520] No device available for decoder: device type drm needed for codec h264.
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Device setup failed for decoder on input stream #0:0 : Bad address
The VPU driver has been loaded correctly:
root@rock-3a:~/FFmpeg# dmesg |grep vpu
[ 53.304850] hantro_vpu: module is from the staging directory, the quality is unknown, you have been warned.
[ 53.328532] hantro-vpu fdea0000.video-codec: Adding to iommu group 0
[ 53.331978] hantro-vpu fdea0000.video-codec: registered rockchip,rk3328-vpu-dec as /dev/video0
and
root@rock-3a:~/FFmpeg# dmesg |grep drm
[ 2.752665] rockchip-drm display-subsystem: bound fe040000.vop (ops vop2_component_ops)
[ 2.756569] rockchip-drm display-subsystem: bound fe0a0000.hdmi (ops dw_hdmi_rockchip_ops)
[ 2.757416] [drm] Initialized rockchip 1.0.0 20140818 for display-subsystem on minor 0
[ 2.757569] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[ 2.757724] rockchip-drm display-subsystem: [drm] Cannot find any crtc or sizes
[ 4.028876] [drm] Initialized panfrost 1.2.0 20180908 for fde60000.gpu on minor 1
[ 51.128088] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped.
[12442.376669] rockchip-drm display-subsystem: [drm] fb0: rockchipdrmfb frame buffer device