V4L2-COMPLIANCE(1) | User Commands | V4L2-COMPLIANCE(1) |
v4l2-compliance - An application to test video4linux drivers
v4l2-compliance [-h] [-d <dev>] [-r <dev>] [-V <dev>] [-S <dev>] [-e <dev>] [-s <count>] [-f] [-a] [-c color=<color>,skip=<skip>,perc=<perc>] [-n] [-T] [-v] [-w]
The v4l2-compliance tool is used to test video4linux devices, either video, vbi, radio or swradio, both input and output. It attempts to test almost all aspects of a V4L2 device and it covers almost all V4L2 ioctls. It has very good support for video capture and output, VBI capture and output and (software) radio tuning and transmitting.
The support for memory-to-memory devices is limited at the moment.
If you have questions about v4l2-compliance then mail those to the linux-media@vger.kernel.org mailinglist.
When testing a driver always compile the utility from the latest source code from the git repository (http://git.linuxtv.org/cgit.cgi/v4l-utils.git/). The version supplied by linux distributions is almost certainly too old.
In addition, if a test fails then it will output the source and line where the failure occurred, so you often need access to the source code to see what that test is all about.
Note that v4l2-compliance not only tests for compliance against the V4L2 API, but also whether the driver is using all the correct frameworks. These frameworks often automatically provide ioctls that are strictly speaking optional, but that come for free if you use those frameworks. By requiring their presence the v4l2-compliance utility will enforce their use.
If you want to submit a new V4L2 driver, then that driver must pass the v4l2-compliance tests without fails. The best method of using this tool to test your driver is to first test without any streaming options and fix any failures from the first reported failure to the last. Sometimes earlier failures can generate later failures, so just start fixing them in order and test again after each fix.
Next test your driver with the -s option to do the basic streaming tests. This requires that there is a valid input or output.
Whenever you run v4l2-compliance it will save the current driver state and restore it after all tests are done (including when you press Ctrl-C). All the streaming tests are performed using the saved configuration. This makes it possible to prepare for the streaming tests by configuring the device before calling v4l2-compliance.
Finally you should test your driver using the -f and -c options to verify that all video pixel formats are correctly supported. You need to perform all three streaming tests for all inputs and outputs. You can use the -a option to automate that if that is possible for your hardware.
If your driver passes all tests, then your can be confident that your driver is in very good shape!
The configuration of the driver at the time v4l2-compliance was called will be used for the streaming tests.
The configuration of the driver at the time v4l2-compliance was called will be used for the streaming tests.
Most signal generators are able to generate pure red, blue or green video. For cameras you can print a completely red, green or blue picture and hold it before the camera.
The goal of this test is to determine if all pixel formats will interpret the red, green and blue colors correctly and that no color components are swapped.
The configuration of the driver at the time v4l2-compliance was called will be used for the streaming tests.
On success, it returns 0. Otherwise, it will return the error code.
This is a work in progress, and every so often it turns out that some tests done by v4l2-compliance are too strict or plain wrong. If you suspect that might be the case, then report such bugs to the linux-media@vger.kernel.org mailinglist.
March 2015 | v4l-utils 1.16.3 |