ROCK 5B Debug Party Invitation

Tried on armbian jammy with icecream95’s patchset. Both hevc_rkmpp(8&10b) and h264_rkmpp works fine for me. I don’t connect rock5b to a monitor, so I use ffmpeg transcode to verify this.

RGA performs a pixel format conversion (nv12|na12->yuv420p) and copy back it to memory.

rock@rock-5b:~/workspace/ffmpeg$ sudo ./ffmpeg -init_hw_device drm=dr:/dev/dri/renderD128 -c:v h264_rkmpp -i ~/Videos/jellyfish-10-mbps-hd-h264.mkv -an -sn -c:v libx264 -preset ultrafast -b:v 6M -maxrate 6M -y /tmp/1.mp4
ffmpeg version n4.4.2-1-g289a344 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.3.0-1ubuntu1~22.04)
  configuration: --arch=arm64 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --prefix=/opt/ffbuild --enable-gpl --enable-version3 --enable-libdrm --enable-rkmpp --enable-libx264
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from '/home/rock/Videos/jellyfish-10-mbps-hd-h264.mkv':
  Metadata:
    encoder         : libebml v1.2.0 + libmatroska v1.1.0
    creation_time   : 2016-02-06T04:00:51.000000Z
  Duration: 00:00:30.03, start: 0.000000, bitrate: 9955 kb/s
  Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> h264 (libx264))
Press [q] to stop, [?] for help
[h264_rkmpp @ 0x55957e8520] Decoder noticed an info change (1920x1080), format=0
[libx264 @ 0x559587dae0] VBV maxrate specified, but no bufsize, ignored
[libx264 @ 0x559587dae0] using SAR=1/1
[libx264 @ 0x559587dae0] using cpu capabilities: ARMv8 NEON
[libx264 @ 0x559587dae0] profile Constrained Baseline, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x559587dae0] 264 - core 163 r3060 5db6aa6 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=0 intra_refresh=0 rc=abr mbtree=0 bitrate=6000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to '/tmp/1.mp4':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 6000 kb/s, 29.97 fps, 19001 tbn (default)
    Metadata:
      encoder         : Lavc58.134.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 6000000/0/6000000 buffer size: 0 vbv_delay: N/A
frame=  899 fps=121 q=-1.0 Lsize=   20764kB time=00:00:29.99 bitrate=5670.7kbits/s dup=0 drop=1 speed=4.05x

Ahh, I tested it on kernel 5.10.66 and it worked. Kernel 5.10.110 does not. I will try it with linux-5.10-gen-rkr3.4 which has an updated mpp driver. Thanks.

@icecream95

confirmed. Your fix does not work for kernel 5.10.110 and 5.10.110-gen-rkr3.4.

Any workaround? Or v3 is the way?

Booted up Radxa Ubuntu server image today.
Installed Ubuntu desktop and once in it asked me if i wanted to upgrade to 22.04.

I can confirm upgrading to 22.04 f***ed things up.

So it’s a bug :blush:

Quick question, is rkmpp hardware decoding supposed to be working out of the box on the debian bullseye radxa distribution ? If not has anyone achieved it with a custom kernel/some custom package ?

Essentially the Rockchip BSP is a custom kernel with some custom packages where Devs here are trying various options and if you read you will find info above.
Also in the discord server devs and community are sharing images where much has been added. The Radxa images are more conservative with bleeding edge additions, but prob best to chat and ask in there.

Thanks for the Discord link ! I think I’ll switch to armbian at the moment, if it can play smoothly 4k 60p videos, I’ll be fine with that.

USA based dev here; late to the party.

where can I get a rock5b >= 16GB RAM at this point? ameridroid best bet?

https://wiki.radxa.com/Buy

But yeah Ameridroid or go direct to allnet

If You are in USA then ameridroid seeme to be better option but both are ok. I ordered this month from both of them and i was about 3 working days for ameridroid to ship to Nevada and about 5 for allnet to ship to Europe.

2 Likes

any chance you can send another discord invite, this one is not valid anymore it seems

apols haven’t been around

2 Likes

Hello, can you give a thesis step by step instructions, how did you achieve the result?

This error occurs when the python compiler gets confused between function name and module name and try to run a module name as a function. This error statement TypeError: ‘module’ object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name .

If you have a class MyClass in a file called MyClass.py , then you should write:

from MyClass import MyClass

In Python , a script is a module, whose name is determined by the filename . So when you start out your file MyClass.py with import MyClass you are creating a loop in the module structure. Also, note that this usually happens when you import any kind of module as a function.

@tonygruz
Thank you for the explanation. It was solved somehow at that time, most likely the same way.
I am about to review some of my tests with SDL3 and the latest rockchip rt but would like to try with yolov8 if possible.

I have read somewhere (can’t find the info anymore) people have (or had) some trouble converting it to rknn.
Are you willing to try converting it and sharing the rknn models, if so, please share your thoughts?
See here:

Seems Onnx is the most compatible so either get a Onnx Yolo8 or convert to Onnx then convert 2 Rknn2.

Rknn2 looks relatively easy and quite good but its a bit of a steep curve and the documentation isn’t great.
I had a look as was really intrested to see if https://github.com/usefulsensors/openai-whisper as pytorch whisper is converted to onnx before finally becoming tflite, but boy you have to really have some will power :slight_smile:

I was thinking whisper would be a mighty model to have on the rk3588 NPU as on the cpu the test JFK.wav inference is taking just over a second with the tiny model.
The Armv8.2 SDOT and UDOT instructions provide access to many multiply and accumulate operations every cycle so greatly speed up ML so it would be interesting to compare a more complex model like whisper against the npu.

It would be interesting to see how far or the issues people are having trying YOLOv8.

This may be a way too noob question. I have an M2 to USB3 adapter. https://amzn.to/3TRkLhN I can’t seem to get it working. Is there some config setting I need to make it work?

My understanding is that this card is not a USB3 adapter but a PCIe adapter that uses USB3 connectors (which are electrically compatible). It’s something common among the cryptomining community to extend the bus to reach multiple GPUs. If you run lspci I suspect you’ll see 4 new PCI busses. I agree that the article’s description is deceptive given that it’s written USB3 at a few places, but in fact it’s always associated with PCIe 1x which clearly is the bus in question. Now the good thing is that if you buy 4 of the other boards that connect to these ports, you’ll have 4 PCIe 1 slots for your board, on which you’ll probably be able to connect boards providing up to 4 USB3 ports each :slight_smile: (the peak bandwidth will remain limited to PCIe 3.0 1x =8 Gbps though).

I think it’s not going to work for the same reason a SSD SATA with M + B keys does not work.
You can check if you get any power on the USB3.