Ffmpeg and hardware h264 decode

Hi, I got a similar one trying to setup hardware decode on armbian.

[   11.647444] [TEE] E/TC:? 00 tee_rpmb_verify_key_sync_counter:967 Verify key returning 0xffff0008
[   11.647463] [TEE] E/TA:   MM-module-name:Video firmware TA,Version:1.0.5-g3604ffd(build:958)
[   11.647467] [TEE] E/TA:   load_video_fw:650 Verify failed

Any idea how I can solve this ?

Hello @sousmangoosta

It seems the video firmware load failed. Which Armbian you used?

@ivan.li please follow up.

Thanks @numbqq @ivan.li
I used that one Armbian 24.2.1 bookworm
I needed to add some packages by myself optee-userspace_0.5-202311_arm64.deband optee-video-firmware_0.4-202311_arm64.deb from https://dl.khadas.com/repos/vim4-5.15/pool/main/o/.
The firmware /lib/firmware/video/video_ucode.bin is provided by the armbian-firmware package.

Package: armbian-firmware
Version: 24.2.1
Priority: optional
Section: kernel
Maintainer: Armbian Linux <info@armbian.com>
Installed-Size: 235 MB
Provides: linux-firmware, firmware-brcm80211, firmware-ralink, firmware-samsung, firmware-realtek, armbian-firmware-full
Conflicts: linux-firmware, firmware-brcm80211, firmware-ralink, firmware-samsung, firmware-realtek, armbian-firmware-full
Armbian-Original-Hash: 1-SA6b6f-B90f5-R448a
Download-Size: 75,2 MB
APT-Manual-Installed: yes
APT-Sources: http://imola.armbian.com/apt bookworm/main arm64 Packages
Description: Armbian - Linux firmware
dpkg -L armbian-firmware |grep video_ucode.bin
/lib/firmware/video/video_ucode.bin
sha1sum /lib/firmware/video/video_ucode.bin
19d8bbabf3dd03170f55943c46074920504fa7c4  /lib/firmware/video/video_ucode.bin
systemctl status video-firmware-preload-khadas
× video-firmware-preload-khadas.service - Amlogic OPTEE Video Firmware Preload Service
     Loaded: loaded (/lib/systemd/system/video-firmware-preload-khadas.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2024-05-11 12:45:15 CEST; 1s ago
   Duration: 2.022s
    Process: 130209 ExecStart=/usr/bin/tee_preload_fw /lib/firmware/video/video_ucode.bin (code=exited, status=255/EXCEPTION)
   Main PID: 130209 (code=exited, status=255/EXCEPTION)
        CPU: 2.005s

mai 11 12:45:13 khadas-vim4 systemd[1]: Started video-firmware-preload-khadas.service - Amlogic OPTEE Video Firmware Preload Service.
mai 11 12:45:15 khadas-vim4 tee_preload_fw[130209]: fw_path = /lib/firmware/video/video_ucode.bin
mai 11 12:45:15 khadas-vim4 tee_preload_fw[130209]: MM-module-name:Video firmware CA,Version:1.0.5-g3604ffd(build:958)
mai 11 12:45:15 khadas-vim4 tee_preload_fw[130209]: TEEC_InvokeCommand failed with code 0xffff000f origin 0x4
mai 11 12:45:15 khadas-vim4 tee_preload_fw[130209]: tee preload video fw fail
mai 11 12:45:15 khadas-vim4 systemd[1]: video-firmware-preload-khadas.service: Main process exited, code=exited, status=255/EXCEPTION
mai 11 12:45:15 khadas-vim4 systemd[1]: video-firmware-preload-khadas.service: Failed with result 'exit-code'.
mai 11 12:45:15 khadas-vim4 systemd[1]: video-firmware-preload-khadas.service: Consumed 2.005s CPU time.

It’s ok with this one https://github.com/numbqq/fenix/blob/master/archives/hwpacks/video-firmware/Amlogic/VIM4/video/video_ucode.bin

/usr/bin/tee_preload_fw video_ucode.bin 
fw_path = video_ucode.bin
MM-module-name:Video firmware CA,Version:1.0.5-g3604ffd(build:958)
tee preload video fw ok
[74669.200349] [TEE] E/TA:   MM-module-name:Video firmware TA,Version:1.0.5-g3604ffd(build:958)
[74673.296468] [TEE] E/TA:   fw_check_pack_version:292 the package has 15 fws totally.
[74673.296498] [TEE] E/TA:   fw_check_pack_version:309 The TA ver is v1.0
[74673.296509] [TEE] E/TA:   fw_check_pack_version:310 The fw ver is v0.4
[74673.296518] [TEE] E/TA:   fw_data_insert:389 the fw with 332 KB will be loaded.
[74673.296527] [TEE] M/TA: TEE_Video_Load_FW success

Thanks for reporting it. We are working on it and this will be fixed in the upcoming 24.5 release

Regards
The Armbian Team

Hi,

Did you try again on VIM3 as 5.15 kernel is out now ?

Regards,