How to build and run video codec sample application?

Dear sifive team,
I can see WAVE521/WAVE511 SDK here:

But there is no firmware, is it missed?
The same for WAVE511.

Thanks,
Kun

Maybe this post can give you some help.

Hi Julie,
Thanks a lot for your quick feedback!
What about the firmware for WAVE521 encoder?

BR,
Kun

I’ve seen firmware:

wave511_dec_fw.bin
wave521_enc_fw.bin
wave521c_codec_fw.bin
From a link I posted here.

But I have no idea if they are the right firmware.

Hi mzs,
Thanks a lot for your info!

BR,
Kun

Hi SiFive team,
I test with wave521/wave511 sample example, but fail.
Please see the following logs:

[root@buildroot ~]#
[root@buildroot ~]# ll
total 76
drwx------ 5 root root 4096 Jan 1 1970 .
drwxr-xr-x 18 root root 4096 Nov 30 2022 …
-rw------- 1 root root 524 Jan 1 00:00 .ash_history
drwxr-xr-x 2 root root 4096 Nov 30 2022 codaj12
-rwxr-xr-x 1 root root 18824 Nov 30 2022 mjpeg_dec_test
-rwxr-xr-x 1 root root 14544 Nov 30 2022 video_dec_test
-rwxr-xr-x 1 root root 14640 Nov 30 2022 video_enc_test
drwxr-xr-x 4 root root 4096 Jan 1 1970 wave511
drwxr-xr-x 5 root root 4096 Jan 1 1970 wave521
[root@buildroot ~]# cd wave521
[root@buildroot ~/wave521]# ll
total 2524
drwxr-xr-x 5 root root 4096 Jan 1 1970 .
drwx------ 5 root root 4096 Jan 1 1970 …
drwxr-xr-x 2 root root 4096 Jan 1 1970 cfg
-rwxr-xr-x 1 root root 949120 Oct 29 2021 chagall.bin
-rwxr-xr-x 1 root root 534 Jan 1 1970 run.sh
drwxr-xr-x 2 root root 4096 Jan 1 1970 script
-rwxr-xr-x 1 root root 67464 Nov 30 2022 venc.ko
-rwxr-xr-x 1 root root 681 Nov 30 2022 venc_load.sh
-rwxr-xr-x 1 root root 1531480 Nov 30 2022 venc_test
-rwxr-xr-x 1 root root 158 Nov 30 2022 venc_unload.sh
drwxr-xr-x 2 root root 4096 Jan 1 1970 yuv
[root@buildroot ~/wave521]# cat run.sh
#!/bin/sh

#./venc_test --codec=0 --picWidth=352 --picHeight=288 --coreIdx=0 --kbps=30 --lineBufInt=1 --loop-count=0 --lowLatencyMode=0 --packedFormat=0 --rotAngle=0 --mirDir=0 --secondary-axi=0 --frame-endian=31 --stream-endian=31 --source-endian=31 --srcFormat=0 --cfgFileName=./cfg/avc_inter_8b_02.cfg --output=./output/inter_8b_02.cfg.264 --input=./yuv/BasketballDrive_352x288_8b.yuv
./venc_test --codec=12 --cfgFileName=./cfg/hevc_fhd_inter_8b_11.cfg --output=./output/inter_8b_11.cfg.265 --input=./yuv/mix_1920x1080_8b_9frm.yuv
[root@buildroot ~/wave521]# ll yuv/mix_1920x1080_8b_9frm.yuv
-rw-r–r-- 1 root root 31104000 Nov 25 2022 yuv/mix_1920x1080_8b_9frm.yuv
[root@buildroot ~/wave521]# ll
total 2524
drwxr-xr-x 5 root root 4096 Jan 1 1970 .
drwx------ 5 root root 4096 Jan 1 1970 …
drwxr-xr-x 2 root root 4096 Jan 1 1970 cfg
-rwxr-xr-x 1 root root 949120 Oct 29 2021 chagall.bin
-rwxr-xr-x 1 root root 534 Jan 1 1970 run.sh
drwxr-xr-x 2 root root 4096 Jan 1 1970 script
-rwxr-xr-x 1 root root 67464 Nov 30 2022 venc.ko
-rwxr-xr-x 1 root root 681 Nov 30 2022 venc_load.sh
-rwxr-xr-x 1 root root 1531480 Nov 30 2022 venc_test
-rwxr-xr-x 1 root root 158 Nov 30 2022 venc_unload.sh
drwxr-xr-x 2 root root 4096 Jan 1 1970 yuv
[root@buildroot ~/wave521]# cat venc_load.sh
#!/bin/sh

module=“venc”
device=“venc”
mode=“664”

Group: since distributions do it differently, look for wheel or use staff

if grep ‘^staff:’ /etc/group > /dev/null; then
group=“staff”
else
group=“wheel”
fi

invoke insmod with all arguments we got

and use a pathname, as newer modutils do not look in . by default

/sbin/insmod ./$module.ko $* || exit -1

major=cat /proc/devices | grep $device|awk {'print $1'}

Remove stale nodes and replace them, then give gid and perms

Usually the script is shorter, it is simple that has several devices in it.

rm -f /dev/${device}
mknod /dev/${device} c $major 0
chgrp $group /dev/${device}
chmod $mode /dev/${device}

[root@buildroot ~/wave521]# ./venc_load.sh
venc: loading out-of-tree module taints kernel.
venc 118e0000.vpu_enc: coherent device 0 dev->dma_coherent 0
venc 118e0000.vpu_enc: device init.
SUCCESS alloc_chrdev_region
venc 118e0000.vpu_enc: success to init VENC clock & reset.
[root@buildroot ~/wave521]# lsmod
Module Size Used by Tainted: G
venc 40960 0
[root@buildroot ~/wave521]# ./run.sh
[ERROR]VPU_EncOpen failed Error code is 0x3
[ERROR][RESULT] FAILURE
[root@buildroot ~/wave521]#
[root@buildroot ~/wave521]# cd …/wave511/
[root@buildroot ~/wave511]# ls
cfg dec_test stream vdec_load.sh
chagall.bin dec_test.sh vdec.ko vdec_unload.sh
[root@buildroot ~/wave511]# ./vdec_load.sh
vdec 118f0000.vpu_dec: coherent device 0 dev->dma_coherent 0
vdec 118f0000.vpu_dec: device init.
SUCCESS alloc_chrdev_region
vdec 118f0000.vpu_dec: success to init VDEC clock & reset.
[root@buildroot ~/wave511]#
[root@buildroot ~/wave511]# ls
cfg dec_test stream vdec_load.sh
chagall.bin dec_test.sh vdec.ko vdec_unload.sh
[root@buildroot ~/wave511]# cat dec_test.sh
#!/bin/sh
./dec_test --input stream/hevc_fhd_inter_8b_11.cfg_0.265 --output output/hevc_fhd_inter_8b_11.cfg_0.yuv --codec 12
[root@buildroot ~/wave511]# ./dec_test.sh
[ERROR]
INSNTANCE #0 INTERRUPT TIMEOUT.
[ERROR]
INSNTANCE #0 INTERRUPT TIMEOUT.
[ERROR]DestroyDecoder:980 NO RESPONSE FROM VPU_DecClose()
[root@buildroot ~/wave511]#

Could you please help check?

Thanks,
Kun

Hi Kun

Did you manage to get the video decoder sample app (or ffmpeg + vdec) to work?

Hopefully we can get this to build and work under Debian too and not have to use buildroot.