基于linux5.15.5的IMX 参考手册 ---21

本文档详述了基于Linux5.15.5的i.MX平台的测试用例,包括HDMI和DP接口的测试,视频处理单元(VPU)的多种解码和编码功能,JPEG编解码器,ALSA音频测试,以及安全相关功能如DCIC和SIM卡接口的测试。此外,还涵盖了RTC模块的实时时钟和中断测试。
摘要由CSDN通过智能技术生成

基于linux5.15.5的IMX 参考手册 — 21

10.5.2高清多媒体接口(HDMI)和显示端口(DP)概述
10.5.2.1测试名称
•mxc_cec_test.out
10.5.2.1.1位置
/unit_tests/HDMI/
10.5.2.1.2功能
验证HDMI CEC功能并向HDMI接收器发送断电命令。
10.5.2.1.3配置

对于mxc_cec_test.out 在目标板defconfig文件中添加以下行:
CONFIG_MXC_HDMI_CEC=y
硬件应支持HDMI,电视应支持HDMI CEC
10.5.2.1.4用例和预期输出
./mxc_cec_test.out
10.5.3视频处理单元(VPU)
10.5.3.1 i.MX 6测试
• autorun-vpu.sh
• mxc_vpu_test.out
10.5.3.1.1位置
/unit_test/VPU/
10.5.3.1.2功能
VPU测试在视频处理单元(VPU)上执行以下选项:
•解码一个流,并显示在LCD上。
•解码流并保存到文件。
•使用配置文件解码流。
•编码一个YUV流并保存到一个文件。
•从相机编码图像和解码它显示在LCD上。
•同时解码不同格式的多个流。
•解码和编码同时进行。
•输出到电视输出。
•用VDI(通过IPU的HW去交错)测试VPU。
10.5.3.1.3配置
此测试需要在/usr/lib/和LCD display下面libvpu.so。这个测试需要i.MX 6QuadPlus/Quad/Dual SoC。
10.5.3.1.4用例和预期输出

To test MPEG-4 decode and save to file:
./mxc_vpu_test.out -D "-i /usr/vectors/file.m4v -f 0 -o out.yuv"
To test H.263 decode and save to file:
./mxc_vpu_test.out -D "-i /usr/vectors/file.263 -f 1 -o out.yuv"
To test H.264 decode and save to file:
./mxc_vpu_test.out -D "-i /usr/vectors/file.264 -f 2 -o out.yuv"
Decode a stream using a config file.
Change options in config file, e.g, config_dec. Input correct input filename, output filename, format,
./mxc_vpu_test.out -C config_dec
Encode a YUV stream and save to a file.
To test MPEG-4 encode and save to a file:
./mxc_vpu_test.out -E "-i file.yuv -w 240 -h 320 -f 0 -o file.mpeg4"
To test H.263 encode and save to a file:
./mxc_vpu_test.out -E "-i file.yuv -w 240 -h 320 -f 1 -o file.263"
To test H.264 encode and save to a file:
./mxc_vpu_test.out -E "-i file.yuv -w 240 -h 320 -f 2 -o file.264"
Encode an image from the camera and decode it to display on the LCD.
To encode an MPEG4 image from the camera and display on the LCD: that
./mxc_vpu_test.out -L "-f 0 -w 1280 -h 720"
To encode an H263 image from the camera and display on the LCD:
./mxc_vpu_test.out -L "-f 1 -w 1280 -h 720"
To encode an H264 image from the camera and display on the LCD:
./mxc_vpu_test.out -L "-f 2 -w 1280 -h 720"
Decode multiple streams with different formats simultaneously.
Decoder one H264 and one MPEG4 streams.
./mxc_vpu_test.out -D "-i/vectors/file.264 -f 2" -D "-i ./akiyo.mp4 -f 0 -o akiyo.yuv"
Decode and encode simultaneously.
Encode one MPEG-4 stream and decode one H.264 stream simultaneously.
./mxc_vpu_test.out -E "-w 176 -h 144 -f 0 -o enc.m4v" -D "-i/vectors/file.264 -f
Test VPU with TV out.
Decoder one stream as normal VPU test. For example, H264 video stream:
./mxc_vpu_test.out -D "-i filename -f 2"
Test VPU with VDI (HW deinterlace via IPU).
Select one stream with top and bottom fields are interlaced.
av_stress2_dsmcc4m_1_C1_V11_A6.mp4_track1.h264
To decode the stream and display on LCD:
./mxc_vpu_test.out -D "-i av_stress2_dsmcc4m_1_C1_V11_A6.mp4_track1.h264 -f2"
To decode the stream and display on LCD using high motion stream video De Interlacing algorithm:
./mxc_vpu_test.out -D "-i av_stress2_dsmcc4m_1_C1_V11_A6.mp4_track1.h264 -v h -f2"
To decode the stream and display on LCD using low motion stream video De Interlacing algorithm:
./mxc_vpu_test.out -D "-i av_stress2_dsmcc4m_1_C1_V11_A6.mp4_track1.h264 -v l -f2"
To decode the stream and display on LCD having input in NV12 pixel format:
./mxc_vpu_test.out -D "-i av_stress2_dsmcc4m_1_C1_V11_A6.mp4_track1.h264 -v

10.5.3.2 i.MX 8M Quad测试
10.5.3.2.1位置
/ unit_test VPU/hantro
10.5.3.2.2功能
VPU测试在VPU上执行以下选项:
•解码流并保存到文件。
10.5.3.2.3用例和预期输出
解码不同编解码器示例:

./autorun-vpu.sh
Decode one stream and display on the LCD.
To test MPEG-4 decode and display to screen:
./mxc_vpu_test.out -D "-i /usr/vectors/file.m4v -f 0"
To test H.263 decode and display to screen:
./mxc_vpu_test.out -D "-i /usr/vectors/file.263 -f 1"
To test H.264 decode and display to screen:
./mxc_vpu_test.out -D "-i /usr/vectors/file.264 -f 2"
You can get the mp4 test file from the imx-test.git server.
It is located under test/mxc_vpu_test/configs/akiyo.mp4.
Decode a stream and save to a file.
/unit_tests/VPU/hantro/g2dec -P -b -ibs -Oout.yuv test.hevc
/unit_tests/VPU/hantro/g2dec -P -b -iivf -Oout.yuv test.vp9
/unit_tests/VPU/hantro/hx170dec -P -Oout.yuv test.h264
/unit_tests/VPU/hantro/mx170dec -P -Oout.yuv test.mpeg4
/unit_tests/VPU/hantro/m2x170dec -P -Oout.yuv test.mpeg2
/unit_tests/VPU/hantro/vx170dec -P -Oout.yuv test.vc1
/unit_tests/VPU/hantro/vp8x170dec -P -Oout.yuv test.vp8
/unit_tests/VPU/hantro/vp6dec -P -Oout.yuv test.vp6
/unit_tests/VPU/hantro/rvx170dec -P -Oout.yuv test.rv
/unit_tests/VPU/hantro/jx170dec -P -Oout.yuv test.jpg
/unit_tests/VPU/hantro/ax170dec -P -Oout.yuv test.avs

10.5.3.3 i.m mx 8M Mini的测试
10.5.3.3.1位置
/ unit_test VPU / hantro
10.5.3.3.2功能
VPU测试在VPU上执行以下选项:
•解码流并保存到文件。
•编码一个YUV流并保存到一个文件。
10.5.3.3.3用例和预期输出
解码器示例:
/unit_tests/VPU/hantro/g2dec -P -b -ibs -Oout.yuv test.hevc
/unit_tests/VPU/hantro/g2dec -P -b -iivf -Oout.yuv test.vp9
/unit_tests/VPU/hantro/hx170dec -P -Oout.yuv test.h264
/unit_tests/VPU/hantro/vp8x170dec -P -Oout.yuv test.vp8
编码器示例:
/unit_tests/VPU/hantro/h264_testenc -w176 -h144 -o temp.h264 -i test.yuv
/unit_tests/VPU/hantro/vp8_testenc -w176 -h144 -o temp.h264 -i test.yuv
10.5.3.4 i.m ax 8QuadXPlus和8QuadMax测试
10.5.3.4.1位置
/unit_test/V4L2_VPU/
10.5.3.4.2功能
VPU测试在VPU上执行以下选项:
•解码流并保存到文件。
•编码一个YUV流并保存到一个文件。
10.5.3.4.3用例和预期输出
解码器的示例,它有助于列出不同编解码器的’ifmt’值:
/unit_tests/V4L2_VPU/mxc_v4l2_vpu_dec.out ifile test.hevc ifmt 13 ofmt 1 ofile out.yuv
/unit_tests/V4L2_VPU/mxc_v4l2_vpu_dec.out ifile test.h264 ifmt 1 ofmt 1 ofile out.yuv
编码器示例(仅H.264):
/unit_tests/V4L2_VPU/mxc_v4l2_vpu_enc.out ifile --key 0 --name input_720p.nv12 --fmt nv12 --size 1280
720 --loop 1 encoder --key 1 --source 0 --size 1280
720 --framerate 30 --bitrate 3000000 --lowlatency 1 ofile --key 2 --source 1 --name test.h264
10.5.4 JPEG编解码器
10.5.4.1测试名称
•encoder_test
•decoder_test
10.5.4.1.1位置
/ unit_test / JPEG
10.5.4.1.2功能
encoder_test接收一个支持格式之一的原始文件作为输入,并生成一个JPEG文件作为输出,其分辨率和像素格式与输入相同。应用程序在一个V4L2输出缓冲区中填充原始文件,将其放入驱动程序中,并期望在一个捕获缓冲区中对JPEG图像出队列。
decoder_test接收一个支持格式之一的JPEG文件作为输入,并生成一个原始文件作为输出,其分辨率和像素格式与输入相同。应用程序在一个V4L2输出缓冲区中填充jpeg文件,将其放入驱动程序中,并期望在一个捕获缓冲区中对原始图像进行出队列。
10.5.4.1.3配置
无特殊配置。
10.5.4.1.4用例和预期输出
运行应用程序来获取使用情况:

./decoder_test.out
用法:
./decoder_test.out -d </dev/videoX> -f <INPUT_FILENAME> -w <width> -h <height> -p <pixel_format>
支持格式:
yuv420: 2-planes, Y and UV-interleaved, same as NV12
yuv422: packed YUYV
rgb24: packed RGB
yuv444: packed YUV
gray: Y8 or Y12 or Single Component
argb: packed ARGB

输入文件必须是与指定的宽度、高度和像素格式相匹配的JPEG文件。输出是当前文件夹中名为“outfile”的原始文件,具有与输入相同的宽度、高度和像素格式。
./encoder_test.out
用法:

./encoder_test.out -d </dev/videoX> -f <INPUT_FILENAME> -w <width> -h <height> -p <pixel_format>
支持格式:
yuv420: 2-planes, Y and UV-interleaved, same as NV12
yuv422: packed YUYV
rgb24: packed RGB
yuv444: packed YUV
gray: Y8 or Y12 or Single Component
argb: packed ARGB

输入文件必须是符合指定宽度、高度和像素格式的原始文件。输出是当前文件夹中名为“outfile.jpeg”的JPEG文件,具有与输入相同的宽度、高度和像素格式。
10.6音频
10.6.1 高级Linux声音架构(ALSA)片上系统(ASoC)声音
10.6.1.1测试名称
•mxc_tuner_test.out
10.6.1.1.1位置
/ unit_test / ALSA /
10.6.1.1.2功能
使用ALSA测试音频功能。
10.6.1.1.3配置
ALSA支持在所有i.MX的测试播放,录音和扬声器测试。要使用此调谐器测试,它需要调谐器硬件只在i.MX 6自动参考板上可用
10.6.1.1.4用例和预期输出
10.6.2异步采样速率转换器(ASRC)
10.6.2.1测试名称
•mxc_asrc_test.out
10.6.2.1.1位置
/unit_tests/ASRC
10.6.2.1.2功能
将WAV转换为不同的采样率。
10.6.2.1.3配置
没有
10.6.2.1.4用例和预期输出

#/unit_tests/ASRC/mxc_asrc_test.out -to 48000 /unit_tests/ASRC/audio8k16S.wav
audio48k16S.wav
---- Running < /unit_tests/ASRC/mxc_asrc_test.out > test ----
Pair A requested
All tests passed with success

mxc_asrc_test.out的更多用法。可以通过以下命令获取:

#/unit_tests/ASRC/mxc_asrc_test.out -h
---- Running < /unit_tests/ASRC/mxc_asrc_test.out > test ----
**************************************************
* Test aplication for ASRC
* Options :
-to <output sample rate> <origin.wav$gt; <converted.wav>
<input clock source> <output clock source>
input clock source types are:
0 -- INCLK_NONE
1 -- INCLK_ESAI_RX
2 -- INCLK_SSI1_RX
3 -- INCLK_SSI2_RX
4 -- INCLK_SPDIF_RX
5 -- INCLK_MLB_CLK
6 -- INCLK_ESAI_TX
7 -- INCLK_SSI1_TX
8 -- INCLK_SSI2_TX
9 -- INCLK_SPDIF_TX
10 -- INCLK_ASRCK1_CLK
default option for output clock source is 0
output clock source types are:
0 -- OUTCLK_NONE
1 -- OUTCLK_ESAI_TX
2 -- OUTCLK_SSI1_TX
3 -- OUTCLK_SSI2_TX
4 -- OUTCLK_SPDIF_TX
5 -- OUTCLK_MLB_CLK
6 -- OUTCLK_ESAI_RX
7 -- OUTCLK_SSI1_RX
8 -- OUTCLK_SSI2_RX
9 -- OUTCLK_SPDIF_RX
10 -- OUTCLK_ASRCK1_CLK
default option for output clock source is 10
**************************************************

10.7安全
10.7.1显示内容完整性检查器(DCIC)
10.7.1.1测试名称
•mxc_dcic_test.out
10.7.1.1.1位置
/ unit_test / DCIC /
10.7.1.1.2功能
DCIC的目标是验证发送到显示器的安全关键信息是否被损坏。
10.7.1.1.3配置
没有
10.7.1.1.4用例和预期输出

# ./mxc_dcic_test.out -bw 18 -dev 1
mxc_dcic_test.out的预期输出:
More usages for mxc_asrc_test.out can be obtained by the following command:
Opened fb0
open /dev/dcic1
bpp=16, bus_width=18
Config ROI=1
Config ROI=3
Config ROI=5
ROI=0,crcRS=0x0, crcCS=0x0
ROI=1,crcRS=0x6cd6b18d, crcCS=0x6cd6b18d
ROI=2,crcRS=0x0, crcCS=0x0
ROI=3,crcRS=0xc9da7ae6, crcCS=0xc9da7ae6
ROI=4,crcRS=0x0, crcCS=0x0
ROI=5,crcRS=0xb5ba1453, crcCS=0xb5ba1453
ROI=6,crcRS=0x0, crcCS=0x0
ROI=7,crcRS=0x0, crcCS=0x0
ROI=8,crcRS=0x0, crcCS=0x0
ROI=9,crcRS=0x0, crcCS=0x0
ROI=10,crcRS=0x0, crcCS=0x0
ROI=11,crcRS=0x0, crcCS=0x0
ROI=12,crcRS=0x0, crcCS=0x0
ROI=13,crcRS=0x0, crcCS=0x0
ROI=14,crcRS=0x0, crcCS=0x0
ROI=15,crcRS=0x0, crcCS=0x0
All ROI CRC check success!

10.7.2 SIM
10.7.2.1测试名称
•mxc_sim_test.out
10.7.2.1.1位置
/unit_test/SIM/
10.7.2.1.2功能
SIM卡接口基本测试。
10.7.2.1.3配置
没有
10.7.2.1.4用例和预期输出

/unit_tests/mxc_sim_test.out
Expected output
atr[0]= 0x3b atr[1]= 0x68 atr[2]= 0x0 atr[3]= 0x0 atr[4]= 0x0 atr[5]= 0x73 atr[6]=
0xc8
atr[7]= 0x40 atr[8]= 0x0 atr[9]= 0x0 atr[10]= 0x90 atr[11]= 0x0
rx[0] = 0x6e rx[1] = 0x0
rx[0] = 0x6d rx[1] = 0x0
rx[0] = 0x6e rx[1] = 0x0

10.7.3 SNVS实时时钟(SRTC)
10.7.3.1测试名称
•autorun-rtc.sh
•rtctest.out
•rtcwakeup.out
10.7.3.1.1位置
/ unit_test / SRTC /
10.7.3.1.2功能
这些测试检查Real Time Clock (RTC)模块,该模块用于保存时间和日期。它提供了一个认证的时间
用户,可以在检测到篡改计数器时发出警报。
10.7.3.1.3配置
为了autorun-rtc.sh, rtctest.out 和rtcwakeup.out能正常工作。在目标板defconfig文件中添加以下行:
CONFIG_RTC_DRV_SNVS = y
10.7.3.1.4用例和预期输出

/autorun-rtc.sh
or
./rtctest.out $lt;arg>
--full run all tests
--no-periodic don't run periodic interrupt tests
or
./rtcwakeup.out -d rtc0 -m mem -s 10
Expected output
autorun-rtc.sh: Exit with PASS results.
rtctest.out: The program ends with "Test complete" status.
rtcwakeup.out: System is wakeup after 10s.

i.MX 7D Sabre SD的预期输出

•autorun-rtc.sh
autorun-rtc.sh
i.MX7D
Checking for devnode: /dev/rtc0
autorun-rtc.sh: PASS devnode found: /dev/rtc0
Running test case: ./rtctest.out --no-periodic
RTC Driver Test Example.
Counting 5 update (1/sec) interrupts from reading /dev/rtc0: 1 2 3 4 5
Again, from using select(2) on /dev/rtc0: 1 2 3 4 5
Current RTC date/time is 21-2-2017, 23:13:07.
Alarm time now set to 23:13:12.
Waiting 5 seconds for alarm... okay. Alarm rang.
*** Test complete ***
Typing "cat /proc/interrupts" will show 1 more events on IRQ rtc.
autorun-rtc.sh: PASS test case: ./rtctest.out --no-periodic
rtc irqs before running unit test: 303
rtc irqs after running unit test: 314
so rtc irqs during test was:
11
checking rtc interrupts PASS
autorun-rtc.sh: Exiting PASS
• rtctest.out --full

./rtctest.out --full
RTC Driver Test Example.
Counting 5 update (1/sec) interrupts from reading /dev/rtc0: 1 2 3 4 5
Again, from using select(2) on /dev/rtc0: 1 2 3 4 5
Current RTC date/time is 21-2-2017, 23:14:48.
Alarm time now set to 23:14:53.
Waiting 5 seconds for alarm... okay. Alarm rang.
Periodic IRQ rate was 1Hz.
Counting 20 interrupts at:
2Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
4Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
8Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
16Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
32Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
64Hz: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
*** Test complete ***
Typing "cat /proc/interrupts" will show 131 more events on IRQ rtc.
• rtctest.out --no-periodic
•
/rtctest.out --no-periodic
RTC Driver Test Example.
Counting 5 update (1/sec) interrupts from reading /dev/rtc0: 1 2 3 4 5
Again, from using select(2) on /dev/rtc0: 1 2 3 4 5
Current RTC date/time is 21-2-2017, 23:16:24.
Alarm time now set to 23:16:29.
Waiting 5 seconds for alarm... okay. Alarm rang.
*** Test complete ***
Typing "cat /proc/interrupts" will show 1 more events on IRQ rtc.
• rtcwakeup.out -d rtc0 -m mem -s 10
•
./rtcwakeup.out -d rtc0 -m mem -s 10
rtcwakeup.out: wakeup from "mem" using rtc0 at Wed Feb 22 23:17:29 2017
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.001 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
Suspending console(s) (use no_console_suspend to debug)
PM: suspend of devices complete after 639.100 msecs
PM: suspend devices took 0.640 seconds
PM: late suspend of devices complete after 1.236 msecs
PM: noirq suspend of devices complete after 1.202 msecs
Disabling non-boot CPUs ...
CPU1: shutdown
Turn off Mega/Fast mix in DSM
Enabling non-boot CPUs ...
CPU1 is up
PM: noirq resume of devices complete after 0.756 msecs
imx-sdma 30bd0000.sdma: loaded firmware 4.2
PM: early resume of devices complete after 0.972 msecs
PM: resume of devices complete after 483.302 msecs
PM: resume devices took 0.480 seconds
Restarting tasks ... done.
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值