JeffyCN / FFmpeg

FFmpeg with rkmpp hwdec - (deprecated due to license issue, check gstreamer instead or https://github.com/nyanmisaka/ffmpeg-rockchip)
https://ffmpeg.org
Other
63 stars 19 forks source link

Crash in librga on RK3588 #8

Closed chuqingq closed 2 years ago

chuqingq commented 2 years ago
 sudo ./ffmpeg -v debug -y -vcodec h264_rkmpp  -i ../2.mp4 -an -vframes 250 ../ffmpeg2.yuv

ffmpeg output:

ninetripod@x3588:~/videostructure/FFmpeg-ubuntu-4.2.2-1ubuntu1$ sudo ./ffmpeg -v debug -y -vcodec h264_rkmpp  -i ../2.mp4 -an -vframes 250 ../ffmpeg2.yuv
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
  configuration: --enable-version3 --enable-libdrm --enable-rkmpp --enable-libx264 --enable-nonfree --enable-gpl
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'h264_rkmpp'.
Reading option '-i' ... matched as input url with argument '../2.mp4'.
Reading option '-an' ... matched as option 'an' (disable audio) with argument '1'.
Reading option '-vframes' ... matched as option 'vframes' (set the number of video frames to output) with argument '250'.
Reading option '../ffmpeg2.yuv' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url ../2.mp4.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument h264_rkmpp.
Successfully parsed a group of options.
Opening an input file: ../2.mp4.
[NULL @ 0x558ab62590] Opening '../2.mp4' for reading
[file @ 0x558ab62e90] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Processing st: 0, edit list 0 - media time: 512, duration: 3098112
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] stts: 0 ctts: 512, ctts_index: 0, ctts_count: 6051
...........
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] stts: 3097088 ctts: 1024, ctts_index: 6049, ctts_count: 6051
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] stts: 3097600 ctts: 0, ctts_index: 6050, ctts_count: 6051
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Offset DTS by 512 to make first pts zero.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Setting codecpar->delay to 1 for stream st: 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Processing st: 1, edit list 0 - media time: 1024, duration: 10671098
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] drop a frame at curr_cts: 0 @ 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] Before avformat_find_stream_info() pos: 180197 bytes read:196608 seeks:0 nb_streams:2
[h264 @ 0x558ab63b40] nal_unit_type: 7(SPS), nal_ref_idc: 1
[h264 @ 0x558ab63b40] nal_unit_type: 8(PPS), nal_ref_idc: 1
[h264 @ 0x558ab63b40] nal_unit_type: 9(AUD), nal_ref_idc: 0
[h264 @ 0x558ab63b40] nal_unit_type: 7(SPS), nal_ref_idc: 1
[h264 @ 0x558ab63b40] nal_unit_type: 8(PPS), nal_ref_idc: 1
[h264 @ 0x558ab63b40] nal_unit_type: 6(SEI), nal_ref_idc: 0
[h264 @ 0x558ab63b40] nal_unit_type: 5(IDR), nal_ref_idc: 1
[h264 @ 0x558ab63b40] ct_type:0 pic_struct:0
[h264 @ 0x558ab63b40] Format yuv420p chosen by get_format().
[h264 @ 0x558ab63b40] Reinit context to 864x480, pix_fmt: yuv420p
[h264 @ 0x558ab63b40] no picture
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] demuxer injecting skip 1024 / discard 0
[aac @ 0x558ab68ad0] skip 1024 / discard 0 samples due to side data
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x558ab62590] After avformat_find_stream_info() pos: 221938 bytes read:229376 seeks:0 frames:2
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.56.101
  Duration: 00:04:02.04, start: 0.000000, bitrate: 855 kb/s
    Stream #0:0(und), 1, 1/12800: Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(left), 854x480 (864x480) [SAR 1:1 DAR 427:240], 0/1, 720 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Successfully opened the file.
Parsing a group of options: output url ../ffmpeg2.yuv.
Applying option an (disable audio) with argument 1.
Applying option vframes (set the number of video frames to output) with argument 250.
Successfully parsed a group of options.
Opening an output file: ../ffmpeg2.yuv.
[file @ 0x558ab649a0] Setting default whitelist 'file,crypto'
Successfully opened the file.
[h264_rkmpp @ 0x558ab8bf20] Format yuv420p chosen by get_format().
[h264_rkmpp @ 0x558ab8bf20] Initializing RKMPP decoder.
[h264_rkmpp @ 0x558ab8bf20] RKMPP decoder initialized successfully.
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> rawvideo (native))
Press [q] to stop, [?] for help
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264_rkmpp @ 0x558ab8bf20] Wrote 41363 bytes to decoder
[h264_rkmpp @ 0x558ab8bf20] Timeout getting decoded frame.
    Last message repeated 1 times
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    Last message repeated 1 times
[h264_rkmpp @ 0x558ab8bf20] Wrote 3365 bytes to decoder
[h264_rkmpp @ 0x558ab8bf20] Timeout getting decoded frame.
    Last message repeated 1 times
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264_rkmpp @ 0x558ab8bf20] Wrote 49 bytes to decoder
[h264_rkmpp @ 0x558ab8bf20] Timeout getting decoded frame.
    Last message repeated 1 times
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264_rkmpp @ 0x558ab8bf20] Wrote 347 bytes to decoder
[h264_rkmpp @ 0x558ab8bf20] Timeout getting decoded frame.
    Last message repeated 1 times
cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
[h264_rkmpp @ 0x558ab8bf20] Buffer full
[h264_rkmpp @ 0x558ab8bf20] Decoder noticed an info change (854x480), format=0
[h264_rkmpp @ 0x558ab8bf20] Buffer full
[h264_rkmpp @ 0x558ab8bf20] Received a frame.
rga_api version 1.8.0_[0]

Message from syslogd@x3588 at Aug 25 22:40:43 ...
 kernel:[ 8136.286155] Internal error: Oops: 96000005 [#7] SMP

Message from syslogd@x3588 at Aug 25 22:40:43 ...
 kernel:[ 8136.603509] Code: d503233f a9be7bfd f9000bf3 910003fd (f9400401)
^C
ninetripod@x3588:~/videostructure/FFmpeg-ubuntu-4.2.2-1ubuntu1$

syslog output:


ninetripod@x3588:~$ sudo tail -f /var/log/syslog
[sudo] password for ninetripod:
Aug 25 22:40:01 x3588 kernel: [ 8094.413871] b930  185ab960 ffffffc0 1071f704 ffffffc0 0371ab18 ffffff81 11e759c4 ffffffc0
Aug 25 22:40:01 x3588 kernel: [ 8094.414599] b950  0371aa80 ffffff81 452d9e00 ffffff81 185ab990 ffffffc0 1071d34c ffffffc0
Aug 25 22:40:01 x3588 kernel: [ 8094.415317] b970  0371ab18 ffffff81 112a9ad0 ffffffc0 0371aa80 ffffff81 042d2000 ffffff80
Aug 25 22:40:01 x3588 kernel: [ 8094.416035] b990  185ab9b0 ffffffc0 10718c5c ffffffc0 0371ab00 ffffff81 10718c34 ffffffc0
Aug 25 22:40:01 x3588 kernel: [ 8094.416763] b9b0  185aba10 ffffffc0 107178fc ffffffc0 011f8ec0 ffffff81 00000000 00000000
Aug 25 22:40:01 x3588 kernel: [ 8094.417490] b9d0  00000000 00000000 00000000 00000000 11e8f000 ffffffc0 8970c75c 0000075b
Aug 25 22:40:01 x3588 kernel: [ 8094.418218] b9f0  00000000 00000000 0371ab00 ffffff81 042d2000 ffffff80 0371aa80 ffffff81
Aug 25 22:40:01 x3588 kernel: [ 8094.418938] Code: d503233f a9be7bfd f9000bf3 910003fd (f9400401)
Aug 25 22:40:01 x3588 kernel: [ 8094.419478] ---[ end trace 72ddac5a69de629c ]---
Aug 25 22:40:11 x3588 kernel: [ 8104.396137] [dhd][wlan0] wl_run_escan : LEGACY_SCAN sync ID: 131, bssidx: 0
Aug 25 22:40:43 x3588 mpp[10042]: mpp_info: mpp version: unknown mpp version for missing VCS info
Aug 25 22:40:43 x3588 mpp[10042]: hal_h264d_vdpu34x: control info: fmt 0, w 854, h 480
Aug 25 22:40:43 x3588 mpp[10042]: mpp_buf_slot: set frame info: w  854 h  480 hor  864 ver  480
Aug 25 22:40:43 x3588 mpp[10042]: mpp_dec: setting default w  854 h  480 h_str  864 v_str  480
Aug 25 22:40:43 x3588 kernel: [ 8136.279015] rga_mm: rga_mm_sync_dma_sg_for_device(1093), failed to get sgt, core = 0x4
Aug 25 22:40:43 x3588 kernel: [ 8136.279715] rga_mm: sync sgt for device error!
Aug 25 22:40:43 x3588 kernel: [ 8136.280113] rga_mm: dst channel map job buffer failed!
Aug 25 22:40:43 x3588 kernel: [ 8136.280115] rga_job: rga_job_run: failed to map buffer
Aug 25 22:40:43 x3588 kernel: [ 8136.281012] rga_job: some error on rga_job_run before hw start, rga_job_next(344)
Aug 25 22:40:43 x3588 kernel: [ 8136.281667] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
Aug 25 22:40:43 x3588 kernel: [ 8136.282431] Mem abort info:
Aug 25 22:40:43 x3588 kernel: [ 8136.282691]   ESR = 0x96000005
Aug 25 22:40:43 x3588 kernel: [ 8136.282965]   EC = 0x25: DABT (current EL), IL = 32 bits

Message from syslogd@x3588 at Aug 25 22:40:43 ...
 kernel:[ 8136.286155] Internal error: Oops: 96000005 [#7] SMP
Aug 25 22:40:43 x3588 kernel: [ 8136.283432]   SET = 0, FnV = 0
Aug 25 22:40:43 x3588 kernel: [ 8136.283704]   EA = 0, S1PTW = 0
Aug 25 22:40:43 x3588 kernel: [ 8136.283976] Data abort info:
Aug 25 22:40:43 x3588 kernel: [ 8136.284227]   ISV = 0, ISS = 0x00000005
Aug 25 22:40:43 x3588 kernel: [ 8136.284565]   CM = 0, WnR = 0
Aug 25 22:40:43 x3588 kernel: [ 8136.284826] user pgtable: 4k pages, 39-bit VAs, pgdp=0000000173b73000
Aug 25 22:40:43 x3588 kernel: [ 8136.285391] [0000000000000008] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
Aug 25 22:40:43 x3588 kernel: [ 8136.286155] Internal error: Oops: 96000005 [#7] SMP
Aug 25 22:40:43 x3588 kernel: [ 8136.286589] Modules linked in:
Aug 25 22:40:43 x3588 kernel: [ 8136.286862] CPU: 6 PID: 10042 Comm: ffmpeg Tainted: G      D           5.10.66 #17
Aug 25 22:40:43 x3588 kernel: [ 8136.287519] Hardware name: 9Tripod I3588 Board (DT)
Aug 25 22:40:43 x3588 kernel: [ 8136.287952] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
Aug 25 22:40:43 x3588 kernel: [ 8136.288479] pc : rga_dma_unmap_buf+0x1c/0x68
Aug 25 22:40:43 x3588 kernel: [ 8136.288859] lr : rga_mm_unmap_dma_buffer+0x40/0x8c
Aug 25 22:40:43 x3588 kernel: [ 8136.289279] sp : ffffffc0186ab910
Aug 25 22:40:43 x3588 kernel: [ 8136.289569] x29: ffffffc0186ab910 x28: ffffffc01173d58a
Aug 25 22:40:43 x3588 kernel: [ 8136.290037] x27: ffffff810371aaf0 x26: ffffffc0116ae6d6
Aug 25 22:40:43 x3588 kernel: [ 8136.290504] x25: ffffff80042d6000 x24: ffffffc01173d57d
Aug 25 22:40:43 x3588 kernel: [ 8136.290975] x23: ffffffc0117dd390 x22: 00000000ffffffea
Aug 25 22:40:43 x3588 kernel: [ 8136.291446] x21: 0000000000000060 x20: 0000000000000000
Aug 25 22:40:43 x3588 kernel: [ 8136.291916] x19: ffffff81452d9d00 x18: 00000000ffff0a10
Aug 25 22:40:43 x3588 kernel: [ 8136.292385] x17: 0000000000000000 x16: 0000000000000100
Aug 25 22:40:43 x3588 kernel: [ 8136.292856] x15: ffffffc0106886b8 x14: 0000000000000003
Aug 25 22:40:43 x3588 kernel: [ 8136.293317] x13: 0000000000000004 x12: 0000000000000001
Aug 25 22:40:43 x3588 kernel: [ 8136.293789] x11: 0000000000000014 x10: ffffffc01071f6f8
Aug 25 22:40:43 x3588 kernel: [ 8136.294260] x9 : ffffffc01071f878 x8 : 0000000000000000
Aug 25 22:40:43 x3588 kernel: [ 8136.294721] x7 : 0000000000000000 x6 : ffffffc011e759c4
Aug 25 22:40:43 x3588 kernel: [ 8136.295182] x5 : ffffffc0186ab840 x4 : 0000000000000000
Aug 25 22:40:43 x3588 kernel: [ 8136.295652] x3 : ffffffc0186ab648 x2 : ffffffc0186ab650
Aug 25 22:40:43 x3588 kernel: [ 8136.296121] x1 : 0000000000000000 x0 : 0000000000000000
Aug 25 22:40:43 x3588 kernel: [ 8136.296591] Call trace:
Aug 25 22:40:43 x3588 kernel: [ 8136.296806]  rga_dma_unmap_buf+0x1c/0x68
Aug 25 22:40:43 x3588 kernel: [ 8136.297154]  rga_mm_unmap_dma_buffer+0x40/0x8c
Aug 25 22:40:43 x3588 kernel: [ 8136.297548]  rga_mm_unmap_buffer+0x54/0x188
Aug 25 22:40:43 x3588 kernel: [ 8136.297918]  rga_mm_unmap_buffer_info+0x2c/0xbc
Aug 25 22:40:43 x3588 kernel: [ 8136.298321]  rga_job_next+0x16c/0x268
Aug 25 22:40:43 x3588 kernel: [ 8136.298646]  rga_job_schedule+0x1c0/0x22c
Aug 25 22:40:43 x3588 kernel: [ 8136.299004]  rga_job_commit+0x64/0x11c
Aug 25 22:40:43 x3588 kernel: [ 8136.299336]  rga_request_commit+0x1cc/0x29c
Aug 25 22:40:43 x3588 kernel: [ 8136.299708]  rga_ioctl+0x14c/0xd60
Aug 25 22:40:43 x3588 kernel: [ 8136.300007]  __arm64_sys_ioctl+0x84/0xbc
Aug 25 22:40:43 x3588 kernel: [ 8136.300350]  el0_svc_common+0x108/0x274
Aug 25 22:40:43 x3588 kernel: [ 8136.300688]  do_el0_svc+0x88/0x94
Aug 25 22:40:43 x3588 kernel: [ 8136.300985]  el0_svc+0x10/0x1c
Aug 25 22:40:43 x3588 kernel: [ 8136.301259]  el0_sync_handler+0x80/0x134
Aug 25 22:40:43 x3588 kernel: [ 8136.301608]  el0_sync+0x1a0/0x1c0
Aug 25 22:40:43 x3588 kernel: [ 8136.301902]
Aug 25 22:40:43 x3588 kernel: [ 8136.301902] PC: 0xffffffc010716e94:
Aug 25 22:40:43 x3588 kernel: [ 8136.302336] 6e94  a9034ff4 910003fd aa0303f6 2a0203f4 aa0103f5 2a0003f7 940a333d b13ffc1f
Aug 25 22:40:43 x3588 kernel: [ 8136.303059] 6eb4  54000382 aa1603e1 aa0003f3 940a561d b13ffc1f 54000382 2a1403e1 aa0003f6
Aug 25 22:40:43 x3588 kernel: [ 8136.303772] 6ed4  940a56bc b13ffc1f 54000362 aa0003e8 a9005ab3 f9000aa8 f9400109 2a1f03e0
Aug 25 22:40:43 x3588 kernel: [ 8136.304485] 6ef4  f9400929 f9001ea9 f9400108 b9401908 b90032b4 f90022a8 a9434ff4 a94257f6
Aug 25 22:40:43 x3588 kernel: [ 8136.305197] 6f14  f9400bf7 a8c47bfd d50323bf d65f03c0 b00088a0 911bd800 2a1703e1 942e1a70
Aug 25 22:40:43 x3588 kernel: [ 8136.305919] 6f34  1400000f f00084a0 912b8c00 942e1a6c 14000008 b0008b20 91394c00 942e1a68
Aug 25 22:40:43 x3588 kernel: [ 8136.306633] 6f54  b4000096 aa1303e0 aa1603e1 940a55bc b4000073 aa1303e0 940a3323 128002a0
Aug 25 22:40:43 x3588 kernel: [ 8136.307348] 6f74  17ffffe6 d503245f aa1e03e9 d503201f d503233f a9be7bfd f9000bf3 910003fd
Aug 25 22:40:43 x3588 kernel: [ 8136.308067] 6f94  f9400401 b40001c1 f9400808 aa0003f3 b40000e8 b9403262 aa0103e0 aa0803e1
.......
Aug 25 22:40:43 x3588 kernel: [ 8136.602786] b9f0  00000000 00000000 0371ab00 ffffff81 042d6000 ffffff80 0371aa80 ffffff81
Aug 25 22:40:43 x3588 kernel: [ 8136.603509] Code: d503233f a9be7bfd f9000bf3 910003fd (f9400401)
Aug 25 22:40:43 x3588 kernel: [ 8136.604047] ---[ end trace 72ddac5a69de629d ]---
^C
ninetripod@x3588:~$

I tried official librga.so(mpp) and https://github.com/airockchip/librga, both failed. If this is an librga issue, how can I avoid this? I tried set pix_fmt manualy, but it does not work.

JeffyCN commented 2 years ago

it's a rga issue, rga is not available for this kind of usage on 3588, please contact rga's maintainer for more details.