VIM4 Fenix 1.7.2 H264 crashes kernel. (Missing TEE?)

Which system do you use? Android, Ubuntu, OOWOW or others?

`Fenix Debian 12 - Minimal
Fenix Debian 12 - Server
OOWOW Ubuntu 1.7.x

(Tried all three)
`

Which version of system do you use? Please provide the version of the system here:

**1.7.2**

Please describe your issue below:

**Hardware H264 crashes kernel**

Post a console log of your issue below:

Command line:

$ ffmpeg -c:v h264_v4l2m2m -i rtsp://192.168.10.134:8554/garden_high_cam -f null /dev/null

Kernel logs

Nov 24 11:12:04 Khadas kernel: [amlcom]:vdec_create instance 0000000058244886, total 1, PM: power-domain
Nov 24 11:12:04 Khadas kernel: [media_clock]: vdec mux clock is 799999988 Hz
Nov 24 11:12:04 Khadas kernel: [amlcom]:vdec_init, dev_name:ammvdec_h264_v4l, vdec_type=VDEC_TYPE_FRAME_BLOCK, format: 2, total: 1
Nov 24 11:12:04 Khadas kernel: [h264]:0: pdata->config=parm_v4l_codec_enable:1;mh264_double_write_mode:16;parm_v4l_buffer_margin:7;parm_v4l_canvas_mem_mode:0;parm_v4l_canvas_mem_endian:0;
Nov 24 11:12:04 Khadas kernel: [h264]:ammvdec_h264_mmu_init tvp = 0x0
Nov 24 11:12:04 Khadas kernel: [media_clock]: vdec mux clock is 799999988 Hz
Nov 24 11:12:04 Khadas kernel: [h264]:vh264_init, phy_addr=98200000 vaddr=000000001b74c61b
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel: Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000000000000868
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel: Mem abort info:
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel:   ESR = 0x96000005
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel:   EC = 0x25: DABT (current EL), IL = 32 bits
Nov 24 11:12:04 Khadas kernel:   SET = 0, FnV = 0
Nov 24 11:12:04 Khadas kernel:   EA = 0, S1PTW = 0
Nov 24 11:12:04 Khadas kernel:   FSC = 0x05: level 1 translation fault
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel: Data abort info:
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel:   ISV = 0, ISS = 0x00000005
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel:   CM = 0, WnR = 0
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel: user pgtable: 4k pages, 39-bit VAs, pgdp=0000000122a40000
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel: [0000000000000868] pgd=0000000000000000, p4d=0000000000000000, pud=0000000000000000
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel: Internal error: Oops: 0000000096000005 [#1] PREEMPT SMP
Nov 24 11:12:04 Khadas kernel: Modules linked in:
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel:  zram(E) snd_seq(E) dhd(E) amvenc_multi(E) jpegenc(E) encoder_common(E) media_sync(E) amvdec_avs2_fb_v4l(E)
Nov 24 11:12:04 Khadas kernel: [amlv4l]:[2]: Post event: dec err
Nov 24 11:12:04 Khadas kernel:  amvdec_mavs_v4l(E) amvdec_avs2_v4l(E) amvdec_avs3_v4l(E) amvdec_av1_v4l(E) amvdec_av1(E) amvdec_mavs(E) amvdec_avs2(E) amvdec_vp9_v4l(E) amvdec_vp9(E) amvdec_vc1(E)
Nov 24 11:12:04 Khadas kernel: [amlcom]:optee_load_fw ret ffff0007, core 0, is_swap 0
Nov 24 11:12:04 Khadas kernel:  amvdec_mmpeg4_v4l(E) amvdec_mmpeg4(E) usbkbd(E) amvdec_mmpeg12_v4l(E) amvdec_mmpeg12(E) amvdec_mmjpeg_v4l(E) amvdec_mmjpeg(E) amvdec_h265_v4l(E)
Nov 24 11:12:04 Khadas kernel: [h264]:0: MH264 the TEE fw loading failed, err: ffff0007
Nov 24 11:12:04 Khadas kernel:  amvdec_h265(E) amvdec_h264mvc(E) amvdec_mh264_v4l(E) amvdec_mh264(E) amvdec_ports(E) stream_input(E)

Edit
NOTES: Does not work with OOWOW Ubuntu Image either.

UPDATE:

If I play a MP4 file, it works fine (RTSP Stream does not)

Command Line -
ffmpeg -c:v h264_v4l2m2m -i 03.58.mp4 -f null /dev/null

From Logs

[  150.400628] [media_clock]: vdec mux clock is 799999988 Hz
[  150.400780] [h264]:vh264_init, phy_addr=98200000 vaddr=00000000964e6a30
[  150.408177] [h264]:0: vmh264_get_ps_info mmu_enable 0 double_write_mode 0x10
[  150.408193] [amlv4l]:[2]: Parse from ucode, visible(1920 x 1056), coded(1920 x 1088), scan:P, bitdepth(0), dw(10)
[  150.408210] [amlv4l]:[2]: Picture buffer count: dec:2, vpp:0, ge2d:0, margin:7, total:9
[  150.412665] [amlv4l]:[2]: Post event: res chg
[  150.435279] [h264]:0: restriction_flag=0, max_dec_frame_buffering=1, dec_dpb_size=2 num_reorder_frames 0 used_reorder_dpb_size_margin 7
[  150.445958] [h264]:0: decoder duration change old: 0 new: 3200
[  151.947558] [amlv4l]:[2]: Post event: eos
[  151.948314] [amlv4l]:[2]: reset mode: 1, es frames buffering: 0
[  151.974384] [amlv4l]:[2]: reset mode: 1, es frames buffering: 0
[  152.038238] [amlv4l]:[2]: reset mode: 1, es frames buffering: 0
[  152.064528] [amlcom]:vdec_release instance 00000000f274be0f, total 1
[  152.065021] [media_clock]: the clk_vdec_mux    clock off, ref cnt: 0

If I play a RTSP video stream - it Kernel OOPS

Hello @RichardPar

Do you have same issues for previous images? Which images work and which not?

@numbqq999
It worked on Debian11 (older kernel) - but no longer on Debian 12

I just tried Fenix 1.6.5 and it didnt work either (built in May)
Linux Khadas 5.15.119 #1.6.5 SMP PREEMPT Wed May 8 20:35:45 BST 2024 aarch64 GNU/Linux

Same problem.

About Debian 11, what’s the kernel version? And Debian 12, do you use the same kernel ?

I only use Fenix to build… so its whatever is there!

@numbqq Will this be progressed? I have reproduced with GStreamer too using the v4l hardware decoder. The commands dont work on Ubuntu downloaded from OOWOW either.

I have reproduce this issue with ffmpeg rtsp and will check this issue.

You mean gstreamer play local file also has this issue? Which image and how to reproduce?

1 Like