Rock 5B+ poor HDMI-IN performance with BGR3 color format and colorspace conversion

Hey Guys,

I appologize as a new user I can only include 2 links per post so I have altered the links below so I can post them with missing parts.

So I’ve spent about 6 hours trying to get a simple HDMI-IN -> HDMI-out passthrough to function adequitely but I’ve run into a bit of a dead end.

It seems like the mainline kernel drivers for the rockchip rk3588 only support NV12 and NV24 hardware accelerated NV12, NV24 RGB colorspace conversions.
forum radxa com t/hdmi-input-on-rock-5b/16242/4

As long as I run the default resolutions provided by the default EDID they all force my computer to send video to HDMI-in using NV24 (1080p@60hz) or NV12 (4k@60hz), however if I add a custom resolution using a tool like CRU for (1080p@120hz) or (3840x1080@60hz) the computer will not let me send the video as NV12/NV24, only BGR3 color format. If anyone knows how to force the computer to send NV12/NV24 instead of BGR3 I think that will be one possible solution, but I could not change the color format to YCrCb from the AMD Radeon Panel so I suspect that something needs to be changed on the Rock 5B+ to indicate that it accepts NV12/NV24 at this custom resolution. I briefly tried experimenting with wxedid to add detail resolutions, but just like CRU all the custom resolutions didn’t support NV12/NV24.

So I moved onto trying to get Armbian Ubuntu Noble running on the board in hopes that I could downgrade the kernel to “legacy kernel 5.10.110-rockchip-rk3588” “legacy 5.10 kernel
linux-image-legacy-rk35xx” and then install “rockchip-multimedia-config”.
Unfortunately currently Armbian doesn’t support the Rock 5B+.

I kind of wish I’de purchased a Rock 5B instead of the Rock 5B+ as I didn’t realize I would need to use an unofficial image to get the video hardware acceleration working. Is this something Radxa has the ability to fix? This comment from Feb 23 seems to suggest it’s beyond the scope of what they will do. forum radxa com t/introduction-to-rockchip-multimedia-ppa-for-ubuntu-jammy/14537/4

I really hope that someone will release Armbian for this new Rock 5B+ and also add support for the legacy kernel and “rockchip-multimedia-config”.

Alternatively if anyone knows a way to get custom HDMI-in resolutions work with NV12 and NV24 color_format on by default I would very much appreciate knowing. I found the following post and tried his custom EDID but none of them worked (perhaps because they are for the 5B and not 5B+ but I doubt it). forum radxa com t/rock5b-hdmi-capture-hardware-accelerated-video-processing-examples/16878
I suspect this may be depending on the video drivers on the device sending HDMI to the HDMI-in port of the Rock 5B+, but I have multiple PC’s and as of yet I can’t get any of them to send NV12/NV24 color format HDMI signal to the HDMI-in of the Rock 5B+ at a custom resolution.

EDIT: This thread has some great information about perhaps forcing the HDMI-in EDID to say it cannot accept RGB at all, and that would force it to use NV12 or NV24 for all resolutions. It looks like however some computers may ignore the EDID but I think it is worth a try, I will need to figure out which part of the EDID says it can accept RGB8 (BGR3) so I can disable it. If anyone else knows any help would be appreciated. https://forums.raspberrypi.com/viewtopic.php?t=342075

EDIT2: I did some more digging into the EDID override for YCbCr only and it seems 420 YCbCr is only supported for standard TV resolutions as said by ToastyX himself.
https://www.monitortests.com/forum/Thread-custom-resolution-4k-2160p60hz-4-2-0?pid=6580#pid6580

4:2:0 resolutions can only be defined using TV resolution codes, so 72/96 Hz wouldn't be possible. 1920x1080 @ 100/120 Hz is theoretically possible, but that would require the driver to acknowledge 4:2:0 for those resolutions. I don't know about NVIDIA, but AMD wouldn't do 4:2:0 for 1920x1080 the last time I checked. Also, the HDMI 2.0 data block has a 30-bit (10 bpc) option for 4:2:0.

So it looks like my only option will be to try and get Armbian working and then add support for HW acceleration via the older 5.1 kernel and “rockchip-multimedia-config”. As there doesn’t seem to be any other way to get the hardware acceleration working for RGB HDMI inputs.

Please try the ffmpeg, https://github.com/nyanmisaka/ffmpeg-rockchip/wiki

1 Like

Hey ChenJaly,

I can confirm the hardware accelerated ffmpeg works correctly for BGR3 (RGB8) pixel format at any custom resolution at full 60 fps. Is there anyway to get the custom gstreamer1.0-rockchip that was included with Introduction to rockchip-multimedia ppa for ubuntu jammy If I can get that built I think I will be able to proceed with my development as we use gstreamer here.

Thanks so much for your fast and helpful reply!

EDIT: I found the following repo but I don’t know if it is the latest of best version for rockchip gstreamer https://github.com/Lockzhiner/gstreamer-rockchip/

Here is the latest gstreamer-rockchip: https://github.com/JeffyCN/mirrors/tree/gstreamer-rockchip

2 Likes

Thanks amazingfate!

EDIT: amazingfate, are the build scripts you use to make your debian files available anywhere? I’m not sure how to build gstreamer-rockchip plugins. It looks like I need to rebuild gst-plugins-base to get the “rga” optimizations (based on looking at your ppa https://launchpad.net/~liujianfeng1994/+archive/ubuntu/rockchip-multimedia/+packages), but I’m not clear on how to do that. I’ll keep playing with it, but any further tips you have wouild be a big help.

hey AmazingFate,

I’ve had to give up for now on building gstreamer.
I’m curious if you think the rock 5b+ will ultimately have a armbian port available with the 5.1 kernel with the dma_heap driver you mentioned here https://github.com/armbian/build/pull/6881#issuecomment-2206007056
Is the dma_heap driver necessary for the gpu accelerated rgba operations or can they work on the 6.1 kernel too?
I think I read somewhere else a comment stating that they required the legacy 5.1 kernel.

If you don’t think the rock 5b+ will ultimately get an armbian port that supports gpu accelerated rgba operations under linux with gstreamer I think I will return it and purchase a regular rock 5b as I can’t use it for the intended purpose currently.
I really hope that radxa will considered donating a device to you or sponsoring you to bring armbian to the rock 5b+ to take advantage of all the great work you did for the rock 5b.

You can try 6.1 kernel on ubuntu 24.04. Rock5b should have the same issue when you want to run 6.1 kernel with jammy.

I don’t think there is an armbian build yet for rock 5b+ right? Do you know if anyone is planning to make one? Or are there any guides explaining how to do it?

To add new board to armbian, you need to create a pull request to these two repos:


And here are the two pull requests adding rock 5 itx board support:


Adding rock 5b plus should be similar.

Thanks I will look into it and see if it’s something I think I could do. If not I’ll update here in afew days.

there is BOOTCONFIG=“rock-5b-rk3588_defconfig” however I found no defconfig for rock-5b-plus-rk3588 here https://github.com/u-boot/u-boot/tree/master/configs
Any idea how to add it?

No need to add it. That is mainline u-boot. rock-5b-plus should use https://github.com/radxa/u-boot

Looks like @meco over in this thread Armbian - the best ARM framework 🐧 said they have added a patch to the armbian repos, so hopefully an image will be available soon, and you can build an image with the latest master. I haven’t tried yet though.

Ok so just incase anyone else needs to get accelerated RGA conversion working on the rockpi 5b+ here are my notes for how I got it working.

./compile.sh BOARD=rock-5b-plus BRANCH=legacy BUILD_DESKTOP=yes BUILD_MINIMAL=no DEB_COMPRESS=xz RELEASE=jammy
install base image from gnome disk utility 
Armbian-unofficial_24.11.0-trunk_Rock-5b-plus_jammy_legacy_5.10.209_gnome_desktop.img
then copy the dtb file over
/media/user/armbi_root/boot/dtb-5.10.209-legacy-rk35xx/rockchip# cp rk3588-rock-5b-plus.dtb rk3588-radxa-rock-5b+.dtb

sudo apt install libv4l-0

#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
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-rockchip1 gstreamer1.0-tools

uname -a
check for "/dev/mpp_service" device
sudo journalctl | grep mpp

sudo apt install rockchip-multimedia-config
rm ~/.cache/gstreamer-1.0/registry.aarch64.bin
gst-inspect-1.0 rockchipmpp

sudo apt install v4l-utils ffmpeg

GST_VIDEO_CONVERT_USE_RGA=1 gst-launch-1.0 -e v4l2src device=/dev/video0 ! videoconvert ! waylandsink

Using this I can confirm I am getting hardware accelerated BGR3 capture conversion and display to screen.

I am able to do the complete install exactly the same way under noble too, but for some reason as soon as I add the “GST_VIDEO_CONVERT_USE_RGA=1” it causes the operating system to crash. I’m not sure why so I’m just sticking to jammy for now.

1 Like