RGA crashes on Zero 3E, not with Zero 3W

That is a rare error code reported from the RGA. It should be an issue caused by device tree/kernel/hardware, because Zero 3W and 3E seem to only have differences in wireless/ethernet. There may be a conflict defined somewhere.

BTW, did you see the perfomance tool with your wonderful VPU utilization code?

The addition of VPU utilization looks great!

BTW, the same issue occurs with the Radxa’s official Debian OS.

“Input/output error” != “Invalid argument”

I was afraid it might be related to the device tree.
When the SD card from the Zero 3E is used in the Zero 3W, everything works fine—the only difference is that the Ethernet driver is disabled.

Now, I have very few options to resolve this:
The internal Ethernet memory conflicts with the RGA.
The Ethernet’s addresses or interrupts are conflicting with something else.

In practice, I encounter various errors, such as Input/output error or Invalid argument.

The most frustrating part is that when an error occurs, there’s a 95% chance the entire OS freezes, requiring a power cycle to recover.

I forwarded this to someone at radxa, hopefully they can take a look at it. If they can’t reproduce it, I’m afraid you’ll need an RMA.

Hi @Rients_Politiek ,
Everything works fine for me at zero3e with the command gst-launch-1.0 filesrc location=1080P_60FPS.mp4 ! qtdemux ! h264parse ! queue max-size-buffers=1 ! mppvideodec fast-mode=true format=NV16 ! queue ! fakesink -v , but it really doesn’t support the RGB-like format, probably due to the old user-level and kernel code.

Can you get ffmpeg from here and try the commands I mentioned above on your Zero 3E? It has been tested on numerous boards and will not cause RGA failures. Both MPP and RGA it built with are updated to date.

https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v7.0.2-9/jellyfin-ffmpeg_7.0.2-9_portable_linuxarm64-gpl.tar.xz

# Video (NV12) -> RAW YUV (NV12) -> Discard/Null
./ffmpeg -hwaccel rkmpp -hwaccel_output_format drm_prime -i INPUT.mp4 \
-vf scale_rkrga=format=nv12,hwmap,format=nv12 -f null -

It remains strange.
@ChenJaly, It fails on my Zero 3E.



@nyanmisaka, Jellyfin succeeded!

What to do?
Despite the success with the Jellyfin, I begin to suspect the hardware. If ChenJaly has no error while my board crashes, there is not much room for other interpretations.
I will order a new Radxa Zero 3E board and come back to you with the results.

I like to thank you all for the prompt support.

I have no problem with jellyfin, try updating the system with rsetup and sudo apt-get update && sudo apt-get install librga*=2.2.0-1.

I notice you have kernel version 26, which is a longer version

I’m using this Bullseye version radxa-zero3_debian_bullseye_xfce_b6.img.xz
image
However, with sudo apt-get update I get messages about missing public keys.
rsetup fails also to upgrading the system due to “Unable to update package list”

Please try:

wget https://radxa-repo.github.io/bookworm/pool/main/r/radxa-archive-keyring/radxa-archive-keyring_0.2.0_all.deb

sudo dpkg -i radxa-archive-keyring_0.2.0_all.deb

And then use rsetup upgrade system

I’m sorry not to inform you earlier, it was busy at the office.
I’ve followed your instructions. Thanks!
However, they didn’t bring a solution any closer.
Still crashes when using the RGA on the Zero3E.
And still working fine on the Zero3W.

What have I done?
First downloaded the latest Radxa Bookworm KDE
Once installed, I upgraded with rsetup the OS following your instructions.
I saw new aic8800 overlays being installed. Looking promising!
Next, enable the NPU with rsetup.
Then $ sudo apt-get install build-essentials, cmake, wget.
At last downloaded the rknpu2 YoloV5 example.
I know it’s outdated, but everything is installed with one simple build.

To get the ./rknn_yolov5_demo working with RGA, an image must be resized to 640x640.
Below the output generated by the Zero3W:
image
And this was the output of the Zero3E:


It still crashes when the RGA is called.

I must emphasize, I only swapped the SD card from the Zero3E to the Zero3W, noting on the card changed.

Hopefully it gives you a clue!

In any case, many thanks for all the effort!

How much memory does your 3e have?

@nyanmisaka, Jellyfin succeeded!

Since RGA succeeds with jellyfin-ffmpeg, this should be a hardware limitation of the RGA2E on RK356x/3588 not supporting 4GB+ memory. You need to use the DMA32 flag to allocate DMA memory and have the RGA input and output use it.

I’m sorry to inform you that Jellyfin doesn’t use the RGA, when playing:

./ffmpeg -hwaccel rkmpp -hwaccel_output_format drm_prime -i INPUT.mp4 \ -vf scale_rkrga=format=nv12,hwmap,format=nv12 -f null -

Simply, because to mpp output is already in NV12, there is no need for a RGA accelerated nv12->BGR conversion. Looking at the ffmpeg info output on the console, you see no RGA being initialized.

My Zero3E has 8 GB of RAM
free -m:
Mem: 7688
Swap: 3844

ffmpeg will follow the filters you give it, even if it’s copying from NV12 to NV12 using RGA. There’s no passthrough.

And the RGA initialization log somehow seems to have disappeared on newer librga. You can add -v debug to determine if it is working.

I will recompile the kernel with the DMA32 flag and let you know.
Thanks for pointing me in the right direction. :slightly_smiling_face:

Another issue is that the DMA-BUF allocator in the BSP 6.1 kernel does not support the DMA32 flag, only the DRM allocator does.