vivid.rst 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329
  1. The Virtual Video Test Driver (vivid)
  2. =====================================
  3. This driver emulates video4linux hardware of various types: video capture, video
  4. output, vbi capture and output, radio receivers and transmitters and a software
  5. defined radio receiver. In addition a simple framebuffer device is available for
  6. testing capture and output overlays.
  7. Up to 64 vivid instances can be created, each with up to 16 inputs and 16 outputs.
  8. Each input can be a webcam, TV capture device, S-Video capture device or an HDMI
  9. capture device. Each output can be an S-Video output device or an HDMI output
  10. device.
  11. These inputs and outputs act exactly as a real hardware device would behave. This
  12. allows you to use this driver as a test input for application development, since
  13. you can test the various features without requiring special hardware.
  14. This document describes the features implemented by this driver:
  15. - Support for read()/write(), MMAP, USERPTR and DMABUF streaming I/O.
  16. - A large list of test patterns and variations thereof
  17. - Working brightness, contrast, saturation and hue controls
  18. - Support for the alpha color component
  19. - Full colorspace support, including limited/full RGB range
  20. - All possible control types are present
  21. - Support for various pixel aspect ratios and video aspect ratios
  22. - Error injection to test what happens if errors occur
  23. - Supports crop/compose/scale in any combination for both input and output
  24. - Can emulate up to 4K resolutions
  25. - All Field settings are supported for testing interlaced capturing
  26. - Supports all standard YUV and RGB formats, including two multiplanar YUV formats
  27. - Raw and Sliced VBI capture and output support
  28. - Radio receiver and transmitter support, including RDS support
  29. - Software defined radio (SDR) support
  30. - Capture and output overlay support
  31. These features will be described in more detail below.
  32. Configuring the driver
  33. ----------------------
  34. By default the driver will create a single instance that has a video capture
  35. device with webcam, TV, S-Video and HDMI inputs, a video output device with
  36. S-Video and HDMI outputs, one vbi capture device, one vbi output device, one
  37. radio receiver device, one radio transmitter device and one SDR device.
  38. The number of instances, devices, video inputs and outputs and their types are
  39. all configurable using the following module options:
  40. - n_devs:
  41. number of driver instances to create. By default set to 1. Up to 64
  42. instances can be created.
  43. - node_types:
  44. which devices should each driver instance create. An array of
  45. hexadecimal values, one for each instance. The default is 0x1d3d.
  46. Each value is a bitmask with the following meaning:
  47. - bit 0: Video Capture node
  48. - bit 2-3: VBI Capture node: 0 = none, 1 = raw vbi, 2 = sliced vbi, 3 = both
  49. - bit 4: Radio Receiver node
  50. - bit 5: Software Defined Radio Receiver node
  51. - bit 8: Video Output node
  52. - bit 10-11: VBI Output node: 0 = none, 1 = raw vbi, 2 = sliced vbi, 3 = both
  53. - bit 12: Radio Transmitter node
  54. - bit 16: Framebuffer for testing overlays
  55. So to create four instances, the first two with just one video capture
  56. device, the second two with just one video output device you would pass
  57. these module options to vivid:
  58. .. code-block:: none
  59. n_devs=4 node_types=0x1,0x1,0x100,0x100
  60. - num_inputs:
  61. the number of inputs, one for each instance. By default 4 inputs
  62. are created for each video capture device. At most 16 inputs can be created,
  63. and there must be at least one.
  64. - input_types:
  65. the input types for each instance, the default is 0xe4. This defines
  66. what the type of each input is when the inputs are created for each driver
  67. instance. This is a hexadecimal value with up to 16 pairs of bits, each
  68. pair gives the type and bits 0-1 map to input 0, bits 2-3 map to input 1,
  69. 30-31 map to input 15. Each pair of bits has the following meaning:
  70. - 00: this is a webcam input
  71. - 01: this is a TV tuner input
  72. - 10: this is an S-Video input
  73. - 11: this is an HDMI input
  74. So to create a video capture device with 8 inputs where input 0 is a TV
  75. tuner, inputs 1-3 are S-Video inputs and inputs 4-7 are HDMI inputs you
  76. would use the following module options:
  77. .. code-block:: none
  78. num_inputs=8 input_types=0xffa9
  79. - num_outputs:
  80. the number of outputs, one for each instance. By default 2 outputs
  81. are created for each video output device. At most 16 outputs can be
  82. created, and there must be at least one.
  83. - output_types:
  84. the output types for each instance, the default is 0x02. This defines
  85. what the type of each output is when the outputs are created for each
  86. driver instance. This is a hexadecimal value with up to 16 bits, each bit
  87. gives the type and bit 0 maps to output 0, bit 1 maps to output 1, bit
  88. 15 maps to output 15. The meaning of each bit is as follows:
  89. - 0: this is an S-Video output
  90. - 1: this is an HDMI output
  91. So to create a video output device with 8 outputs where outputs 0-3 are
  92. S-Video outputs and outputs 4-7 are HDMI outputs you would use the
  93. following module options:
  94. .. code-block:: none
  95. num_outputs=8 output_types=0xf0
  96. - vid_cap_nr:
  97. give the desired videoX start number for each video capture device.
  98. The default is -1 which will just take the first free number. This allows
  99. you to map capture video nodes to specific videoX device nodes. Example:
  100. .. code-block:: none
  101. n_devs=4 vid_cap_nr=2,4,6,8
  102. This will attempt to assign /dev/video2 for the video capture device of
  103. the first vivid instance, video4 for the next up to video8 for the last
  104. instance. If it can't succeed, then it will just take the next free
  105. number.
  106. - vid_out_nr:
  107. give the desired videoX start number for each video output device.
  108. The default is -1 which will just take the first free number.
  109. - vbi_cap_nr:
  110. give the desired vbiX start number for each vbi capture device.
  111. The default is -1 which will just take the first free number.
  112. - vbi_out_nr:
  113. give the desired vbiX start number for each vbi output device.
  114. The default is -1 which will just take the first free number.
  115. - radio_rx_nr:
  116. give the desired radioX start number for each radio receiver device.
  117. The default is -1 which will just take the first free number.
  118. - radio_tx_nr:
  119. give the desired radioX start number for each radio transmitter
  120. device. The default is -1 which will just take the first free number.
  121. - sdr_cap_nr:
  122. give the desired swradioX start number for each SDR capture device.
  123. The default is -1 which will just take the first free number.
  124. - ccs_cap_mode:
  125. specify the allowed video capture crop/compose/scaling combination
  126. for each driver instance. Video capture devices can have any combination
  127. of cropping, composing and scaling capabilities and this will tell the
  128. vivid driver which of those is should emulate. By default the user can
  129. select this through controls.
  130. The value is either -1 (controlled by the user) or a set of three bits,
  131. each enabling (1) or disabling (0) one of the features:
  132. - bit 0:
  133. Enable crop support. Cropping will take only part of the
  134. incoming picture.
  135. - bit 1:
  136. Enable compose support. Composing will copy the incoming
  137. picture into a larger buffer.
  138. - bit 2:
  139. Enable scaling support. Scaling can scale the incoming
  140. picture. The scaler of the vivid driver can enlarge up
  141. or down to four times the original size. The scaler is
  142. very simple and low-quality. Simplicity and speed were
  143. key, not quality.
  144. Note that this value is ignored by webcam inputs: those enumerate
  145. discrete framesizes and that is incompatible with cropping, composing
  146. or scaling.
  147. - ccs_out_mode:
  148. specify the allowed video output crop/compose/scaling combination
  149. for each driver instance. Video output devices can have any combination
  150. of cropping, composing and scaling capabilities and this will tell the
  151. vivid driver which of those is should emulate. By default the user can
  152. select this through controls.
  153. The value is either -1 (controlled by the user) or a set of three bits,
  154. each enabling (1) or disabling (0) one of the features:
  155. - bit 0:
  156. Enable crop support. Cropping will take only part of the
  157. outgoing buffer.
  158. - bit 1:
  159. Enable compose support. Composing will copy the incoming
  160. buffer into a larger picture frame.
  161. - bit 2:
  162. Enable scaling support. Scaling can scale the incoming
  163. buffer. The scaler of the vivid driver can enlarge up
  164. or down to four times the original size. The scaler is
  165. very simple and low-quality. Simplicity and speed were
  166. key, not quality.
  167. - multiplanar:
  168. select whether each device instance supports multi-planar formats,
  169. and thus the V4L2 multi-planar API. By default device instances are
  170. single-planar.
  171. This module option can override that for each instance. Values are:
  172. - 1: this is a single-planar instance.
  173. - 2: this is a multi-planar instance.
  174. - vivid_debug:
  175. enable driver debugging info
  176. - no_error_inj:
  177. if set disable the error injecting controls. This option is
  178. needed in order to run a tool like v4l2-compliance. Tools like that
  179. exercise all controls including a control like 'Disconnect' which
  180. emulates a USB disconnect, making the device inaccessible and so
  181. all tests that v4l2-compliance is doing will fail afterwards.
  182. There may be other situations as well where you want to disable the
  183. error injection support of vivid. When this option is set, then the
  184. controls that select crop, compose and scale behavior are also
  185. removed. Unless overridden by ccs_cap_mode and/or ccs_out_mode the
  186. will default to enabling crop, compose and scaling.
  187. - allocators:
  188. memory allocator selection, default is 0. It specifies the way buffers
  189. will be allocated.
  190. - 0: vmalloc
  191. - 1: dma-contig
  192. Taken together, all these module options allow you to precisely customize
  193. the driver behavior and test your application with all sorts of permutations.
  194. It is also very suitable to emulate hardware that is not yet available, e.g.
  195. when developing software for a new upcoming device.
  196. Video Capture
  197. -------------
  198. This is probably the most frequently used feature. The video capture device
  199. can be configured by using the module options num_inputs, input_types and
  200. ccs_cap_mode (see section 1 for more detailed information), but by default
  201. four inputs are configured: a webcam, a TV tuner, an S-Video and an HDMI
  202. input, one input for each input type. Those are described in more detail
  203. below.
  204. Special attention has been given to the rate at which new frames become
  205. available. The jitter will be around 1 jiffie (that depends on the HZ
  206. configuration of your kernel, so usually 1/100, 1/250 or 1/1000 of a second),
  207. but the long-term behavior is exactly following the framerate. So a
  208. framerate of 59.94 Hz is really different from 60 Hz. If the framerate
  209. exceeds your kernel's HZ value, then you will get dropped frames, but the
  210. frame/field sequence counting will keep track of that so the sequence
  211. count will skip whenever frames are dropped.
  212. Webcam Input
  213. ~~~~~~~~~~~~
  214. The webcam input supports three framesizes: 320x180, 640x360 and 1280x720. It
  215. supports frames per second settings of 10, 15, 25, 30, 50 and 60 fps. Which ones
  216. are available depends on the chosen framesize: the larger the framesize, the
  217. lower the maximum frames per second.
  218. The initially selected colorspace when you switch to the webcam input will be
  219. sRGB.
  220. TV and S-Video Inputs
  221. ~~~~~~~~~~~~~~~~~~~~~
  222. The only difference between the TV and S-Video input is that the TV has a
  223. tuner. Otherwise they behave identically.
  224. These inputs support audio inputs as well: one TV and one Line-In. They
  225. both support all TV standards. If the standard is queried, then the Vivid
  226. controls 'Standard Signal Mode' and 'Standard' determine what
  227. the result will be.
  228. These inputs support all combinations of the field setting. Special care has
  229. been taken to faithfully reproduce how fields are handled for the different
  230. TV standards. This is particularly noticeable when generating a horizontally
  231. moving image so the temporal effect of using interlaced formats becomes clearly
  232. visible. For 50 Hz standards the top field is the oldest and the bottom field
  233. is the newest in time. For 60 Hz standards that is reversed: the bottom field
  234. is the oldest and the top field is the newest in time.
  235. When you start capturing in V4L2_FIELD_ALTERNATE mode the first buffer will
  236. contain the top field for 50 Hz standards and the bottom field for 60 Hz
  237. standards. This is what capture hardware does as well.
  238. Finally, for PAL/SECAM standards the first half of the top line contains noise.
  239. This simulates the Wide Screen Signal that is commonly placed there.
  240. The initially selected colorspace when you switch to the TV or S-Video input
  241. will be SMPTE-170M.
  242. The pixel aspect ratio will depend on the TV standard. The video aspect ratio
  243. can be selected through the 'Standard Aspect Ratio' Vivid control.
  244. Choices are '4x3', '16x9' which will give letterboxed widescreen video and
  245. '16x9 Anamorphic' which will give full screen squashed anamorphic widescreen
  246. video that will need to be scaled accordingly.
  247. The TV 'tuner' supports a frequency range of 44-958 MHz. Channels are available
  248. every 6 MHz, starting from 49.25 MHz. For each channel the generated image
  249. will be in color for the +/- 0.25 MHz around it, and in grayscale for
  250. +/- 1 MHz around the channel. Beyond that it is just noise. The VIDIOC_G_TUNER
  251. ioctl will return 100% signal strength for +/- 0.25 MHz and 50% for +/- 1 MHz.
  252. It will also return correct afc values to show whether the frequency is too
  253. low or too high.
  254. The audio subchannels that are returned are MONO for the +/- 1 MHz range around
  255. a valid channel frequency. When the frequency is within +/- 0.25 MHz of the
  256. channel it will return either MONO, STEREO, either MONO | SAP (for NTSC) or
  257. LANG1 | LANG2 (for others), or STEREO | SAP.
  258. Which one is returned depends on the chosen channel, each next valid channel
  259. will cycle through the possible audio subchannel combinations. This allows
  260. you to test the various combinations by just switching channels..
  261. Finally, for these inputs the v4l2_timecode struct is filled in in the
  262. dequeued v4l2_buffer struct.
  263. HDMI Input
  264. ~~~~~~~~~~
  265. The HDMI inputs supports all CEA-861 and DMT timings, both progressive and
  266. interlaced, for pixelclock frequencies between 25 and 600 MHz. The field
  267. mode for interlaced formats is always V4L2_FIELD_ALTERNATE. For HDMI the
  268. field order is always top field first, and when you start capturing an
  269. interlaced format you will receive the top field first.
  270. The initially selected colorspace when you switch to the HDMI input or
  271. select an HDMI timing is based on the format resolution: for resolutions
  272. less than or equal to 720x576 the colorspace is set to SMPTE-170M, for
  273. others it is set to REC-709 (CEA-861 timings) or sRGB (VESA DMT timings).
  274. The pixel aspect ratio will depend on the HDMI timing: for 720x480 is it
  275. set as for the NTSC TV standard, for 720x576 it is set as for the PAL TV
  276. standard, and for all others a 1:1 pixel aspect ratio is returned.
  277. The video aspect ratio can be selected through the 'DV Timings Aspect Ratio'
  278. Vivid control. Choices are 'Source Width x Height' (just use the
  279. same ratio as the chosen format), '4x3' or '16x9', either of which can
  280. result in pillarboxed or letterboxed video.
  281. For HDMI inputs it is possible to set the EDID. By default a simple EDID
  282. is provided. You can only set the EDID for HDMI inputs. Internally, however,
  283. the EDID is shared between all HDMI inputs.
  284. No interpretation is done of the EDID data with the exception of the
  285. physical address. See the CEC section for more details.
  286. There is a maximum of 15 HDMI inputs (if there are more, then they will be
  287. reduced to 15) since that's the limitation of the EDID physical address.
  288. Video Output
  289. ------------
  290. The video output device can be configured by using the module options
  291. num_outputs, output_types and ccs_out_mode (see section 1 for more detailed
  292. information), but by default two outputs are configured: an S-Video and an
  293. HDMI input, one output for each output type. Those are described in more detail
  294. below.
  295. Like with video capture the framerate is also exact in the long term.
  296. S-Video Output
  297. ~~~~~~~~~~~~~~
  298. This output supports audio outputs as well: "Line-Out 1" and "Line-Out 2".
  299. The S-Video output supports all TV standards.
  300. This output supports all combinations of the field setting.
  301. The initially selected colorspace when you switch to the TV or S-Video input
  302. will be SMPTE-170M.
  303. HDMI Output
  304. ~~~~~~~~~~~
  305. The HDMI output supports all CEA-861 and DMT timings, both progressive and
  306. interlaced, for pixelclock frequencies between 25 and 600 MHz. The field
  307. mode for interlaced formats is always V4L2_FIELD_ALTERNATE.
  308. The initially selected colorspace when you switch to the HDMI output or
  309. select an HDMI timing is based on the format resolution: for resolutions
  310. less than or equal to 720x576 the colorspace is set to SMPTE-170M, for
  311. others it is set to REC-709 (CEA-861 timings) or sRGB (VESA DMT timings).
  312. The pixel aspect ratio will depend on the HDMI timing: for 720x480 is it
  313. set as for the NTSC TV standard, for 720x576 it is set as for the PAL TV
  314. standard, and for all others a 1:1 pixel aspect ratio is returned.
  315. An HDMI output has a valid EDID which can be obtained through VIDIOC_G_EDID.
  316. There is a maximum of 15 HDMI outputs (if there are more, then they will be
  317. reduced to 15) since that's the limitation of the EDID physical address. See
  318. also the CEC section for more details.
  319. VBI Capture
  320. -----------
  321. There are three types of VBI capture devices: those that only support raw
  322. (undecoded) VBI, those that only support sliced (decoded) VBI and those that
  323. support both. This is determined by the node_types module option. In all
  324. cases the driver will generate valid VBI data: for 60 Hz standards it will
  325. generate Closed Caption and XDS data. The closed caption stream will
  326. alternate between "Hello world!" and "Closed captions test" every second.
  327. The XDS stream will give the current time once a minute. For 50 Hz standards
  328. it will generate the Wide Screen Signal which is based on the actual Video
  329. Aspect Ratio control setting and teletext pages 100-159, one page per frame.
  330. The VBI device will only work for the S-Video and TV inputs, it will give
  331. back an error if the current input is a webcam or HDMI.
  332. VBI Output
  333. ----------
  334. There are three types of VBI output devices: those that only support raw
  335. (undecoded) VBI, those that only support sliced (decoded) VBI and those that
  336. support both. This is determined by the node_types module option.
  337. The sliced VBI output supports the Wide Screen Signal and the teletext signal
  338. for 50 Hz standards and Closed Captioning + XDS for 60 Hz standards.
  339. The VBI device will only work for the S-Video output, it will give
  340. back an error if the current output is HDMI.
  341. Radio Receiver
  342. --------------
  343. The radio receiver emulates an FM/AM/SW receiver. The FM band also supports RDS.
  344. The frequency ranges are:
  345. - FM: 64 MHz - 108 MHz
  346. - AM: 520 kHz - 1710 kHz
  347. - SW: 2300 kHz - 26.1 MHz
  348. Valid channels are emulated every 1 MHz for FM and every 100 kHz for AM and SW.
  349. The signal strength decreases the further the frequency is from the valid
  350. frequency until it becomes 0% at +/- 50 kHz (FM) or 5 kHz (AM/SW) from the
  351. ideal frequency. The initial frequency when the driver is loaded is set to
  352. 95 MHz.
  353. The FM receiver supports RDS as well, both using 'Block I/O' and 'Controls'
  354. modes. In the 'Controls' mode the RDS information is stored in read-only
  355. controls. These controls are updated every time the frequency is changed,
  356. or when the tuner status is requested. The Block I/O method uses the read()
  357. interface to pass the RDS blocks on to the application for decoding.
  358. The RDS signal is 'detected' for +/- 12.5 kHz around the channel frequency,
  359. and the further the frequency is away from the valid frequency the more RDS
  360. errors are randomly introduced into the block I/O stream, up to 50% of all
  361. blocks if you are +/- 12.5 kHz from the channel frequency. All four errors
  362. can occur in equal proportions: blocks marked 'CORRECTED', blocks marked
  363. 'ERROR', blocks marked 'INVALID' and dropped blocks.
  364. The generated RDS stream contains all the standard fields contained in a
  365. 0B group, and also radio text and the current time.
  366. The receiver supports HW frequency seek, either in Bounded mode, Wrap Around
  367. mode or both, which is configurable with the "Radio HW Seek Mode" control.
  368. Radio Transmitter
  369. -----------------
  370. The radio transmitter emulates an FM/AM/SW transmitter. The FM band also supports RDS.
  371. The frequency ranges are:
  372. - FM: 64 MHz - 108 MHz
  373. - AM: 520 kHz - 1710 kHz
  374. - SW: 2300 kHz - 26.1 MHz
  375. The initial frequency when the driver is loaded is 95.5 MHz.
  376. The FM transmitter supports RDS as well, both using 'Block I/O' and 'Controls'
  377. modes. In the 'Controls' mode the transmitted RDS information is configured
  378. using controls, and in 'Block I/O' mode the blocks are passed to the driver
  379. using write().
  380. Software Defined Radio Receiver
  381. -------------------------------
  382. The SDR receiver has three frequency bands for the ADC tuner:
  383. - 300 kHz
  384. - 900 kHz - 2800 kHz
  385. - 3200 kHz
  386. The RF tuner supports 50 MHz - 2000 MHz.
  387. The generated data contains the In-phase and Quadrature components of a
  388. 1 kHz tone that has an amplitude of sqrt(2).
  389. Controls
  390. --------
  391. Different devices support different controls. The sections below will describe
  392. each control and which devices support them.
  393. User Controls - Test Controls
  394. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  395. The Button, Boolean, Integer 32 Bits, Integer 64 Bits, Menu, String, Bitmask and
  396. Integer Menu are controls that represent all possible control types. The Menu
  397. control and the Integer Menu control both have 'holes' in their menu list,
  398. meaning that one or more menu items return EINVAL when VIDIOC_QUERYMENU is called.
  399. Both menu controls also have a non-zero minimum control value. These features
  400. allow you to check if your application can handle such things correctly.
  401. These controls are supported for every device type.
  402. User Controls - Video Capture
  403. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  404. The following controls are specific to video capture.
  405. The Brightness, Contrast, Saturation and Hue controls actually work and are
  406. standard. There is one special feature with the Brightness control: each
  407. video input has its own brightness value, so changing input will restore
  408. the brightness for that input. In addition, each video input uses a different
  409. brightness range (minimum and maximum control values). Switching inputs will
  410. cause a control event to be sent with the V4L2_EVENT_CTRL_CH_RANGE flag set.
  411. This allows you to test controls that can change their range.
  412. The 'Gain, Automatic' and Gain controls can be used to test volatile controls:
  413. if 'Gain, Automatic' is set, then the Gain control is volatile and changes
  414. constantly. If 'Gain, Automatic' is cleared, then the Gain control is a normal
  415. control.
  416. The 'Horizontal Flip' and 'Vertical Flip' controls can be used to flip the
  417. image. These combine with the 'Sensor Flipped Horizontally/Vertically' Vivid
  418. controls.
  419. The 'Alpha Component' control can be used to set the alpha component for
  420. formats containing an alpha channel.
  421. User Controls - Audio
  422. ~~~~~~~~~~~~~~~~~~~~~
  423. The following controls are specific to video capture and output and radio
  424. receivers and transmitters.
  425. The 'Volume' and 'Mute' audio controls are typical for such devices to
  426. control the volume and mute the audio. They don't actually do anything in
  427. the vivid driver.
  428. Vivid Controls
  429. ~~~~~~~~~~~~~~
  430. These vivid custom controls control the image generation, error injection, etc.
  431. Test Pattern Controls
  432. ^^^^^^^^^^^^^^^^^^^^^
  433. The Test Pattern Controls are all specific to video capture.
  434. - Test Pattern:
  435. selects which test pattern to use. Use the CSC Colorbar for
  436. testing colorspace conversions: the colors used in that test pattern
  437. map to valid colors in all colorspaces. The colorspace conversion
  438. is disabled for the other test patterns.
  439. - OSD Text Mode:
  440. selects whether the text superimposed on the
  441. test pattern should be shown, and if so, whether only counters should
  442. be displayed or the full text.
  443. - Horizontal Movement:
  444. selects whether the test pattern should
  445. move to the left or right and at what speed.
  446. - Vertical Movement:
  447. does the same for the vertical direction.
  448. - Show Border:
  449. show a two-pixel wide border at the edge of the actual image,
  450. excluding letter or pillarboxing.
  451. - Show Square:
  452. show a square in the middle of the image. If the image is
  453. displayed with the correct pixel and image aspect ratio corrections,
  454. then the width and height of the square on the monitor should be
  455. the same.
  456. - Insert SAV Code in Image:
  457. adds a SAV (Start of Active Video) code to the image.
  458. This can be used to check if such codes in the image are inadvertently
  459. interpreted instead of being ignored.
  460. - Insert EAV Code in Image:
  461. does the same for the EAV (End of Active Video) code.
  462. Capture Feature Selection Controls
  463. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  464. These controls are all specific to video capture.
  465. - Sensor Flipped Horizontally:
  466. the image is flipped horizontally and the
  467. V4L2_IN_ST_HFLIP input status flag is set. This emulates the case where
  468. a sensor is for example mounted upside down.
  469. - Sensor Flipped Vertically:
  470. the image is flipped vertically and the
  471. V4L2_IN_ST_VFLIP input status flag is set. This emulates the case where
  472. a sensor is for example mounted upside down.
  473. - Standard Aspect Ratio:
  474. selects if the image aspect ratio as used for the TV or
  475. S-Video input should be 4x3, 16x9 or anamorphic widescreen. This may
  476. introduce letterboxing.
  477. - DV Timings Aspect Ratio:
  478. selects if the image aspect ratio as used for the HDMI
  479. input should be the same as the source width and height ratio, or if
  480. it should be 4x3 or 16x9. This may introduce letter or pillarboxing.
  481. - Timestamp Source:
  482. selects when the timestamp for each buffer is taken.
  483. - Colorspace:
  484. selects which colorspace should be used when generating the image.
  485. This only applies if the CSC Colorbar test pattern is selected,
  486. otherwise the test pattern will go through unconverted.
  487. This behavior is also what you want, since a 75% Colorbar
  488. should really have 75% signal intensity and should not be affected
  489. by colorspace conversions.
  490. Changing the colorspace will result in the V4L2_EVENT_SOURCE_CHANGE
  491. to be sent since it emulates a detected colorspace change.
  492. - Transfer Function:
  493. selects which colorspace transfer function should be used when
  494. generating an image. This only applies if the CSC Colorbar test pattern is
  495. selected, otherwise the test pattern will go through unconverted.
  496. This behavior is also what you want, since a 75% Colorbar
  497. should really have 75% signal intensity and should not be affected
  498. by colorspace conversions.
  499. Changing the transfer function will result in the V4L2_EVENT_SOURCE_CHANGE
  500. to be sent since it emulates a detected colorspace change.
  501. - Y'CbCr Encoding:
  502. selects which Y'CbCr encoding should be used when generating
  503. a Y'CbCr image. This only applies if the format is set to a Y'CbCr format
  504. as opposed to an RGB format.
  505. Changing the Y'CbCr encoding will result in the V4L2_EVENT_SOURCE_CHANGE
  506. to be sent since it emulates a detected colorspace change.
  507. - Quantization:
  508. selects which quantization should be used for the RGB or Y'CbCr
  509. encoding when generating the test pattern.
  510. Changing the quantization will result in the V4L2_EVENT_SOURCE_CHANGE
  511. to be sent since it emulates a detected colorspace change.
  512. - Limited RGB Range (16-235):
  513. selects if the RGB range of the HDMI source should
  514. be limited or full range. This combines with the Digital Video 'Rx RGB
  515. Quantization Range' control and can be used to test what happens if
  516. a source provides you with the wrong quantization range information.
  517. See the description of that control for more details.
  518. - Apply Alpha To Red Only:
  519. apply the alpha channel as set by the 'Alpha Component'
  520. user control to the red color of the test pattern only.
  521. - Enable Capture Cropping:
  522. enables crop support. This control is only present if
  523. the ccs_cap_mode module option is set to the default value of -1 and if
  524. the no_error_inj module option is set to 0 (the default).
  525. - Enable Capture Composing:
  526. enables composing support. This control is only
  527. present if the ccs_cap_mode module option is set to the default value of
  528. -1 and if the no_error_inj module option is set to 0 (the default).
  529. - Enable Capture Scaler:
  530. enables support for a scaler (maximum 4 times upscaling
  531. and downscaling). This control is only present if the ccs_cap_mode
  532. module option is set to the default value of -1 and if the no_error_inj
  533. module option is set to 0 (the default).
  534. - Maximum EDID Blocks:
  535. determines how many EDID blocks the driver supports.
  536. Note that the vivid driver does not actually interpret new EDID
  537. data, it just stores it. It allows for up to 256 EDID blocks
  538. which is the maximum supported by the standard.
  539. - Fill Percentage of Frame:
  540. can be used to draw only the top X percent
  541. of the image. Since each frame has to be drawn by the driver, this
  542. demands a lot of the CPU. For large resolutions this becomes
  543. problematic. By drawing only part of the image this CPU load can
  544. be reduced.
  545. Output Feature Selection Controls
  546. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  547. These controls are all specific to video output.
  548. - Enable Output Cropping:
  549. enables crop support. This control is only present if
  550. the ccs_out_mode module option is set to the default value of -1 and if
  551. the no_error_inj module option is set to 0 (the default).
  552. - Enable Output Composing:
  553. enables composing support. This control is only
  554. present if the ccs_out_mode module option is set to the default value of
  555. -1 and if the no_error_inj module option is set to 0 (the default).
  556. - Enable Output Scaler:
  557. enables support for a scaler (maximum 4 times upscaling
  558. and downscaling). This control is only present if the ccs_out_mode
  559. module option is set to the default value of -1 and if the no_error_inj
  560. module option is set to 0 (the default).
  561. Error Injection Controls
  562. ^^^^^^^^^^^^^^^^^^^^^^^^
  563. The following two controls are only valid for video and vbi capture.
  564. - Standard Signal Mode:
  565. selects the behavior of VIDIOC_QUERYSTD: what should it return?
  566. Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
  567. to be sent since it emulates a changed input condition (e.g. a cable
  568. was plugged in or out).
  569. - Standard:
  570. selects the standard that VIDIOC_QUERYSTD should return if the
  571. previous control is set to "Selected Standard".
  572. Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
  573. to be sent since it emulates a changed input standard.
  574. The following two controls are only valid for video capture.
  575. - DV Timings Signal Mode:
  576. selects the behavior of VIDIOC_QUERY_DV_TIMINGS: what
  577. should it return?
  578. Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
  579. to be sent since it emulates a changed input condition (e.g. a cable
  580. was plugged in or out).
  581. - DV Timings:
  582. selects the timings the VIDIOC_QUERY_DV_TIMINGS should return
  583. if the previous control is set to "Selected DV Timings".
  584. Changing this control will result in the V4L2_EVENT_SOURCE_CHANGE
  585. to be sent since it emulates changed input timings.
  586. The following controls are only present if the no_error_inj module option
  587. is set to 0 (the default). These controls are valid for video and vbi
  588. capture and output streams and for the SDR capture device except for the
  589. Disconnect control which is valid for all devices.
  590. - Wrap Sequence Number:
  591. test what happens when you wrap the sequence number in
  592. struct v4l2_buffer around.
  593. - Wrap Timestamp:
  594. test what happens when you wrap the timestamp in struct
  595. v4l2_buffer around.
  596. - Percentage of Dropped Buffers:
  597. sets the percentage of buffers that
  598. are never returned by the driver (i.e., they are dropped).
  599. - Disconnect:
  600. emulates a USB disconnect. The device will act as if it has
  601. been disconnected. Only after all open filehandles to the device
  602. node have been closed will the device become 'connected' again.
  603. - Inject V4L2_BUF_FLAG_ERROR:
  604. when pressed, the next frame returned by
  605. the driver will have the error flag set (i.e. the frame is marked
  606. corrupt).
  607. - Inject VIDIOC_REQBUFS Error:
  608. when pressed, the next REQBUFS or CREATE_BUFS
  609. ioctl call will fail with an error. To be precise: the videobuf2
  610. queue_setup() op will return -EINVAL.
  611. - Inject VIDIOC_QBUF Error:
  612. when pressed, the next VIDIOC_QBUF or
  613. VIDIOC_PREPARE_BUFFER ioctl call will fail with an error. To be
  614. precise: the videobuf2 buf_prepare() op will return -EINVAL.
  615. - Inject VIDIOC_STREAMON Error:
  616. when pressed, the next VIDIOC_STREAMON ioctl
  617. call will fail with an error. To be precise: the videobuf2
  618. start_streaming() op will return -EINVAL.
  619. - Inject Fatal Streaming Error:
  620. when pressed, the streaming core will be
  621. marked as having suffered a fatal error, the only way to recover
  622. from that is to stop streaming. To be precise: the videobuf2
  623. vb2_queue_error() function is called.
  624. VBI Raw Capture Controls
  625. ^^^^^^^^^^^^^^^^^^^^^^^^
  626. - Interlaced VBI Format:
  627. if set, then the raw VBI data will be interlaced instead
  628. of providing it grouped by field.
  629. Digital Video Controls
  630. ~~~~~~~~~~~~~~~~~~~~~~
  631. - Rx RGB Quantization Range:
  632. sets the RGB quantization detection of the HDMI
  633. input. This combines with the Vivid 'Limited RGB Range (16-235)'
  634. control and can be used to test what happens if a source provides
  635. you with the wrong quantization range information. This can be tested
  636. by selecting an HDMI input, setting this control to Full or Limited
  637. range and selecting the opposite in the 'Limited RGB Range (16-235)'
  638. control. The effect is easy to see if the 'Gray Ramp' test pattern
  639. is selected.
  640. - Tx RGB Quantization Range:
  641. sets the RGB quantization detection of the HDMI
  642. output. It is currently not used for anything in vivid, but most HDMI
  643. transmitters would typically have this control.
  644. - Transmit Mode:
  645. sets the transmit mode of the HDMI output to HDMI or DVI-D. This
  646. affects the reported colorspace since DVI_D outputs will always use
  647. sRGB.
  648. FM Radio Receiver Controls
  649. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  650. - RDS Reception:
  651. set if the RDS receiver should be enabled.
  652. - RDS Program Type:
  653. - RDS PS Name:
  654. - RDS Radio Text:
  655. - RDS Traffic Announcement:
  656. - RDS Traffic Program:
  657. - RDS Music:
  658. these are all read-only controls. If RDS Rx I/O Mode is set to
  659. "Block I/O", then they are inactive as well. If RDS Rx I/O Mode is set
  660. to "Controls", then these controls report the received RDS data.
  661. .. note::
  662. The vivid implementation of this is pretty basic: they are only
  663. updated when you set a new frequency or when you get the tuner status
  664. (VIDIOC_G_TUNER).
  665. - Radio HW Seek Mode:
  666. can be one of "Bounded", "Wrap Around" or "Both". This
  667. determines if VIDIOC_S_HW_FREQ_SEEK will be bounded by the frequency
  668. range or wrap-around or if it is selectable by the user.
  669. - Radio Programmable HW Seek:
  670. if set, then the user can provide the lower and
  671. upper bound of the HW Seek. Otherwise the frequency range boundaries
  672. will be used.
  673. - Generate RBDS Instead of RDS:
  674. if set, then generate RBDS (the US variant of
  675. RDS) data instead of RDS (European-style RDS). This affects only the
  676. PICODE and PTY codes.
  677. - RDS Rx I/O Mode:
  678. this can be "Block I/O" where the RDS blocks have to be read()
  679. by the application, or "Controls" where the RDS data is provided by
  680. the RDS controls mentioned above.
  681. FM Radio Modulator Controls
  682. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  683. - RDS Program ID:
  684. - RDS Program Type:
  685. - RDS PS Name:
  686. - RDS Radio Text:
  687. - RDS Stereo:
  688. - RDS Artificial Head:
  689. - RDS Compressed:
  690. - RDS Dynamic PTY:
  691. - RDS Traffic Announcement:
  692. - RDS Traffic Program:
  693. - RDS Music:
  694. these are all controls that set the RDS data that is transmitted by
  695. the FM modulator.
  696. - RDS Tx I/O Mode:
  697. this can be "Block I/O" where the application has to use write()
  698. to pass the RDS blocks to the driver, or "Controls" where the RDS data
  699. is Provided by the RDS controls mentioned above.
  700. Video, VBI and RDS Looping
  701. --------------------------
  702. The vivid driver supports looping of video output to video input, VBI output
  703. to VBI input and RDS output to RDS input. For video/VBI looping this emulates
  704. as if a cable was hooked up between the output and input connector. So video
  705. and VBI looping is only supported between S-Video and HDMI inputs and outputs.
  706. VBI is only valid for S-Video as it makes no sense for HDMI.
  707. Since radio is wireless this looping always happens if the radio receiver
  708. frequency is close to the radio transmitter frequency. In that case the radio
  709. transmitter will 'override' the emulated radio stations.
  710. Looping is currently supported only between devices created by the same
  711. vivid driver instance.
  712. Video and Sliced VBI looping
  713. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  714. The way to enable video/VBI looping is currently fairly crude. A 'Loop Video'
  715. control is available in the "Vivid" control class of the video
  716. capture and VBI capture devices. When checked the video looping will be enabled.
  717. Once enabled any video S-Video or HDMI input will show a static test pattern
  718. until the video output has started. At that time the video output will be
  719. looped to the video input provided that:
  720. - the input type matches the output type. So the HDMI input cannot receive
  721. video from the S-Video output.
  722. - the video resolution of the video input must match that of the video output.
  723. So it is not possible to loop a 50 Hz (720x576) S-Video output to a 60 Hz
  724. (720x480) S-Video input, or a 720p60 HDMI output to a 1080p30 input.
  725. - the pixel formats must be identical on both sides. Otherwise the driver would
  726. have to do pixel format conversion as well, and that's taking things too far.
  727. - the field settings must be identical on both sides. Same reason as above:
  728. requiring the driver to convert from one field format to another complicated
  729. matters too much. This also prohibits capturing with 'Field Top' or 'Field
  730. Bottom' when the output video is set to 'Field Alternate'. This combination,
  731. while legal, became too complicated to support. Both sides have to be 'Field
  732. Alternate' for this to work. Also note that for this specific case the
  733. sequence and field counting in struct v4l2_buffer on the capture side may not
  734. be 100% accurate.
  735. - field settings V4L2_FIELD_SEQ_TB/BT are not supported. While it is possible to
  736. implement this, it would mean a lot of work to get this right. Since these
  737. field values are rarely used the decision was made not to implement this for
  738. now.
  739. - on the input side the "Standard Signal Mode" for the S-Video input or the
  740. "DV Timings Signal Mode" for the HDMI input should be configured so that a
  741. valid signal is passed to the video input.
  742. The framerates do not have to match, although this might change in the future.
  743. By default you will see the OSD text superimposed on top of the looped video.
  744. This can be turned off by changing the "OSD Text Mode" control of the video
  745. capture device.
  746. For VBI looping to work all of the above must be valid and in addition the vbi
  747. output must be configured for sliced VBI. The VBI capture side can be configured
  748. for either raw or sliced VBI. Note that at the moment only CC/XDS (60 Hz formats)
  749. and WSS (50 Hz formats) VBI data is looped. Teletext VBI data is not looped.
  750. Radio & RDS Looping
  751. ~~~~~~~~~~~~~~~~~~~
  752. As mentioned in section 6 the radio receiver emulates stations are regular
  753. frequency intervals. Depending on the frequency of the radio receiver a
  754. signal strength value is calculated (this is returned by VIDIOC_G_TUNER).
  755. However, it will also look at the frequency set by the radio transmitter and
  756. if that results in a higher signal strength than the settings of the radio
  757. transmitter will be used as if it was a valid station. This also includes
  758. the RDS data (if any) that the transmitter 'transmits'. This is received
  759. faithfully on the receiver side. Note that when the driver is loaded the
  760. frequencies of the radio receiver and transmitter are not identical, so
  761. initially no looping takes place.
  762. Cropping, Composing, Scaling
  763. ----------------------------
  764. This driver supports cropping, composing and scaling in any combination. Normally
  765. which features are supported can be selected through the Vivid controls,
  766. but it is also possible to hardcode it when the module is loaded through the
  767. ccs_cap_mode and ccs_out_mode module options. See section 1 on the details of
  768. these module options.
  769. This allows you to test your application for all these variations.
  770. Note that the webcam input never supports cropping, composing or scaling. That
  771. only applies to the TV/S-Video/HDMI inputs and outputs. The reason is that
  772. webcams, including this virtual implementation, normally use
  773. VIDIOC_ENUM_FRAMESIZES to list a set of discrete framesizes that it supports.
  774. And that does not combine with cropping, composing or scaling. This is
  775. primarily a limitation of the V4L2 API which is carefully reproduced here.
  776. The minimum and maximum resolutions that the scaler can achieve are 16x16 and
  777. (4096 * 4) x (2160 x 4), but it can only scale up or down by a factor of 4 or
  778. less. So for a source resolution of 1280x720 the minimum the scaler can do is
  779. 320x180 and the maximum is 5120x2880. You can play around with this using the
  780. qv4l2 test tool and you will see these dependencies.
  781. This driver also supports larger 'bytesperline' settings, something that
  782. VIDIOC_S_FMT allows but that few drivers implement.
  783. The scaler is a simple scaler that uses the Coarse Bresenham algorithm. It's
  784. designed for speed and simplicity, not quality.
  785. If the combination of crop, compose and scaling allows it, then it is possible
  786. to change crop and compose rectangles on the fly.
  787. Formats
  788. -------
  789. The driver supports all the regular packed and planar 4:4:4, 4:2:2 and 4:2:0
  790. YUYV formats, 8, 16, 24 and 32 RGB packed formats and various multiplanar
  791. formats.
  792. The alpha component can be set through the 'Alpha Component' User control
  793. for those formats that support it. If the 'Apply Alpha To Red Only' control
  794. is set, then the alpha component is only used for the color red and set to
  795. 0 otherwise.
  796. The driver has to be configured to support the multiplanar formats. By default
  797. the driver instances are single-planar. This can be changed by setting the
  798. multiplanar module option, see section 1 for more details on that option.
  799. If the driver instance is using the multiplanar formats/API, then the first
  800. single planar format (YUYV) and the multiplanar NV16M and NV61M formats the
  801. will have a plane that has a non-zero data_offset of 128 bytes. It is rare for
  802. data_offset to be non-zero, so this is a useful feature for testing applications.
  803. Video output will also honor any data_offset that the application set.
  804. Capture Overlay
  805. ---------------
  806. Note: capture overlay support is implemented primarily to test the existing
  807. V4L2 capture overlay API. In practice few if any GPUs support such overlays
  808. anymore, and neither are they generally needed anymore since modern hardware
  809. is so much more capable. By setting flag 0x10000 in the node_types module
  810. option the vivid driver will create a simple framebuffer device that can be
  811. used for testing this API. Whether this API should be used for new drivers is
  812. questionable.
  813. This driver has support for a destructive capture overlay with bitmap clipping
  814. and list clipping (up to 16 rectangles) capabilities. Overlays are not
  815. supported for multiplanar formats. It also honors the struct v4l2_window field
  816. setting: if it is set to FIELD_TOP or FIELD_BOTTOM and the capture setting is
  817. FIELD_ALTERNATE, then only the top or bottom fields will be copied to the overlay.
  818. The overlay only works if you are also capturing at that same time. This is a
  819. vivid limitation since it copies from a buffer to the overlay instead of
  820. filling the overlay directly. And if you are not capturing, then no buffers
  821. are available to fill.
  822. In addition, the pixelformat of the capture format and that of the framebuffer
  823. must be the same for the overlay to work. Otherwise VIDIOC_OVERLAY will return
  824. an error.
  825. In order to really see what it going on you will need to create two vivid
  826. instances: the first with a framebuffer enabled. You configure the capture
  827. overlay of the second instance to use the framebuffer of the first, then
  828. you start capturing in the second instance. For the first instance you setup
  829. the output overlay for the video output, turn on video looping and capture
  830. to see the blended framebuffer overlay that's being written to by the second
  831. instance. This setup would require the following commands:
  832. .. code-block:: none
  833. $ sudo modprobe vivid n_devs=2 node_types=0x10101,0x1
  834. $ v4l2-ctl -d1 --find-fb
  835. /dev/fb1 is the framebuffer associated with base address 0x12800000
  836. $ sudo v4l2-ctl -d2 --set-fbuf fb=1
  837. $ v4l2-ctl -d1 --set-fbuf fb=1
  838. $ v4l2-ctl -d0 --set-fmt-video=pixelformat='AR15'
  839. $ v4l2-ctl -d1 --set-fmt-video-out=pixelformat='AR15'
  840. $ v4l2-ctl -d2 --set-fmt-video=pixelformat='AR15'
  841. $ v4l2-ctl -d0 -i2
  842. $ v4l2-ctl -d2 -i2
  843. $ v4l2-ctl -d2 -c horizontal_movement=4
  844. $ v4l2-ctl -d1 --overlay=1
  845. $ v4l2-ctl -d1 -c loop_video=1
  846. $ v4l2-ctl -d2 --stream-mmap --overlay=1
  847. And from another console:
  848. .. code-block:: none
  849. $ v4l2-ctl -d1 --stream-out-mmap
  850. And yet another console:
  851. .. code-block:: none
  852. $ qv4l2
  853. and start streaming.
  854. As you can see, this is not for the faint of heart...
  855. Output Overlay
  856. --------------
  857. Note: output overlays are primarily implemented in order to test the existing
  858. V4L2 output overlay API. Whether this API should be used for new drivers is
  859. questionable.
  860. This driver has support for an output overlay and is capable of:
  861. - bitmap clipping,
  862. - list clipping (up to 16 rectangles)
  863. - chromakey
  864. - source chromakey
  865. - global alpha
  866. - local alpha
  867. - local inverse alpha
  868. Output overlays are not supported for multiplanar formats. In addition, the
  869. pixelformat of the capture format and that of the framebuffer must be the
  870. same for the overlay to work. Otherwise VIDIOC_OVERLAY will return an error.
  871. Output overlays only work if the driver has been configured to create a
  872. framebuffer by setting flag 0x10000 in the node_types module option. The
  873. created framebuffer has a size of 720x576 and supports ARGB 1:5:5:5 and
  874. RGB 5:6:5.
  875. In order to see the effects of the various clipping, chromakeying or alpha
  876. processing capabilities you need to turn on video looping and see the results
  877. on the capture side. The use of the clipping, chromakeying or alpha processing
  878. capabilities will slow down the video loop considerably as a lot of checks have
  879. to be done per pixel.
  880. CEC (Consumer Electronics Control)
  881. ----------------------------------
  882. If there are HDMI inputs then a CEC adapter will be created that has
  883. the same number of input ports. This is the equivalent of e.g. a TV that
  884. has that number of inputs. Each HDMI output will also create a
  885. CEC adapter that is hooked up to the corresponding input port, or (if there
  886. are more outputs than inputs) is not hooked up at all. In other words,
  887. this is the equivalent of hooking up each output device to an input port of
  888. the TV. Any remaining output devices remain unconnected.
  889. The EDID that each output reads reports a unique CEC physical address that is
  890. based on the physical address of the EDID of the input. So if the EDID of the
  891. receiver has physical address A.B.0.0, then each output will see an EDID
  892. containing physical address A.B.C.0 where C is 1 to the number of inputs. If
  893. there are more outputs than inputs then the remaining outputs have a CEC adapter
  894. that is disabled and reports an invalid physical address.
  895. Some Future Improvements
  896. ------------------------
  897. Just as a reminder and in no particular order:
  898. - Add a virtual alsa driver to test audio
  899. - Add virtual sub-devices and media controller support
  900. - Some support for testing compressed video
  901. - Add support to loop raw VBI output to raw VBI input
  902. - Add support to loop teletext sliced VBI output to VBI input
  903. - Fix sequence/field numbering when looping of video with alternate fields
  904. - Add support for V4L2_CID_BG_COLOR for video outputs
  905. - Add ARGB888 overlay support: better testing of the alpha channel
  906. - Improve pixel aspect support in the tpg code by passing a real v4l2_fract
  907. - Use per-queue locks and/or per-device locks to improve throughput
  908. - Add support to loop from a specific output to a specific input across
  909. vivid instances
  910. - The SDR radio should use the same 'frequencies' for stations as the normal
  911. radio receiver, and give back noise if the frequency doesn't match up with
  912. a station frequency
  913. - Make a thread for the RDS generation, that would help in particular for the
  914. "Controls" RDS Rx I/O Mode as the read-only RDS controls could be updated
  915. in real-time.
  916. - Changing the EDID should cause hotplug detect emulation to happen.