Firefly Open Source Community

Title: RK3399 ffmpeg - librga/mpp errors [Print This Page]

Author: jbholtz_bd17    Time: 5/26/2022 10:44
Title: RK3399 ffmpeg - librga/mpp errors
I'm using the GPT ubuntu 20.04 build and have tried to read a udp mpegts stream by using:
   ffplay -fflags nobuffer -f:v mpegts -an -probesize 8192 udp://0.0.0.0:8554
Instead I get alot of repeating errors that appear to originate from librga:
   rga_api version 1.7.0_[1]
    RgaBlit(1387) RGA_BLIT fail: Invalid argument
    RgaBlit(1388) RGA_BLIT fail: Invalid argument
   fd-vir-phy-hnd-format[22, (nil), (nil), (nil), 0]
   rect[0, 0, 640, 360, 640, 368, 10, 0]
   f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
   fd-vir-phy-hnd-format[0, 0x7f0c009ca0, (nil), (nil), 0]
   rect[0, 0, 640, 360, 640, 384, 11, 0]
   f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
   This output the user patamaters when rga call blit fail
   [h264_rkmpp @ 0x7f14008d00] Doing slow software conversion

This also appears when trying to simply play an mp4.  i.e from learnopencv  VideoReadWriteDisplay/chaplin,mp4
    ffplay chaplin.mp4

At startup it also shows the following error in mpp:
   mpp[1875]: mpp_info: mpp version: 8a85dc5d author: Herman Chen   2022-03-14 [mpp_enc]: Fix stuck on reset
   async mode encoder
   mpp[1875]: mpp_rt: NOT found ion allocator
   mpp[1875]: mpp_rt: found drm allocator
   mpp[1875]: hal_h264d_rkv_reg: control info: fmt 7, w 640, h 360
   mpp[1875]: mpp_buf_slot: set frame info: w  640 h  360 hor  640 ver  368
   mpp[1875]: mpp_dec: setting default w  640 h  360 h_str  640 v_str  368
   mpp[1875]: hal_h264d_rkv_reg: control info: fmt 7, w 640, h 360
   mpp[1875]: mpp_buf_slot: set frame info: w  640 h  360 hor  640 ver  368
   mpp[1875]: mpp_dec: setting default w  640 h  360 h_str  640 v_str  368
   [h264_rkmpp @ 0x7f14008d00] Decoder noticed an info change (640x360), format=0
   librga fail to get driver version! Legacy mode will be enabled.

Thank you for any help in getting this working properly
Author: 895816513    Time: 5/26/2022 17:21
Maybe the firmware or file system you are using is older, what board are you using? I will upload it to google drive to share with you.
Author: jbholtz_bd17    Time: 5/26/2022 19:14
Thank you for responding.  I have a Station P1 board and have flashed with the ROC-RK3399-PC-PLUS firmware from:
https://en.t-firefly.com/doc/download/78.html

This is from my current setup:
   firefly@firefly:~$ ffgo version
   OS:         Ubuntu 20.04.4 LTS
   MODEL:         Firefly roc-rk3399-pc PLUS
   FIREFLY: v2.10-62-g087b2b2
   DATE:         20211228-1443
   KERNEL:         Linux version 4.4.194+ (jincheng@jincheng-PC) (local/new/internal-gitlab/rk3399/firefly: bcd190d4221dcefe664a1fe9aebe17819db54b22) (gcc
   version 6.3.1 20170404 (Linaro GCC 6.3-2017.05) ) #12 SMP Wed Dec 29 13:42:43 CST 2021

If you have a more recent firmware I would appreciate it.

Author: jbholtz_bd17    Time: 5/27/2022 10:48
Some additional Data......
* The log that I placed at the beginning of this thread was after flashing the ROC-RK3399-PC-PLUS-UBUNTU-20.04_DESKTOP-GPT-20211229-1348.img.7z and then performing a sudo apt update, sudo apt upgrae.  the rga_api changed from 1.3 .0 to 1.7.0
* Although I get the same error messages, If I simply attempt to play a mp4 file prior to the update/upgrade  (/usr/local/bin/test_ffmpeg.sh ...... ffplay -vcodec h264_rkmpp -i /usr/local/test.mp4) it fails and will lockup the board
* Running the same test script (/usr/local/bin/test_ffmpeg.sh) will also fail if I reflash the board with Ubuntu 18.04  ( ROC-RK3399-PC-PLUS-UBUNTU-18.04_DESKTOP-GPT-20211228-1710.img.7z).
* By performing the updata/upgrade it also upgrades the mpp driver from:
mpp[1222]: mpp_info: mpp version: 49f29006 author: Jeffy Chen    2021-08-04 [drm]: Add mmap flag detection
to
mpp[4293]: mpp_info: mpp version: 8a85dc5d author: Herman Chen   2022-03-14 [mpp_enc]: Fix stuck on reset async mode encoder

Author: 895816513    Time: 5/28/2022 17:51
jbholtz_bd17 Posted at 5/27/2022 10:48
Some additional Data......
* The log that I placed at the beginning of this thread was after flashi ...

I tested the third item and there was a problem, let me see how to solve it.


  1. root@firefly:~# cat /usr/local/bin/test_ffmpeg.sh

  2. #1. test benchmark
  3. #ffmpeg -benchmark -loglevel 48 -vcodec h264_rkmpp -i /usr/local/test.mp4 -map 0:v:0 -f null -

  4. #2. play
  5. #ffplay -vcodec h264_rkmpp -i /usr/local/test.mp4

  6. #3. decode to yuv
  7. ffmpeg -y -c:v h264_rkmpp -i /usr/local/test.mp4 -an -vf hwdownload,format=nv12,format=yuv420p out.yuv
Copy the code

Author: rogerhardiman    Time: 4/2/2023 14:25
I have the same problem with lots of BlitRGA errors and warning messages added to syslog and journalctl when using gstreamer with mpph264enc
My gstreamer command takes a MP4 file, decodes it and re-encodes it.
```
gst-launch-1.0 filesrc location=source.mp4 ! decodebin ! textoverlay text="2023-04-01" ! mpph264enc ! h264parse ! filesink location=encode_mpp.264
```

The error messages that fill the syslog / journalctl ar
```
fd-vir-phy-hnd-format[47, (nil), (nil), (nil), 0]
rect[0, 0, 1920, 1080, 1920, 1088, 2560, 0]
f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
fd-vir-phy-hnd-format[44, (nil), (nil), (nil), 0]
rect[0, 0, 1920, 1080, 1920, 1088, 2560, 0]
f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
This output the user patamaters when rga call blit fail
RgaBlit(1387) RGA_BLIT fail: Invalid argument
RgaBlit(1388) RGA_BLIT fail: Invalid argument
fd-vir-phy-hnd-format[52, (nil), (nil), (nil), 0]
rect[0, 0, 1920, 1080, 1920, 1088, 2560, 0]
f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
fd-vir-phy-hnd-format[44, (nil), (nil), (nil), 0]
rect[0, 0, 1920, 1080, 1920, 1088, 2560, 0]
f-blend-size-rotation-col-log-mmu[0, 0, 0, 0, 0, 0, 1]
This output the user patamaters when rga call blit fail
RgaBlit(1387) RGA_BLIT fail: Invalid argument
RgaBlit(1388) RGA_BLIT fail: Invalid argument
```

This is on a RK3568 board from Firefly.

Linux firefly 4.19.206 #369 SMP Thu Dec 16 10:17:57 CST 2021 aarch64 aarch64 aarch64 GNU/Linux

gst-launch-1.0 --version
GStreamer 1.16.2

gst-inspect-1.0 mpp264enc

Factory Details:
Rank primary + 1 (257)
Long-name Rockchip Mpp H264 Encoder
Klass Codec/Encoder/Video
Description Encode video streams via Rockchip Mpp
Author Randy Li randy.li@rock-chips.com, Jeffy Chen jeffy.chen@rock-chips.com

Plugin Details:
Name rockchipmpp
Description Rockchip Mpp Video Plugin
Filename /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstrockchipmpp.so
Version 1.14.4
License LGPL
Source module gst-rockchip
Binary package GStreamer Rockchip Plug-ins
Origin URL Unknown package origin

cat /root-ro/usr/lib/aarch64-linux-gnu/pkgconfig/rockchip_mpp.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib/aarch64-linux-gnu
includedir=${prefix}/include

Name: rockchip_mpp
Description: Rockchip Media Process Platform
Requires.private:
Version: 1.3.8
Libs: -L${libdir} -lrockchip_mpp
Libs.private:
Cflags: -I${includedir}

mpp_info_test
mpp[3792273]: mpp_info_test: normal version log:
mpp[3792273]: mpp_info: mpp version: 8a85dc5 author: Herman Chen 2022-03-14 [mpp_enc]: Fix stuck on reset async mode encoder
mpp[3792273]: mpp_info_test: history version log:
mpp[3792273]: mpp_info: mpp version history 10:
mpp[3792273]: mpp_info: 8a85dc5 author: Herman Chen 2022-03-14 [mpp_enc]: Fix stuck on reset async mode encoder (HEAD -> master, origin/develop)
mpp[3792273]: mpp_info: c07169d author: Jeffy Chen 2022-03-11 [misc]: Fix a few compile warnings and errors
mpp[3792273]: mpp_info: da6654c author: Yandong Lin 2022-03-10 [h264d_init]: fix h264 video with 10bit parse err
mpp[3792273]: mpp_info: f02fd23 author: Herman Chen 2022-03-09 [mpp_enc]: Use meta with default value to get info
mpp[3792273]: mpp_info: 72a6118 author: Herman Chen 2022-03-09 [mpp_meta]: Add mpp_meta_get with default value
mpp[3792273]: mpp_info: 98ac9b2 author: Hongjin Li 2022-03-09 [h264d_dpb]: Fix h264 video flicker issue
mpp[3792273]: mpp_info: 22caf3f author: toby.zhang 2022-03-08 [hal_vepu580]: Add scene_mode to distinguish ipc and none ipc scene.
mpp[3792273]: mpp_info: 2eb15d5 author: Herman Chen 2022-03-08 [mpp_enc_cfg]: Add tuning scene mode check
mpp[3792273]: mpp_info: ff40ff4 author: Herman Chen 2022-03-07 [mpp_enc_cfg]: Add fine tuning paramter define
mpp[3792273]: mpp_info: 3dea9cc author: zj 2022-03-07 [mpp_soc]: rk3368 has h264 decoder with vdpu1_2160p




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1