Meego Wiki
Views

Quality/TestSuite/Camera Driver Test Specification

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
m (Software Coverage)
Line 1: Line 1:
== Introduction ==
== Introduction ==
-
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.
+
 
 +
V4L2 API is a kernel interface for analog radio and video capture and output drivers.
 +
 
 +
Blts-v4l2 package (0.3.8) 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 audio part of the V4L2 API is not in the scope.
 +
 
== Test Coverage ==
== Test Coverage ==
Line 29: Line 33:
===  Software Coverage ===  
===  Software Coverage ===  
-
Current IOCTL coverage for v4l2 tests (experimental and not-in-scope ioctls removed from v4l2 API):  
+
Current IOCTL coverage for v4l2 tests:  
* [[http://gitorious.org/qa-tools/mcts-coverage/blobs/master/V4L2-coverage.ods V4l2-coverage.ods]]
* [[http://gitorious.org/qa-tools/mcts-coverage/blobs/master/V4L2-coverage.ods V4l2-coverage.ods]]
===  Hardware Coverage ===  
===  Hardware Coverage ===  
-
At the moment tests cases are configured to test main and front cameras
+
At the moment test cases are configured to test main and front cameras. The audio functionality of the test device is excluded.
===  Limitations ===  
===  Limitations ===  
Line 43: Line 47:
== Running the tests ==
== Running the tests ==
-
=== Executing tests  ===  
+
=== Hardware setup and test environment ===
 +
 
 +
The test environment must have following packages installed:
 +
;*libbltscommon1
 +
;*libbltspixelformat1
 +
;*libjpeg
 +
;*libX11
 +
;*libXv
 +
 
 +
=== Building packages ===
 +
 
 +
The v4l2 test package comes with a packaging script that can be used to build tarball out of the sources, RPM package or Debian package. To build RPM package, in the root directory execute command:
 +
 
 +
<pre>
 +
./pack.sh -r
 +
</pre>
 +
 
 +
To get packaging script help, execute command:
 +
 
 +
<pre>
 +
./pack.sh -h
 +
</pre>
 +
 
 +
The building environment requires the following RPM packages installed:
 +
;*libbltscommon-devel
 +
;*libbltspixelformat-devel
 +
;*libjpeg-devel
 +
;*libX11-devel
 +
;*libXv-devel
 +
 
 +
 
 +
=== Configuration package ===
 +
 
 +
The blts-v4l2-tests package is dependent on blts-v4l2-tests-config configuration file package. The packaging script pack.sh creates RPM package blts-v4l2-tests-config-example_{version}.rpm and it must be installed first. The configuration file /etc/blts/blts-v4l2-tests.cnf is copied in the test device during RPM installation.  
 +
 
 +
The configuration file package can be installed in the device with a command:
 +
 
 +
<pre>
 +
rpm -ivh blts-v4l2-tests-config-example_{version}.rpm
 +
</pre>
 +
 
 +
=== Test asset specific instructions ===
 +
 
 +
The test package can be installed in the device with a command:
 +
 
 +
<pre>
 +
rpm -ivh blts-v4l2-tests_{version}.rpm
 +
</pre>
 +
 
 +
The control setting test cases support external image verification tool. 
 +
 
 +
'''Image verification'''
 +
 
 +
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 <code>image_save_path</code> and <code>image_verify_tool</code> 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 <code>image_verify_tool</code> is run with a command line like this:
 +
<code>verify_tool <snapshot image name> <control name> <V4L2 control id> <control value></code>
 +
 
 +
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.
 +
 
 +
'''Control value limits and test values'''
 +
 
 +
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:
 +
 
 +
<code>dev<number of device>_<escaped control name>_min = <minimum value></code>
 +
<code>dev<number of device>_<escaped control name>_max = <maximum value></code>
 +
 
 +
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 <code>Exposure Time (us)</code> on the device <code>/dev/video0</code> could be provided like this:
 +
 
 +
<code>dev0_Exposure_Time_us_min = 1000</code>
 +
<code>dev0_Exposure_Time_us_max = 100000</code>
 +
 
 +
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:
 +
 
 +
<code>dev<number of device>_<escaped control name>_testvalues = "<space-delimited list of values>"</code>
 +
 
 +
For example:
 +
 
 +
<code>dev0_Exposure_Time_us_testvalues = "25000 50000 75000"</code>
-
Compile blts-v4l2-tests with corresponding environment <br>
 
-
<code>$ dpkg-buildpackage </code> <br>
 
-
and install package to DUT. <br>
 
-
Execute from host end command line: <br>
 
-
<code>$ blts-v4l2</code>
 
===  Test case arguments ===  
===  Test case arguments ===  
Line 60: Line 135:
|-
|-
-
|| -l  || Used log file, Used log file, default blts_v4l2_log  
+
|| -l  || Used log file, Used log file, default blts_v4l2_log.txt
|-
|-
|| -e || Execute single or multiple selected tests, for example -e 1,4,5.  
|| -e || Execute single or multiple selected tests, for example -e 1,4,5.  
Line 67: Line 142:
|-
|-
|| -s || Show list of all tests  
|| -s || Show list of all tests  
 +
|-
 +
|| -C || Used configuration file and path, for example /etc/blts/blts-v4l2-tests.cnf
|-
|-
|| -? || Help message   
|| -? || Help message   
|-
|-
-
|| -nc || Do not output log to terminal
+
|| -xml, -axml || Create result XML. -axml appends results to an existing XML file.
 +
|-
 +
|| -auto || Silent logging for test automation. Only the results are printed to stdout.
|-  
|-  
 +
|| -v || Verbose logging (default)
 +
|-
 +
|| -vv || Even more verbose logging
 +
|- 
!|Optional switch  
!|Optional switch  
!|Function  
!|Function  
Line 78: Line 161:
|-
|-
|| -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 <code>image_save_path</code> and <code>image_verify_tool</code> configuration parameters.  
|| -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 <code>image_save_path</code> and <code>image_verify_tool</code> configuration parameters.  
-
|-
 
-
|| -C || Use parameter configuration file
 
|}
|}
-
Test cases must be run with root priviliges.  
+
Test cases must be run with root privileges.  
===  Test cases ===  
===  Test cases ===  
Line 114: Line 195:
||  Core-Camera-Read from device using poll  ||   
||  Core-Camera-Read from device using poll  ||   
|-
|-
-
||  Core-Camera-Test standard control settings  ||  
+
||  Core-Camera-Test standard control settings  || supports external image verification tool 
|-
|-
-
|| Core-Camera-Test extended control settings  ||
+
|| Core-Camera-Test extended control settings  || supports external image verification tool
|-
|-
||  Core-Camera-Check device FD priority  ||   
||  Core-Camera-Check device FD priority  ||   
Line 126: Line 207:
||  Core-Camera-Set stream quality setting to high  ||   
||  Core-Camera-Set stream quality setting to high  ||   
|-
|-
-
||  Core-Camera-Check debug capability  ||  
+
||  Core-Camera-Check debug capability  || not necessary supported by driver
|-
|-
|| Core-Camera-Select output and stream  ||   
|| Core-Camera-Select output and stream  ||   
Line 135: Line 216:
|}
|}
-
===  Test cases with variables ===  
+
 
-
To run test case with variable data you need to specify where configuration file is located. You can edit the configuration file yourself.  
+
'''Test case descriptions and execution commands:'''
 +
 
 +
;* Core-Camera-Open device
 +
: * Try to open a V4L2 device
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Open device"</code>
 +
 
 +
;* Core-Camera-Read device
 +
: * Open V4L2 device to requested width and height
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Read device"</code>
 +
 
 +
;* Core-Camera-Check device controls
 +
: * Enumerate through V4L2 device controls
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Check device controls"</code>
 +
 
 +
;* Core-Camera-Check device capabilites
 +
: * Check and print V4L2 device capabilities
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Check device capabilites"</code>
 +
 
 +
;* Core-Camera-Check device formats
 +
: * Enumerate and print V4L2 device formats
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Check device formats"</code>
 +
 
 +
;* Core-Camera-Measure device stepping down resolution
 +
: * Step down resolutions and calculate FPS using V4L2 device
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Measure device stepping down resolution"</code>
 +
 
 +
;* Core-Camera-Stream from device to screen
 +
: * Stream frames from V4L2 device to screen using XVideo
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Stream from device to screen"</code>
 +
 
 +
;* Core-Camera-Measure device FPS with defined resolution
 +
: * Use a given resolution and calculate FPS using V4L2 device
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Measure device FPS with defined resolution"</code>
 +
 
 +
;* Core-Camera-Take picture as JPEG with device
 +
: * Take one frame from V4L2 device and create a JPG file
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Take picture as JPEG with device"</code>
 +
 
 +
;* Core-Camera-Device enumeration
 +
: * Enumerate V4L2 input and output devices and print supported standards
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Device enumeration"</code>
 +
 
 +
;* Core-Camera-Stream from device and crop corners
 +
: * Stream frames from V4L2 device to screen using XVideo and use cropping
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Stream from device and crop corners"</code>
 +
 
 +
;* Core-Camera-Read from device using poll
 +
: * Read/stream frames from device as with measure device FPS case, but use
 +
: * poll() instead of select() to find out when the device is ready.
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Read from device using poll"</code>
 +
 
 +
;* Core-Camera-Test standard control settings
 +
: * Enumerate all standard controls, and test each available control with
 +
: * min/max values and any configured values.
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Test standard control settings"</code>
 +
 
 +
;* Core-Camera-Test extended control settings
 +
: * Enumerate all extended controls, and test each available control with
 +
: * min/max values and any configured values.
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Test extended control settings"</code>
 +
 
 +
;* Core-Camera-Check device FD priority
 +
: * Init a device and check if it supports priorities - VIDIOC_G_PRIORITY
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Check device FD priority"</code>
 +
 
 +
;* Core-Camera-Stream from device and vary frame rate
 +
: * Stream frames from V4L2 device to screen using default frame rate and
 +
: * calculate FPS, change frame rate and repeat streaming to compare FPS values.
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Stream from device and vary frame rate"</code>
 +
 
 +
;* Core-Camera-Get stream quality setting
 +
: * Stream frames from V4L2 device and get a default quality setting
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Get stream quality setting"</code>
 +
 
 +
;* Core-Camera-Set stream quality setting to high
 +
: * Stream frames from V4L2 device, set stream quality setting to high, stream from the device and check that high setting is used
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Set stream quality setting to high"</code>
 +
 
 +
;* Core-Camera-Check debug capability
 +
: * Requests the driver to dump current state to kernel log. This API
 +
: * call is specified so that driver doesn't have to support this.
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Check debug capability"</code>
 +
 
 +
;* Core-Camera-Select input and stream
 +
: * Tries different inputs and streams from those to the screen.
 +
: * If no input available with device this test will force test - VIDIOC_S_INPUT
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Select input and stream"</code>
 +
 +
;* Core-Camera-Select output and stream
 +
: * Tries different outputs of device.
 +
: * If no output available with device this test will force test - VIDIOC_S_OUTPUT
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Select output and stream"</code>
 +
 
 +
;* Core-Camera-Test input device standards
 +
: * Loops through V4L2 input devices and tries to get current video standard,
 +
: * then enumerates and sets supported standards one by one.
 +
: * <code>$ blts-v4l2-tests -en "Core-Camera-Test input device standards"</code>
 +
 
 +
===  Configuration file examples ===  
 +
To run test case with variable data you need to specify where configuration file is located or if no configuration file is given, test driver tries to use default /etc/blts/blts-v4l2-tests.cnf
 +
 
 +
Edit the configuration file yourself if necessary.  
 +
 
To run "Core-Camera-Stream from device to screen" case you can use:  
To run "Core-Camera-Stream from device to screen" case you can use:  
<code>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 </code>
<code>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 </code>
Line 171: Line 354:
</pre>
</pre>
-
===  Control test configuration ===
 
-
 
-
==== Image verification ====
 
-
 
-
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 <code>image_save_path</code> and <code>image_verify_tool</code> 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 <code>image_verify_tool</code> is run with a command line like this:
 
-
<code>verify_tool <snapshot image name> <control name> <V4L2 control id> <control value></code>
 
-
 
-
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.
 
-
 
-
==== Control value limits and test values ====
 
-
 
-
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:
 
-
 
-
<code>dev<number of device>_<escaped control name>_min = <minimum value></code>
 
-
<code>dev<number of device>_<escaped control name>_max = <maximum value></code>
 
-
 
-
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 <code>Exposure Time (us)</code> on the device <code>/dev/video0</code> could be provided like this:
 
-
 
-
<code>dev0_Exposure_Time_us_min = 1000</code>
 
-
<code>dev0_Exposure_Time_us_max = 100000</code>
 
-
 
-
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:
 
-
 
-
<code>dev<number of device>_<escaped control name>_testvalues = "<space-delimited list of values>"</code>
 
-
 
-
For example:
 
-
 
-
<code>dev0_Exposure_Time_us_testvalues = "25000 50000 75000"</code>
 
== Module Design and Architecture ==
== Module Design and Architecture ==
Line 222: Line 377:
|-
|-
|| 0.1 || 22-sep-2010 || [mailto:ext-iekku.huttunen@nokia.com Iekku Huttunen] || Draft || Page created
|| 0.1 || 22-sep-2010 || [mailto:ext-iekku.huttunen@nokia.com Iekku Huttunen] || Draft || Page created
 +
|-
 +
|| 0.2 || 8-Dec-2010 || [mailto:aki.nyman@digia.com Aki Nyman] || Draft || Documentation updated to refer blts-v4l2 test package 0.3.8
|}
|}

Revision as of 07:46, 8 December 2010

Contents

Introduction

V4L2 API is a kernel interface for analog radio and video capture and output drivers.

Blts-v4l2 package (0.3.8) 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 audio part of the V4L2 API is not in the scope.


Test Coverage

The test cases are:

  • Core-Camera-Open device: Try to open a V4L2 device
  • Core-Camera-Read device: Open V4L2 device to requested width and height
  • Core-Camera-Check device controls: Enumerate through V4L2 device controls
  • Core-Camera-Check device capabilites: Check and print V4L2 device capabilities
  • Core-Camera-Check device formats: Enumerate and print V4L2 device formats
  • Core-Camera-Measure device stepping down resolution: Step down resolutions and calculate FPS using V4L2 device
  • Core-Camera-Stream from device to screen: Stream frames from V4L2 device to screen using XVideo
  • Core-Camera-Measure device FPS with defined resolution: Use a given resolution and calculate FPS using V4L2 device
  • Core-Camera-Take picture as JPEG with device: Take one frame from V4L2 device and create a JPG file
  • Core-Camera-Device enumeration: Enumerate V4L2 input and output devices and print supported standards
  • Core-Camera-Stream from device and crop corners: Stream frames from V4L2 device to screen using XVideo and use cropping
  • Core-Camera-Read from device using poll: As "Measure device FPS", but use poll() to detect device readiness.
  • Core-Camera-Test standard control settings: Enumerate all standard controls, and test each available control with suitable values
  • Core-Camera-Test extended control settings: Enumerate all extended controls, and test each available control with suitable values
  • Core-Camera-Check device FD priority: Init a device and check if it supports priorities
  • Core-Camera-Stream from device and vary frame rate: Stream frames from V4L2 device to screen and vary frame rates and calculate FPS
  • Core-Camera-Get stream quality setting: Stream frames from V4L2 and get the quality setting
  • Core-Camera-Set stream quality setting to high: Set stream quality setting to high, stream from the device and check the setting is used
  • Core-Camera-Check debug capability: Get state from driver to kernel log, API function doesn't need to be supported
  • Core-Camera-Select output and stream: Selects and tests possible outputs of device
  • Core-Camera-Select input and stream: Selects and tests possible inputs of device.
  • Core-Camera-Test input device standards: Loops through V4L2 input devices and tests video standards

Software Coverage

Current IOCTL coverage for v4l2 tests:

Hardware Coverage

At the moment test cases are configured to test main and front cameras. The audio functionality of the test device is excluded.

Limitations

  • Test suite functionality depends on implementation of used device driver in v4l2.

Future Improvements

  • More coverage with tests for v4l2.

Running the tests

Hardware setup and test environment

The test environment must have following packages installed:

  • libbltscommon1
  • libbltspixelformat1
  • libjpeg
  • libX11
  • libXv

Building packages

The v4l2 test package comes with a packaging script that can be used to build tarball out of the sources, RPM package or Debian package. To build RPM package, in the root directory execute command:

./pack.sh -r

To get packaging script help, execute command:

./pack.sh -h

The building environment requires the following RPM packages installed:

  • libbltscommon-devel
  • libbltspixelformat-devel
  • libjpeg-devel
  • libX11-devel
  • libXv-devel


Configuration package

The blts-v4l2-tests package is dependent on blts-v4l2-tests-config configuration file package. The packaging script pack.sh creates RPM package blts-v4l2-tests-config-example_{version}.rpm and it must be installed first. The configuration file /etc/blts/blts-v4l2-tests.cnf is copied in the test device during RPM installation.

The configuration file package can be installed in the device with a command:

rpm -ivh blts-v4l2-tests-config-example_{version}.rpm

Test asset specific instructions

The test package can be installed in the device with a command:

rpm -ivh blts-v4l2-tests_{version}.rpm 

The control setting test cases support external image verification tool.

Image verification

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.

Control value limits and test values

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"


Test case arguments

Arguments:

Switch Function
-l Used log file, Used log file, default blts_v4l2_log.txt
-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
-C Used configuration file and path, for example /etc/blts/blts-v4l2-tests.cnf
-? Help message
-xml, -axml Create result XML. -axml appends results to an existing XML file.
-auto Silent logging for test automation. Only the results are printed to stdout.
-v Verbose logging (default)
-vv Even more verbose logging
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.

Test cases must be run with root privileges.

Test cases

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 supports external image verification tool
Core-Camera-Test extended control settings supports external image verification tool
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 not necessary supported by driver
Core-Camera-Select output and stream
Core-Camera-Select input and stream
Core-Camera-Test input device standards


Test case descriptions and execution commands:

  • Core-Camera-Open device
* Try to open a V4L2 device
* $ blts-v4l2-tests -en "Core-Camera-Open device"
  • Core-Camera-Read device
* Open V4L2 device to requested width and height
* $ blts-v4l2-tests -en "Core-Camera-Read device"
  • Core-Camera-Check device controls
* Enumerate through V4L2 device controls
* $ blts-v4l2-tests -en "Core-Camera-Check device controls"
  • Core-Camera-Check device capabilites
* Check and print V4L2 device capabilities
* $ blts-v4l2-tests -en "Core-Camera-Check device capabilites"
  • Core-Camera-Check device formats
* Enumerate and print V4L2 device formats
* $ blts-v4l2-tests -en "Core-Camera-Check device formats"
  • Core-Camera-Measure device stepping down resolution
* Step down resolutions and calculate FPS using V4L2 device
* $ blts-v4l2-tests -en "Core-Camera-Measure device stepping down resolution"
  • Core-Camera-Stream from device to screen
* Stream frames from V4L2 device to screen using XVideo
* $ blts-v4l2-tests -en "Core-Camera-Stream from device to screen"
  • Core-Camera-Measure device FPS with defined resolution
* Use a given resolution and calculate FPS using V4L2 device
* $ blts-v4l2-tests -en "Core-Camera-Measure device FPS with defined resolution"
  • Core-Camera-Take picture as JPEG with device
* Take one frame from V4L2 device and create a JPG file
* $ blts-v4l2-tests -en "Core-Camera-Take picture as JPEG with device"
  • Core-Camera-Device enumeration
* Enumerate V4L2 input and output devices and print supported standards
* $ blts-v4l2-tests -en "Core-Camera-Device enumeration"
  • Core-Camera-Stream from device and crop corners
* Stream frames from V4L2 device to screen using XVideo and use cropping
* $ blts-v4l2-tests -en "Core-Camera-Stream from device and crop corners"
  • Core-Camera-Read from device using poll
* Read/stream frames from device as with measure device FPS case, but use
* poll() instead of select() to find out when the device is ready.
* $ blts-v4l2-tests -en "Core-Camera-Read from device using poll"
  • Core-Camera-Test standard control settings
* Enumerate all standard controls, and test each available control with
* min/max values and any configured values.
* $ blts-v4l2-tests -en "Core-Camera-Test standard control settings"
  • Core-Camera-Test extended control settings
* Enumerate all extended controls, and test each available control with
* min/max values and any configured values.
* $ blts-v4l2-tests -en "Core-Camera-Test extended control settings"
  • Core-Camera-Check device FD priority
* Init a device and check if it supports priorities - VIDIOC_G_PRIORITY
* $ blts-v4l2-tests -en "Core-Camera-Check device FD priority"
  • Core-Camera-Stream from device and vary frame rate
* Stream frames from V4L2 device to screen using default frame rate and
* calculate FPS, change frame rate and repeat streaming to compare FPS values.
* $ blts-v4l2-tests -en "Core-Camera-Stream from device and vary frame rate"
  • Core-Camera-Get stream quality setting
* Stream frames from V4L2 device and get a default quality setting
* $ blts-v4l2-tests -en "Core-Camera-Get stream quality setting"
  • Core-Camera-Set stream quality setting to high
* Stream frames from V4L2 device, set stream quality setting to high, stream from the device and check that high setting is used
* $ blts-v4l2-tests -en "Core-Camera-Set stream quality setting to high"
  • Core-Camera-Check debug capability
* Requests the driver to dump current state to kernel log. This API
* call is specified so that driver doesn't have to support this.
* $ blts-v4l2-tests -en "Core-Camera-Check debug capability"
  • Core-Camera-Select input and stream
* Tries different inputs and streams from those to the screen.
* If no input available with device this test will force test - VIDIOC_S_INPUT
* $ blts-v4l2-tests -en "Core-Camera-Select input and stream"
  • Core-Camera-Select output and stream
* Tries different outputs of device.
* If no output available with device this test will force test - VIDIOC_S_OUTPUT
* $ blts-v4l2-tests -en "Core-Camera-Select output and stream"
  • Core-Camera-Test input device standards
* Loops through V4L2 input devices and tries to get current video standard,
* then enumerates and sets supported standards one by one.
* $ blts-v4l2-tests -en "Core-Camera-Test input device standards"

Configuration file examples

To run test case with variable data you need to specify where configuration file is located or if no configuration file is given, test driver tries to use default /etc/blts/blts-v4l2-tests.cnf

Edit the configuration file yourself if necessary.

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]


Module Design and Architecture

Architecture diagram

References

linux.bytesex.org video4linux website
www.linuxtv.org The LinuxTV project website

Change History

Version Date Handled By Status Comments
0.1 22-sep-2010 Iekku Huttunen Draft Page created
0.2 8-Dec-2010 Aki Nyman Draft Documentation updated to refer blts-v4l2 test package 0.3.8
Personal tools