Contents |
Blts-v4l2 package is meant to test v4l2 functionality. The blts-v4l2 package tests camera driver functionality by checking e.g. capabilities and controls. There is also tests that stream frames (using XVideo) and take snapshots (saved as JPG pictures) using different resolutions. Some of these test cases also measure FPS rates.
The test cases are:
Current IOCTL coverage for v4l2 tests (experimental and not-in-scope ioctls removed from v4l2 API):
At the moment tests cases are configured to test main and front cameras
Compile blts-v4l2-tests with corresponding environment
$ dpkg-buildpackage
and install package to DUT.
Execute from host end command line:
$ blts-v4l2
Arguments:
| Switch | Function |
|---|---|
| -l | Used log file, Used log file, default blts_v4l2_log |
| -e | Execute single or multiple selected tests, for example -e 1,4,5. |
| -en | Execute test by name, for example -en "My test X" |
| -s | Show list of all tests |
| -? | Help message |
| -nc | Do not output log to terminal |
| Optional switch | Function |
| -p | Print ioctl profiling data |
| -i | Save camera snapshot images to disk in control settings tests, and optionally verify them. Image save path and the verification tool are specified by the image_save_path and image_verify_tool configuration parameters.
|
| -C | Use parameter configuration file |
Test cases must be run with root priviliges.
Test case execution notices:
| Case name | Notice |
|---|---|
| Core-Camera-Open device | |
| Core-Camera-Read device | |
| Core-Camera-Check device controls | |
| Core-Camera-Check device capabilites | |
| Core-Camera-Check device formats | |
| Core-Camera-Measure device stepping down resolution | |
| Core-Camera-Stream from device to screen | |
| Core-Camera-Measure device FPS with defined resolution | |
| Core-Camera-Take picture as JPEG with device | |
| Core-Camera-Device enumeration | |
| Core-Camera-Stream from device and crop corners | |
| Core-Camera-Read from device using poll | |
| Core-Camera-Test standard control settings | |
| Core-Camera-Test extended control settings | |
| Core-Camera-Check device FD priority | |
| Core-Camera-Stream from device and vary frame rate | |
| Core-Camera-Get stream quality setting | |
| Core-Camera-Set stream quality setting to high | |
| Core-Camera-Check debug capability | |
| Core-Camera-Select output and stream | |
| Core-Camera-Select input and stream | |
| Core-Camera-Test input device standards |
To run test case with variable data you need to specify where configuration file is located. You can edit the configuration file yourself.
To run "Core-Camera-Stream from device to screen" case you can use:
blts-v4l2 -l /var/log/tests/Core-Camera-Stream_from_device_to_screen.log -en "Core-Camera-Stream from device to screen" -C example-blts-v4l2.cnf
Example of Stream case variation (example-blts-v4l2.cnf):
# Valid video devices for HW. [parameter] name video_device const "/dev/video0" "/dev/video1" [end_parameter] [parameter] name io_method_stream const "MMAP" "userptr" [end_parameter] # Pixel formats (fourcc, as kernel v4l2 entries) [parameter] name camera_pixel_format const "YUYV" [end_parameter] [parameter] name camera_resolution_stream_all const "4016x3016" "2400x1812" "848x480" "640x480" "320x240" [end_parameter] [test] name "Core-Camera-Stream from device to screen" params video_device camera_pixel_format io_method_stream camera_resolution_stream_all [end_test]
The standard and extended control tests support verification of the camera snapshot image using an external tool. Image verification is enabled by specifying values for the image_save_path and image_verify_tool global configuration parameters, and by giving the -i command line flag when running the test. Once a camera snapshot has been saved for a certain control setting, the tool given in image_verify_tool is run with a command line like this:
verify_tool <snapshot image name> <control name> <V4L2 control id> <control value>
The verification tool should return zero when the image is verified successfully, and a non-zero value when the verification fails. The output of the tool is appended to the log file of the test.
The minimum and maximum values reported by the V4L2 driver can be compared with values specified in the configuration file. The test succeeds if the values match exactly, and fails otherwise. The minimum and maximum values are specified as global configuration parameters, with a special naming format:
dev<number of device>_<escaped control name>_min = <minimum value>
dev<number of device>_<escaped control name>_max = <maximum value>
As the global configuration value identifiers cannot contain spaces or any of the /()[] characters, which may be present in the name of a V4L2 control, the control name must be escaped by replacing spaces with underscores, and by removing any prohibited characters from the name. For example, values for the control named Exposure Time (us) on the device /dev/video0 could be provided like this:
dev0_Exposure_Time_us_min = 1000
dev0_Exposure_Time_us_max = 100000
By default, the control tests use the minimum and maximum values reported by the V4L2 driver to test a control. Additional test values can be provided as global configuration parameters in the configuration file, using a format similar to the min/max format:
dev<number of device>_<escaped control name>_testvalues = "<space-delimited list of values>"
For example:
dev0_Exposure_Time_us_testvalues = "25000 50000 75000"
| linux.bytesex.org | video4linux website |
| www.linuxtv.org | The LinuxTV project website |
| Version | Date | Handled By | Status | Comments |
|---|---|---|---|---|
| 0.1 | 22-sep-2010 | Iekku Huttunen | Draft | Page created |