K230 Image Practical - Boot Video and Boot Logo#
Overview#
This document explains how to implement boot video and boot logo on the K230 EVB development board through video decoding. The video decoding module supports H.264/H.265/MJPEG decoding, with a maximum screen display resolution of 1920x1080 and can be rotated.
1. Environment Preparation#
1.1 Hardware Environment#
K230-USIP-LP3-EVB-V1.0/K230-UNSIP-LP3-EVB-V1.1
Type-C USB cable for power supply.
SD card
Screen and cables
Camera sub-board (IMX335)
1.2 Software Environment#
The k230_sdk provides toolchains located in the following paths.
Large core rt-smart toolchain
k230_sdk/toolchain/riscv64-linux-musleabi_for_x86_64-pc-linux-gnu
Small core Linux toolchain
k230_sdk/toolchain/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.0
You can also download the toolchains via the following links:
wget https://download.rt-thread.org/rt-smart/riscv64/riscv64-unknown-linux-musl-rv64imafdcv-lp64d-20230222.tar.bz2
wget https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1659325511536/Xuantie-900-gcc-linux-5.10.4-glibc-x86_64-V2.6.0-20220715.tar.gz
2. Source Code Location#
The SDK contains a user-space decoding demo located at k230_sdk/src/big/mpp/userapps/sample/sample_vdec
. The compiled executable file is located at k230_sdk/src/big/mpp/userapps/sample/elf/sample_vdec.elf
. By default, it is not loaded into the large core image and requires modification of the Makefile as described in the execution section to generate the executable file in the /mnt
directory after the large core starts.
Source Code Analysis#
sample_vb_init
: Configure vb pool count and initialize vb.vb_create_pool
: Configure the block size and number of each pool in vb.kd_mpi_vdec_create_chn
: Create a decoding channel.kd_mpi_vdec_start_chn
: Start the decoding channel.sample_vdec_bind_vo
: Bind the decoder to vo.input_thread
: Read data from the file and callkd_mpi_vdec_send_stream
to send the data to the VPU.output_thread
: Retrieve decoded data from the VPU.
3. Program Execution#
Modify the
mpp-apps
compilation script ink230_sdk/Makefile
. Changecp userapps/sample/fastboot_elf/* $(RTSMART_SRC_DIR)/userapps/root/bin/; \
to
cp userapps/sample/elf/sample_vdec.elf $(RTSMART_SRC_DIR)/userapps/root/bin/; \
Copy the H.264/H.265/MJPEG/JPEG files to be displayed into the
k230_sdk/src/big/rt-smart/userapps/root/bin
directory.Modify
k230_sdk/src/big/rt-smart/init.sh
with the following command:/bin/sample_vdec -i <filename> [-t <sec>]
<filename>
is the video file copied in the previous step.-t
is used only when displaying images, specifying the display duration.
Execute the
make
command in thek230_sdk
directory.Write the compiled
k230_sdk/output/k230_evb_defconfig/images/sysimage-sdcard.img
to the SD card, set all DIP switches on the EVB board to OFF (boot from SD card), and the boot video will be displayed.
The display effect is as follows: