vivid.rst 49 KB

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