| 1 |
.TH "V4L2-COMPLIANCE" "1" "March 2015" "v4l-utils @MAN_PACKAGE_VERSION@" "User Commands" |
| 2 |
.SH NAME |
| 3 |
v4l2-compliance - An application to test video4linux drivers |
| 4 |
.SH SYNOPSIS |
| 5 |
.B v4l2-compliance |
| 6 |
[\fI-h\fR] [\fI-d <dev>\fR] [many other options] |
| 7 |
.SH DESCRIPTION |
| 8 |
The v4l2-compliance tool is used to test video4linux devices, either video, vbi, radio |
| 9 |
or swradio, both input and output. It attempts to test almost all aspects of a V4L2 device |
| 10 |
and it covers almost all V4L2 ioctls. It has very good support for video capture and output, |
| 11 |
VBI capture and output and (software) radio tuning and transmitting. |
| 12 |
|
| 13 |
The support for memory-to-memory devices is limited at the moment. |
| 14 |
|
| 15 |
If you have questions about v4l2-compliance then mail those to the [email protected] |
| 16 |
mailinglist. |
| 17 |
|
| 18 |
When testing a driver always compile the utility from the latest source code from the |
| 19 |
git repository (http://git.linuxtv.org/cgit.cgi/v4l-utils.git/). The version supplied |
| 20 |
by linux distributions is almost certainly too old. |
| 21 |
|
| 22 |
In addition, if a test fails then it will output the source and line where the failure |
| 23 |
occurred, so you often need access to the source code to see what that test is all about. |
| 24 |
|
| 25 |
Note that v4l2-compliance not only tests for compliance against the V4L2 API, but also |
| 26 |
whether the driver is using all the correct frameworks. These frameworks often automatically |
| 27 |
provide ioctls that are strictly speaking optional, but that come for free if you use |
| 28 |
those frameworks. By requiring their presence the v4l2-compliance utility will enforce |
| 29 |
their use. |
| 30 |
|
| 31 |
If you want to submit a new V4L2 driver, then that driver must pass the v4l2-compliance |
| 32 |
tests without fails. The best method of using this tool to test your driver is to first |
| 33 |
test without any streaming options and fix any failures from the first reported failure |
| 34 |
to the last. Sometimes earlier failures can generate later failures, so just start fixing |
| 35 |
them in order and test again after each fix. |
| 36 |
|
| 37 |
Next test your driver with the \fB\-s\fR option to do the basic streaming tests. This |
| 38 |
requires that there is a valid input or output. |
| 39 |
|
| 40 |
Whenever you run v4l2-compliance it will save the current driver state and restore it |
| 41 |
after all tests are done (including when you press Ctrl-C). All the streaming tests are |
| 42 |
performed using the saved configuration. This makes it possible to prepare for the streaming |
| 43 |
tests by configuring the device before calling v4l2-compliance. |
| 44 |
|
| 45 |
Finally you should test your driver using the \fB\-f\fR and \fB\-c\fR options to |
| 46 |
verify that all video pixel formats are correctly supported. You need to perform |
| 47 |
all three streaming tests for all inputs and outputs. You can use the \fB\-a\fR option |
| 48 |
to automate that if that is possible for your hardware. |
| 49 |
|
| 50 |
If your driver passes all tests, then your can be confident that your driver is in |
| 51 |
very good shape! |
| 52 |
.SH OPTIONS |
| 53 |
.TP |
| 54 |
\fB\-d\fR, \fB\-\-device\fR \fI<dev>\fR |
| 55 |
Use device \fI<dev>\fR as the video device. If \fI<dev>\fR is a number, then /dev/video\fI<dev>\fR is used. |
| 56 |
Otherwise if \fB-z\fR was specified earlier, then \fI<dev>\fR is the entity name |
| 57 |
or interface ID (if prefixed with 0x) as found in the topology of the media device |
| 58 |
with the bus info string as specified by the \fB-z\fR option. |
| 59 |
.TP |
| 60 |
\fB\-V\fR, \fB\-\-vbi\-device\fR \fI<dev>\fR |
| 61 |
Use device \fI<dev>\fR as the vbi device. If \fI<dev>\fR is a number, then /dev/vbi\fI<dev>\fR is used. |
| 62 |
Otherwise if \fB-z\fR was specified earlier, then \fI<dev>\fR is the entity name |
| 63 |
or interface ID (if prefixed with 0x) as found in the topology of the media device |
| 64 |
with the bus info string as specified by the \fB-z\fR option. |
| 65 |
.TP |
| 66 |
\fB\-r\fR, \fB\-\-radio\-device\fR \fI<dev>\fR |
| 67 |
Use device \fI<dev>\fR as the radio device. If \fI<dev>\fR is a number, then /dev/radio\fI<dev>\fR is used. |
| 68 |
Otherwise if \fB-z\fR was specified earlier, then \fI<dev>\fR is the entity name |
| 69 |
or interface ID (if prefixed with 0x) as found in the topology of the media device |
| 70 |
with the bus info string as specified by the \fB-z\fR option. |
| 71 |
.TP |
| 72 |
\fB\-S\fR, \fB\-\-sdr\-device\fR \fI<dev>\fR |
| 73 |
Use device \fI<dev>\fR as the SDR device. If \fI<dev>\fR is a number, then /dev/swradio\fI<dev>\fR is used. |
| 74 |
Otherwise if \fB-z\fR was specified earlier, then \fI<dev>\fR is the entity name |
| 75 |
or interface ID (if prefixed with 0x) as found in the topology of the media device |
| 76 |
with the bus info string as specified by the \fB-z\fR option. |
| 77 |
.TP |
| 78 |
\fB\-t\fR, \fB\-\-touch\-device\fR \fI<dev>\fR |
| 79 |
Use device \fI<dev>\fR as the touch device. If \fI<dev>\fR is a number, then /dev/v4l-touch\fI<dev>\fR is used. |
| 80 |
Otherwise if \fB-z\fR was specified earlier, then \fI<dev>\fR is the entity name |
| 81 |
or interface ID (if prefixed with 0x) as found in the topology of the media device |
| 82 |
with the bus info string as specified by the \fB-z\fR option. |
| 83 |
.TP |
| 84 |
\fB\-u\fR, \fB\-\-subdev\-device\fR \fI<dev>\fR |
| 85 |
Use device \fI<dev>\fR as the v4l-subdevX device. If \fI<dev>\fR is a number, then /dev/v4l-subdev\fI<dev>\fR is used. |
| 86 |
Otherwise if \fB-z\fR was specified earlier, then \fI<dev>\fR is the entity name |
| 87 |
\fB\-e\fR, \fB\-\-exp\-buf\-device\fR \fI<dev>\fR |
| 88 |
Use device \fI<dev>\fR as the video device used to export DMABUFfers for doing DMABUF |
| 89 |
streaming tests. If \fI<dev>\fR is a number, then /dev/video\fI<dev>\fR is used. |
| 90 |
Otherwise if \fB-z\fR was specified earlier, then \fI<dev>\fR is the entity name |
| 91 |
or interface ID (if prefixed with 0x) as found in the topology of the media device |
| 92 |
with the bus info string as specified by the \fB-z\fR option. |
| 93 |
If this option is not specified, then the DMABUF streaming tests will be skipped. |
| 94 |
.TP |
| 95 |
\fB-z\fR, \fB--media-bus-info\fR \fI<bus-info>\fR |
| 96 |
Find the media device with the given bus info string. If set, then |
| 97 |
the options above can use the entity name or interface ID to refer to the |
| 98 |
device nodes. Example: v4l2-compliance -z platform:vivid-000 -d vivid-000-vid-cap |
| 99 |
.TP |
| 100 |
\fB\-m\fR, \fB\-\-media\-device\fR \fI<dev>\fR |
| 101 |
Use device \fI<dev>\fR as the media controller device. Besides this device it also tests |
| 102 |
all interfaces it finds. If \fI<dev>\fR starts with a digit, then /dev/media\fI<dev>\fR is used. |
| 103 |
If \fI<dev>\fR doesn't exist, then attempt to find a media device with a |
| 104 |
bus info string equal to \fI<dev>\fR. Example: v4l2-compliance -m platform:vivid-000 |
| 105 |
.TP |
| 106 |
\fB\-M\fR, \fB\-\-media\-device\-only\fR \fI<dev>\fR |
| 107 |
Use device \fI<dev>\fR as the media controller device. Only test this device, don't walk |
| 108 |
over all the interfaces. If \fI<dev>\fR starts with a digit, then /dev/media\fI<dev>\fR is used. |
| 109 |
If \fI<dev>\fR doesn't exist, then attempt to find a media device with a |
| 110 |
bus info string equal to \fI<dev>\fR. Example: v4l2-compliance -M platform:vivid-000 |
| 111 |
.TP |
| 112 |
.TP |
| 113 |
\fB\-\-stream\-from\fR \fI[<pixelformat>=]<file>\fR, \fB\-\-stream\-from\-hdr\fR \fI[<pixelformat>=]<file>\fR |
| 114 |
Use the contents of the file to fill in output buffers. |
| 115 |
If the fourcc of the pixelformat is given, then use the file |
| 116 |
for output buffers using that pixelformat only. |
| 117 |
The --stream-from-hdr variant uses the format written by |
| 118 |
v4l2-ctl --stream-to-hdr where the payload sizes for each |
| 119 |
buffer are stored in a header. Useful for compressed formats. |
| 120 |
.TP |
| 121 |
\fB\-s\fR, \fB\-\-streaming\fR \fI<count>\fR |
| 122 |
Enable the streaming tests. Set <count> to the number of frames to stream (default 60). |
| 123 |
This requires that before v4l2-compliance is called the device has been configured with |
| 124 |
a valid input (or output) and frequency (when the device has a tuner). For DMABUF testing |
| 125 |
--expbuf-device needs to be set as well. |
| 126 |
|
| 127 |
The configuration of the driver at the time v4l2-compliance was called |
| 128 |
will be used for the streaming tests. |
| 129 |
.TP |
| 130 |
\fB\-f\fR, \fB\-\-stream\-all\-formats\fR \fI[<count>]\fR |
| 131 |
Test whether all available formats can be streamed. This attempts to stream using |
| 132 |
MMAP mode or read/write (if V4L2_MEMORY_MMAP is not available) for one second for all |
| 133 |
formats, at all sizes, at all intervals and with all field values. In addition, if the |
| 134 |
driver supports scaling, cropping or composing it will test that as well in various |
| 135 |
combinations. If the driver supports a lot of combinations then this test can take |
| 136 |
a long time. If \fI<count>\fR is given, then stream for that many frames instead of |
| 137 |
for one second. |
| 138 |
|
| 139 |
The configuration of the driver at the time v4l2-compliance was called |
| 140 |
will be used for the streaming tests. |
| 141 |
.TP |
| 142 |
\fB\-c\fR, \fB\-\-stream\-all\-color\fR \fBcolor\fR=\fIred|green|blue\fR,\fBskip\fR=\fI<skip>\fR,\fBperc\fR=\fI<perc>\fR |
| 143 |
For all supported, non-compressed formats stream <skip + 1> frames. For the |
| 144 |
last frame go over all pixels and calculate which of the R, G and B color components |
| 145 |
of a pixel has the highest value and count that as a red, green or blue pixel. |
| 146 |
The test succeeds if at least \fIperc\fR percent of the frame has the given \fIcolor\fR. |
| 147 |
This requires that a valid and predominantly red, green or blue video signal is present |
| 148 |
on the input(s). If \fIskip\fR is not specified, then just capture the first frame. A |
| 149 |
non-zero \fIskip\fR value is useful if it takes a few frames for the device to |
| 150 |
calibrate. If \fIperc\fR is not specified, then this defaults to 90%. |
| 151 |
|
| 152 |
Most signal generators are able to generate pure red, blue or green video. For cameras |
| 153 |
you can print a completely red, green or blue picture and hold it before the camera. |
| 154 |
|
| 155 |
The goal of this test is to determine if all pixel formats will interpret the red, |
| 156 |
green and blue colors correctly and that no color components are swapped. |
| 157 |
|
| 158 |
The configuration of the driver at the time v4l2-compliance was called |
| 159 |
will be used for the streaming tests. |
| 160 |
.TP |
| 161 |
\fB\-a\fR, \fB\-\-stream\-all\-io\fR |
| 162 |
Do the \fB\-s\fR, \fB\-c\fR and \fB\-f\fR streaming tests for all inputs or outputs |
| 163 |
instead of just the current input or output. This requires that a valid video |
| 164 |
signal is present on all inputs or that all outputs are hooked up. |
| 165 |
.TP |
| 166 |
\fB\-E\fR, \fB\-\-exit\-on\-fail\fR |
| 167 |
Exit this application when the first failure occurs instead of continuing |
| 168 |
with a possible inconsistent state. |
| 169 |
.TP |
| 170 |
\fB\-C\fR, \fB\-\-color\fR \fI<when>\fR |
| 171 |
Highlight OK/warn/fail/FAIL strings with colors. OK is marked green, warn is |
| 172 |
marked bold, and fail/FAIL are marked bright red if enabled. \fI<when>\fR can |
| 173 |
be \fIalways\fR, \fInever\fR, or \fIauto\fR (the default). |
| 174 |
.TP |
| 175 |
\fB\-n\fR, \fB\-\-no\-warnings\fR |
| 176 |
Turn off warning messages. They are still counted in the summary, but you won't see them. |
| 177 |
.TP |
| 178 |
\fB\-P\fR, \fB\-\-no\-progress\fR |
| 179 |
Turn off progress messages. Useful when redirecting the output to a file. |
| 180 |
.TP |
| 181 |
\fB\-T\fR, \fB\-\-trace\fR |
| 182 |
Trace all called ioctls. |
| 183 |
.TP |
| 184 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 185 |
Turn on verbose reporting. |
| 186 |
.TP |
| 187 |
\fB\-\-version\fR |
| 188 |
Show version information. |
| 189 |
.TP |
| 190 |
\fB\-w\fR, \fB\-\-wrapper\fR |
| 191 |
Use the libv4l2 wrapper library for all V4L2 device accesses. Note that doing this will |
| 192 |
cause some tests to fail because the libv4l2 library isn't fully V4L2 compliant. By |
| 193 |
default v4l2-compliance will bypass libv4l2 and access the V4L2 devices directly. |
| 194 |
.TP |
| 195 |
\fB\-W\fR, \fB\-\-exit\-on\-warn\fR |
| 196 |
Exit this application when the first warning occurs instead of continuing. |
| 197 |
.TP |
| 198 |
\fB\-h\fR, \fB\-\-help\fR |
| 199 |
Prints the help message. |
| 200 |
.SH EXIT STATUS |
| 201 |
On success, it returns 0. Otherwise, it will return the error code. |
| 202 |
.SH BUGS |
| 203 |
This is a work in progress, and every so often it turns out that some tests done by |
| 204 |
v4l2-compliance are too strict or plain wrong. If you suspect that might be the case, |
| 205 |
then report such bugs to the [email protected] mailinglist. |