Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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