694 lines · plain
1.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later2 3.. _subdev:4 5********************6Sub-device Interface7********************8 9The complex nature of V4L2 devices, where hardware is often made of10several integrated circuits that need to interact with each other in a11controlled way, leads to complex V4L2 drivers. The drivers usually12reflect the hardware model in software, and model the different hardware13components as software blocks called sub-devices.14 15V4L2 sub-devices are usually kernel-only objects. If the V4L2 driver16implements the media device API, they will automatically inherit from17media entities. Applications will be able to enumerate the sub-devices18and discover the hardware topology using the media entities, pads and19links enumeration API.20 21In addition to make sub-devices discoverable, drivers can also choose to22make them directly configurable by applications. When both the23sub-device driver and the V4L2 device driver support this, sub-devices24will feature a character device node on which ioctls can be called to25 26- query, read and write sub-devices controls27 28- subscribe and unsubscribe to events and retrieve them29 30- negotiate image formats on individual pads31 32- inspect and modify internal data routing between pads of the same entity33 34Sub-device character device nodes, conventionally named35``/dev/v4l-subdev*``, use major number 81.36 37Drivers may opt to limit the sub-device character devices to only expose38operations that do not modify the device state. In such a case the sub-devices39are referred to as ``read-only`` in the rest of this documentation, and the40related restrictions are documented in individual ioctls.41 42 43Controls44========45 46Most V4L2 controls are implemented by sub-device hardware. Drivers47usually merge all controls and expose them through video device nodes.48Applications can control all sub-devices through a single interface.49 50Complex devices sometimes implement the same control in different pieces51of hardware. This situation is common in embedded platforms, where both52sensors and image processing hardware implement identical functions,53such as contrast adjustment, white balance or faulty pixels correction.54As the V4L2 controls API doesn't support several identical controls in a55single device, all but one of the identical controls are hidden.56 57Applications can access those hidden controls through the sub-device58node with the V4L2 control API described in :ref:`control`. The ioctls59behave identically as when issued on V4L2 device nodes, with the60exception that they deal only with controls implemented in the61sub-device.62 63Depending on the driver, those controls might also be exposed through64one (or several) V4L2 device nodes.65 66 67Events68======69 70V4L2 sub-devices can notify applications of events as described in71:ref:`event`. The API behaves identically as when used on V4L2 device72nodes, with the exception that it only deals with events generated by73the sub-device. Depending on the driver, those events might also be74reported on one (or several) V4L2 device nodes.75 76 77.. _pad-level-formats:78 79Pad-level Formats80=================81 82.. warning::83 84 Pad-level formats are only applicable to very complex devices that85 need to expose low-level format configuration to user space. Generic86 V4L2 applications do *not* need to use the API described in this87 section.88 89.. note::90 91 For the purpose of this section, the term *format* means the92 combination of media bus data format, frame width and frame height.93 94Image formats are typically negotiated on video capture and output95devices using the format and96:ref:`selection <VIDIOC_SUBDEV_G_SELECTION>` ioctls. The driver is97responsible for configuring every block in the video pipeline according98to the requested format at the pipeline input and/or output.99 100For complex devices, such as often found in embedded systems, identical101image sizes at the output of a pipeline can be achieved using different102hardware configurations. One such example is shown on103:ref:`pipeline-scaling`, where image scaling can be performed on both104the video sensor and the host image processing hardware.105 106 107.. _pipeline-scaling:108 109.. kernel-figure:: pipeline.dot110 :alt: pipeline.dot111 :align: center112 113 Image Format Negotiation on Pipelines114 115 High quality and high speed pipeline configuration116 117 118 119The sensor scaler is usually of less quality than the host scaler, but120scaling on the sensor is required to achieve higher frame rates.121Depending on the use case (quality vs. speed), the pipeline must be122configured differently. Applications need to configure the formats at123every point in the pipeline explicitly.124 125Drivers that implement the :ref:`media API <media-controller-intro>`126can expose pad-level image format configuration to applications. When127they do, applications can use the128:ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` and129:ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctls. to130negotiate formats on a per-pad basis.131 132Applications are responsible for configuring coherent parameters on the133whole pipeline and making sure that connected pads have compatible134formats. The pipeline is checked for formats mismatch at135:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` time, and an ``EPIPE`` error136code is then returned if the configuration is invalid.137 138Pad-level image format configuration support can be tested by calling139the :ref:`VIDIOC_SUBDEV_G_FMT` ioctl on pad1400. If the driver returns an ``EINVAL`` error code pad-level format141configuration is not supported by the sub-device.142 143 144Format Negotiation145------------------146 147Acceptable formats on pads can (and usually do) depend on a number of148external parameters, such as formats on other pads, active links, or149even controls. Finding a combination of formats on all pads in a video150pipeline, acceptable to both application and driver, can't rely on151formats enumeration only. A format negotiation mechanism is required.152 153Central to the format negotiation mechanism are the get/set format154operations. When called with the ``which`` argument set to155:ref:`V4L2_SUBDEV_FORMAT_TRY <VIDIOC_SUBDEV_G_FMT>`, the156:ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` and157:ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctls operate on158a set of formats parameters that are not connected to the hardware159configuration. Modifying those 'try' formats leaves the device state160untouched (this applies to both the software state stored in the driver161and the hardware state stored in the device itself).162 163While not kept as part of the device state, try formats are stored in164the sub-device file handles. A165:ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` call will return166the last try format set *on the same sub-device file handle*. Several167applications querying the same sub-device at the same time will thus not168interact with each other.169 170To find out whether a particular format is supported by the device,171applications use the172:ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctl. Drivers173verify and, if needed, change the requested ``format`` based on device174requirements and return the possibly modified value. Applications can175then choose to try a different format or accept the returned value and176continue.177 178Formats returned by the driver during a negotiation iteration are179guaranteed to be supported by the device. In particular, drivers180guarantee that a returned format will not be further changed if passed181to an :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` call as-is182(as long as external parameters, such as formats on other pads or links'183configuration are not changed).184 185Drivers automatically propagate formats inside sub-devices. When a try186or active format is set on a pad, corresponding formats on other pads of187the same sub-device can be modified by the driver. Drivers are free to188modify formats as required by the device. However, they should comply189with the following rules when possible:190 191- Formats should be propagated from sink pads to source pads. Modifying192 a format on a source pad should not modify the format on any sink193 pad.194 195- Sub-devices that scale frames using variable scaling factors should196 reset the scale factors to default values when sink pads formats are197 modified. If the 1:1 scaling ratio is supported, this means that198 source pads formats should be reset to the sink pads formats.199 200Formats are not propagated across links, as that would involve201propagating them from one sub-device file handle to another.202Applications must then take care to configure both ends of every link203explicitly with compatible formats. Identical formats on the two ends of204a link are guaranteed to be compatible. Drivers are free to accept205different formats matching device requirements as being compatible.206 207:ref:`sample-pipeline-config` shows a sample configuration sequence208for the pipeline described in :ref:`pipeline-scaling` (table columns209list entity names and pad numbers).210 211 212.. raw:: latex213 214 \begingroup215 \scriptsize216 \setlength{\tabcolsep}{2pt}217 218.. tabularcolumns:: |p{2.0cm}|p{2.1cm}|p{2.1cm}|p{2.1cm}|p{2.1cm}|p{2.1cm}|p{2.1cm}|219 220.. _sample-pipeline-config:221 222.. flat-table:: Sample Pipeline Configuration223 :header-rows: 1224 :stub-columns: 0225 :widths: 5 5 5 5 5 5 5226 227 * -228 - Sensor/0229 230 format231 - Frontend/0232 233 format234 - Frontend/1235 236 format237 - Scaler/0238 239 format240 - Scaler/0241 242 compose selection rectangle243 - Scaler/1244 245 format246 * - Initial state247 - 2048x1536248 249 SGRBG8_1X8250 - (default)251 - (default)252 - (default)253 - (default)254 - (default)255 * - Configure frontend sink format256 - 2048x1536257 258 SGRBG8_1X8259 - *2048x1536*260 261 *SGRBG8_1X8*262 - *2046x1534*263 264 *SGRBG8_1X8*265 - (default)266 - (default)267 - (default)268 * - Configure scaler sink format269 - 2048x1536270 271 SGRBG8_1X8272 - 2048x1536273 274 SGRBG8_1X8275 - 2046x1534276 277 SGRBG8_1X8278 - *2046x1534*279 280 *SGRBG8_1X8*281 - *0,0/2046x1534*282 - *2046x1534*283 284 *SGRBG8_1X8*285 * - Configure scaler sink compose selection286 - 2048x1536287 288 SGRBG8_1X8289 - 2048x1536290 291 SGRBG8_1X8292 - 2046x1534293 294 SGRBG8_1X8295 - 2046x1534296 297 SGRBG8_1X8298 - *0,0/1280x960*299 - *1280x960*300 301 *SGRBG8_1X8*302 303.. raw:: latex304 305 \endgroup306 3071. Initial state. The sensor source pad format is set to its native 3MP308 size and V4L2_MBUS_FMT_SGRBG8_1X8 media bus code. Formats on the309 host frontend and scaler sink and source pads have the default310 values, as well as the compose rectangle on the scaler's sink pad.311 3122. The application configures the frontend sink pad format's size to313 2048x1536 and its media bus code to V4L2_MBUS_FMT_SGRBG_1X8. The314 driver propagates the format to the frontend source pad.315 3163. The application configures the scaler sink pad format's size to317 2046x1534 and the media bus code to V4L2_MBUS_FMT_SGRBG_1X8 to318 match the frontend source size and media bus code. The media bus code319 on the sink pad is set to V4L2_MBUS_FMT_SGRBG_1X8. The driver320 propagates the size to the compose selection rectangle on the321 scaler's sink pad, and the format to the scaler source pad.322 3234. The application configures the size of the compose selection324 rectangle of the scaler's sink pad 1280x960. The driver propagates325 the size to the scaler's source pad format.326 327When satisfied with the try results, applications can set the active328formats by setting the ``which`` argument to329``V4L2_SUBDEV_FORMAT_ACTIVE``. Active formats are changed exactly as try330formats by drivers. To avoid modifying the hardware state during format331negotiation, applications should negotiate try formats first and then332modify the active settings using the try formats returned during the333last negotiation iteration. This guarantees that the active format will334be applied as-is by the driver without being modified.335 336 337.. _v4l2-subdev-selections:338 339Selections: cropping, scaling and composition340---------------------------------------------341 342Many sub-devices support cropping frames on their input or output pads343(or possible even on both). Cropping is used to select the area of344interest in an image, typically on an image sensor or a video decoder.345It can also be used as part of digital zoom implementations to select346the area of the image that will be scaled up.347 348Crop settings are defined by a crop rectangle and represented in a349struct :c:type:`v4l2_rect` by the coordinates of the top350left corner and the rectangle size. Both the coordinates and sizes are351expressed in pixels.352 353As for pad formats, drivers store try and active rectangles for the354selection targets :ref:`v4l2-selections-common`.355 356On sink pads, cropping is applied relative to the current pad format.357The pad format represents the image size as received by the sub-device358from the previous block in the pipeline, and the crop rectangle359represents the sub-image that will be transmitted further inside the360sub-device for processing.361 362The scaling operation changes the size of the image by scaling it to new363dimensions. The scaling ratio isn't specified explicitly, but is implied364from the original and scaled image sizes. Both sizes are represented by365struct :c:type:`v4l2_rect`.366 367Scaling support is optional. When supported by a subdev, the crop368rectangle on the subdev's sink pad is scaled to the size configured369using the370:ref:`VIDIOC_SUBDEV_S_SELECTION <VIDIOC_SUBDEV_G_SELECTION>` IOCTL371using ``V4L2_SEL_TGT_COMPOSE`` selection target on the same pad. If the372subdev supports scaling but not composing, the top and left values are373not used and must always be set to zero.374 375On source pads, cropping is similar to sink pads, with the exception376that the source size from which the cropping is performed, is the377COMPOSE rectangle on the sink pad. In both sink and source pads, the378crop rectangle must be entirely contained inside the source image size379for the crop operation.380 381The drivers should always use the closest possible rectangle the user382requests on all selection targets, unless specifically told otherwise.383``V4L2_SEL_FLAG_GE`` and ``V4L2_SEL_FLAG_LE`` flags may be used to round384the image size either up or down. :ref:`v4l2-selection-flags`385 386 387Types of selection targets388--------------------------389 390 391Actual targets392^^^^^^^^^^^^^^393 394Actual targets (without a postfix) reflect the actual hardware395configuration at any point of time. There is a BOUNDS target396corresponding to every actual target.397 398 399BOUNDS targets400^^^^^^^^^^^^^^401 402BOUNDS targets is the smallest rectangle that contains all valid actual403rectangles. It may not be possible to set the actual rectangle as large404as the BOUNDS rectangle, however. This may be because e.g. a sensor's405pixel array is not rectangular but cross-shaped or round. The maximum406size may also be smaller than the BOUNDS rectangle.407 408 409.. _format-propagation:410 411Order of configuration and format propagation412---------------------------------------------413 414Inside subdevs, the order of image processing steps will always be from415the sink pad towards the source pad. This is also reflected in the order416in which the configuration must be performed by the user: the changes417made will be propagated to any subsequent stages. If this behaviour is418not desired, the user must set ``V4L2_SEL_FLAG_KEEP_CONFIG`` flag. This419flag causes no propagation of the changes are allowed in any420circumstances. This may also cause the accessed rectangle to be adjusted421by the driver, depending on the properties of the underlying hardware.422 423The coordinates to a step always refer to the actual size of the424previous step. The exception to this rule is the sink compose425rectangle, which refers to the sink compose bounds rectangle --- if it426is supported by the hardware.427 4281. Sink pad format. The user configures the sink pad format. This format429 defines the parameters of the image the entity receives through the430 pad for further processing.431 4322. Sink pad actual crop selection. The sink pad crop defines the crop433 performed to the sink pad format.434 4353. Sink pad actual compose selection. The size of the sink pad compose436 rectangle defines the scaling ratio compared to the size of the sink437 pad crop rectangle. The location of the compose rectangle specifies438 the location of the actual sink compose rectangle in the sink compose439 bounds rectangle.440 4414. Source pad actual crop selection. Crop on the source pad defines crop442 performed to the image in the sink compose bounds rectangle.443 4445. Source pad format. The source pad format defines the output pixel445 format of the subdev, as well as the other parameters with the446 exception of the image width and height. Width and height are defined447 by the size of the source pad actual crop selection.448 449Accessing any of the above rectangles not supported by the subdev will450return ``EINVAL``. Any rectangle referring to a previous unsupported451rectangle coordinates will instead refer to the previous supported452rectangle. For example, if sink crop is not supported, the compose453selection will refer to the sink pad format dimensions instead.454 455 456.. _subdev-image-processing-crop:457 458.. kernel-figure:: subdev-image-processing-crop.svg459 :alt: subdev-image-processing-crop.svg460 :align: center461 462 **Figure 4.5. Image processing in subdevs: simple crop example**463 464In the above example, the subdev supports cropping on its sink pad. To465configure it, the user sets the media bus format on the subdev's sink466pad. Now the actual crop rectangle can be set on the sink pad --- the467location and size of this rectangle reflect the location and size of a468rectangle to be cropped from the sink format. The size of the sink crop469rectangle will also be the size of the format of the subdev's source470pad.471 472 473.. _subdev-image-processing-scaling-multi-source:474 475.. kernel-figure:: subdev-image-processing-scaling-multi-source.svg476 :alt: subdev-image-processing-scaling-multi-source.svg477 :align: center478 479 **Figure 4.6. Image processing in subdevs: scaling with multiple sources**480 481In this example, the subdev is capable of first cropping, then scaling482and finally cropping for two source pads individually from the resulting483scaled image. The location of the scaled image in the cropped image is484ignored in sink compose target. Both of the locations of the source crop485rectangles refer to the sink scaling rectangle, independently cropping486an area at location specified by the source crop rectangle from it.487 488 489.. _subdev-image-processing-full:490 491.. kernel-figure:: subdev-image-processing-full.svg492 :alt: subdev-image-processing-full.svg493 :align: center494 495 **Figure 4.7. Image processing in subdevs: scaling and composition with multiple sinks and sources**496 497The subdev driver supports two sink pads and two source pads. The images498from both of the sink pads are individually cropped, then scaled and499further composed on the composition bounds rectangle. From that, two500independent streams are cropped and sent out of the subdev from the501source pads.502 503 504.. toctree::505 :maxdepth: 1506 507 subdev-formats508 509.. _subdev-routing:510 511Streams, multiplexed media pads and internal routing512----------------------------------------------------513 514Simple V4L2 sub-devices do not support multiple, unrelated video streams,515and only a single stream can pass through a media link and a media pad.516Thus each pad contains a format and selection configuration for that517single stream. A subdev can do stream processing and split a stream into518two or compose two streams into one, but the inputs and outputs for the519subdev are still a single stream per pad.520 521Some hardware, e.g. MIPI CSI-2, support multiplexed streams, that is, multiple522data streams are transmitted on the same bus, which is represented by a media523link connecting a transmitter source pad with a sink pad on the receiver. For524example, a camera sensor can produce two distinct streams, a pixel stream and a525metadata stream, which are transmitted on the multiplexed data bus, represented526by a media link which connects the single sensor's source pad with the receiver527sink pad. The stream-aware receiver will de-multiplex the streams received on528the its sink pad and allows to route them individually to one of its source529pads.530 531Subdevice drivers that support multiplexed streams are compatible with532non-multiplexed subdev drivers. However, if the driver at the sink end of a link533does not support streams, then only stream 0 of source end may be captured.534There may be additional limitations specific to the sink device.535 536Understanding streams537^^^^^^^^^^^^^^^^^^^^^538 539A stream is a stream of content (e.g. pixel data or metadata) flowing through540the media pipeline from a source (e.g. a sensor) towards the final sink (e.g. a541receiver and demultiplexer in a SoC). Each media link carries all the enabled542streams from one end of the link to the other, and sub-devices have routing543tables which describe how the incoming streams from sink pads are routed to the544source pads.545 546A stream ID is a media pad-local identifier for a stream. Streams IDs of547the same stream must be equal on both ends of a link. In other words,548a particular stream ID must exist on both sides of a media549link, but another stream ID can be used for the same stream at the other side550of the sub-device.551 552A stream at a specific point in the media pipeline is identified by the553sub-device and a (pad, stream) pair. For sub-devices that do not support554multiplexed streams the 'stream' field is always 0.555 556Interaction between routes, streams, formats and selections557^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^558 559The addition of streams to the V4L2 sub-device interface moves the sub-device560formats and selections from pads to (pad, stream) pairs. Besides the561usual pad, also the stream ID needs to be provided for setting formats and562selections. The order of configuring formats and selections along a stream is563the same as without streams (see :ref:`format-propagation`).564 565Instead of the sub-device wide merging of streams from all sink pads566towards all source pads, data flows for each route are separate from each567other. Any number of routes from streams on sink pads towards streams on568source pads is allowed, to the extent supported by drivers. For every569stream on a source pad, however, only a single route is allowed.570 571Any configurations of a stream within a pad, such as format or selections,572are independent of similar configurations on other streams. This is573subject to change in the future.574 575Device types and routing setup576^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^577 578Different kinds of sub-devices have differing behaviour for route activation,579depending on the hardware. In all cases, however, only routes that have the580``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set are active.581 582Devices generating the streams may allow enabling and disabling some of the583routes or have a fixed routing configuration. If the routes can be disabled, not584declaring the routes (or declaring them without585``V4L2_SUBDEV_STREAM_FL_ACTIVE`` flag set) in ``VIDIOC_SUBDEV_S_ROUTING`` will586disable the routes. ``VIDIOC_SUBDEV_S_ROUTING`` will still return such routes587back to the user in the routes array, with the ``V4L2_SUBDEV_STREAM_FL_ACTIVE``588flag unset.589 590Devices transporting the streams almost always have more configurability with591respect to routing. Typically any route between the sub-device's sink and source592pads is possible, and multiple routes (usually up to certain limited number) may593be active simultaneously. For such devices, no routes are created by the driver594and user-created routes are fully replaced when ``VIDIOC_SUBDEV_S_ROUTING`` is595called on the sub-device. Such newly created routes have the device's default596configuration for format and selection rectangles.597 598Configuring streams599^^^^^^^^^^^^^^^^^^^600 601The configuration of the streams is done individually for each sub-device and602the validity of the streams between sub-devices is validated when the pipeline603is started.604 605There are three steps in configuring the streams:606 6071. Set up links. Connect the pads between sub-devices using the608 :ref:`Media Controller API <media_controller>`609 6102. Streams. Streams are declared and their routing is configured by setting the611 routing table for the sub-device using :ref:`VIDIOC_SUBDEV_S_ROUTING612 <VIDIOC_SUBDEV_G_ROUTING>` ioctl. Note that setting the routing table will613 reset formats and selections in the sub-device to default values.614 6153. Configure formats and selections. Formats and selections of each stream are616 configured separately as documented for plain sub-devices in617 :ref:`format-propagation`. The stream ID is set to the same stream ID618 associated with either sink or source pads of routes configured using the619 :ref:`VIDIOC_SUBDEV_S_ROUTING <VIDIOC_SUBDEV_G_ROUTING>` ioctl.620 621Multiplexed streams setup example622^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^623 624A simple example of a multiplexed stream setup might be as follows:625 626- Two identical sensors (Sensor A and Sensor B). Each sensor has a single source627 pad (pad 0) which carries a pixel data stream.628 629- Multiplexer bridge (Bridge). The bridge has two sink pads, connected to the630 sensors (pads 0, 1), and one source pad (pad 2), which outputs two streams.631 632- Receiver in the SoC (Receiver). The receiver has a single sink pad (pad 0),633 connected to the bridge, and two source pads (pads 1-2), going to the DMA634 engine. The receiver demultiplexes the incoming streams to the source pads.635 636- DMA Engines in the SoC (DMA Engine), one for each stream. Each DMA engine is637 connected to a single source pad in the receiver.638 639The sensors, the bridge and the receiver are modeled as V4L2 sub-devices,640exposed to userspace via /dev/v4l-subdevX device nodes. The DMA engines are641modeled as V4L2 devices, exposed to userspace via /dev/videoX nodes.642 643To configure this pipeline, the userspace must take the following steps:644 6451. Set up media links between entities: connect the sensors to the bridge,646 bridge to the receiver, and the receiver to the DMA engines. This step does647 not differ from normal non-multiplexed media controller setup.648 6492. Configure routing650 651.. flat-table:: Bridge routing table652 :header-rows: 1653 654 * - Sink Pad/Stream655 - Source Pad/Stream656 - Routing Flags657 - Comments658 * - 0/0659 - 2/0660 - V4L2_SUBDEV_ROUTE_FL_ACTIVE661 - Pixel data stream from Sensor A662 * - 1/0663 - 2/1664 - V4L2_SUBDEV_ROUTE_FL_ACTIVE665 - Pixel data stream from Sensor B666 667.. flat-table:: Receiver routing table668 :header-rows: 1669 670 * - Sink Pad/Stream671 - Source Pad/Stream672 - Routing Flags673 - Comments674 * - 0/0675 - 1/0676 - V4L2_SUBDEV_ROUTE_FL_ACTIVE677 - Pixel data stream from Sensor A678 * - 0/1679 - 2/0680 - V4L2_SUBDEV_ROUTE_FL_ACTIVE681 - Pixel data stream from Sensor B682 6833. Configure formats and selections684 685 After configuring routing, the next step is configuring the formats and686 selections for the streams. This is similar to performing this step without687 streams, with just one exception: the ``stream`` field needs to be assigned688 to the value of the stream ID.689 690 A common way to accomplish this is to start from the sensors and propagate691 the configurations along the stream towards the receiver, using692 :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctls to configure each693 stream endpoint in each sub-device.694