GNU Linux-libre 6.1.90-gnu
[releases.git] / Documentation / userspace-api / media / v4l / vidioc-g-ext-ctrls.rst
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_G_EXT_CTRLS:
5
6 ******************************************************************
7 ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, VIDIOC_TRY_EXT_CTRLS
8 ******************************************************************
9
10 Name
11 ====
12
13 VIDIOC_G_EXT_CTRLS - VIDIOC_S_EXT_CTRLS - VIDIOC_TRY_EXT_CTRLS - Get or set the value of several controls, try control values
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_G_EXT_CTRLS
19
20 ``int ioctl(int fd, VIDIOC_G_EXT_CTRLS, struct v4l2_ext_controls *argp)``
21
22 .. c:macro:: VIDIOC_S_EXT_CTRLS
23
24 ``int ioctl(int fd, VIDIOC_S_EXT_CTRLS, struct v4l2_ext_controls *argp)``
25
26 .. c:macro:: VIDIOC_TRY_EXT_CTRLS
27
28 ``int ioctl(int fd, VIDIOC_TRY_EXT_CTRLS, struct v4l2_ext_controls *argp)``
29
30 Arguments
31 =========
32
33 ``fd``
34     File descriptor returned by :c:func:`open()`.
35
36 ``argp``
37     Pointer to struct :c:type:`v4l2_ext_controls`.
38
39 Description
40 ===========
41
42 These ioctls allow the caller to get or set multiple controls
43 atomically. Control IDs are grouped into control classes (see
44 :ref:`ctrl-class`) and all controls in the control array must belong
45 to the same control class.
46
47 Applications must always fill in the ``count``, ``which``, ``controls``
48 and ``reserved`` fields of struct
49 :c:type:`v4l2_ext_controls`, and initialize the
50 struct :c:type:`v4l2_ext_control` array pointed to
51 by the ``controls`` fields.
52
53 To get the current value of a set of controls applications initialize
54 the ``id``, ``size`` and ``reserved2`` fields of each struct
55 :c:type:`v4l2_ext_control` and call the
56 :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. String controls must also set the
57 ``string`` field. Controls of compound types
58 (``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is set) must set the ``ptr`` field.
59
60 If the ``size`` is too small to receive the control result (only
61 relevant for pointer-type controls like strings), then the driver will
62 set ``size`` to a valid value and return an ``ENOSPC`` error code. You
63 should re-allocate the memory to this new size and try again. For the
64 string type it is possible that the same issue occurs again if the
65 string has grown in the meantime. It is recommended to call
66 :ref:`VIDIOC_QUERYCTRL` first and use
67 ``maximum``\ +1 as the new ``size`` value. It is guaranteed that that is
68 sufficient memory.
69
70 N-dimensional arrays are set and retrieved row-by-row. You cannot set a
71 partial array, all elements have to be set or retrieved. The total size
72 is calculated as ``elems`` * ``elem_size``. These values can be obtained
73 by calling :ref:`VIDIOC_QUERY_EXT_CTRL <VIDIOC_QUERYCTRL>`.
74
75 To change the value of a set of controls applications initialize the
76 ``id``, ``size``, ``reserved2`` and ``value/value64/string/ptr`` fields
77 of each struct :c:type:`v4l2_ext_control` and call
78 the :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. The controls will only be set if *all*
79 control values are valid.
80
81 To check if a set of controls have correct values applications
82 initialize the ``id``, ``size``, ``reserved2`` and
83 ``value/value64/string/ptr`` fields of each struct
84 :c:type:`v4l2_ext_control` and call the
85 :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. It is up to the driver whether wrong
86 values are automatically adjusted to a valid value or if an error is
87 returned.
88
89 When the ``id`` or ``which`` is invalid drivers return an ``EINVAL`` error
90 code. When the value is out of bounds drivers can choose to take the
91 closest valid value or return an ``ERANGE`` error code, whatever seems more
92 appropriate. In the first case the new value is set in struct
93 :c:type:`v4l2_ext_control`. If the new control value
94 is inappropriate (e.g. the given menu index is not supported by the menu
95 control), then this will also result in an ``EINVAL`` error code error.
96
97 If ``request_fd`` is set to a not-yet-queued :ref:`request <media-request-api>`
98 file descriptor and ``which`` is set to ``V4L2_CTRL_WHICH_REQUEST_VAL``,
99 then the controls are not applied immediately when calling
100 :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`, but instead are applied by
101 the driver for the buffer associated with the same request.
102 If the device does not support requests, then ``EACCES`` will be returned.
103 If requests are supported but an invalid request file descriptor is given,
104 then ``EINVAL`` will be returned.
105
106 An attempt to call :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` for a
107 request that has already been queued will result in an ``EBUSY`` error.
108
109 If ``request_fd`` is specified and ``which`` is set to
110 ``V4L2_CTRL_WHICH_REQUEST_VAL`` during a call to
111 :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`, then it will return the
112 values of the controls at the time of request completion.
113 If the request is not yet completed, then this will result in an
114 ``EACCES`` error.
115
116 The driver will only set/get these controls if all control values are
117 correct. This prevents the situation where only some of the controls
118 were set/get. Only low-level errors (e. g. a failed i2c command) can
119 still cause this situation.
120
121 .. tabularcolumns:: |p{6.8cm}|p{4.0cm}|p{6.5cm}|
122
123 .. c:type:: v4l2_ext_control
124
125 .. raw:: latex
126
127    \footnotesize
128
129 .. cssclass:: longtable
130
131 .. flat-table:: struct v4l2_ext_control
132     :header-rows:  0
133     :stub-columns: 0
134     :widths:       1 1 2
135
136     * - __u32
137       - ``id``
138       - Identifies the control, set by the application.
139     * - __u32
140       - ``size``
141       - The total size in bytes of the payload of this control.
142     * - :cspan:`2` The ``size`` field is normally 0, but for pointer
143         controls this should be set to the size of the memory that contains
144         the payload or that will receive the payload.
145         If :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` finds that this value
146         is less than is required to store the payload result, then it is set
147         to a value large enough to store the payload result and ``ENOSPC`` is
148         returned.
149
150         .. note::
151
152            For string controls, this ``size`` field should
153            not be confused with the length of the string. This field refers
154            to the size of the memory that contains the string. The actual
155            *length* of the string may well be much smaller.
156     * - __u32
157       - ``reserved2``\ [1]
158       - Reserved for future extensions. Drivers and applications must set
159         the array to zero.
160     * - union {
161       - (anonymous)
162     * - __s32
163       - ``value``
164       - New value or current value. Valid if this control is not of type
165         ``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is
166         not set.
167     * - __s64
168       - ``value64``
169       - New value or current value. Valid if this control is of type
170         ``V4L2_CTRL_TYPE_INTEGER64`` and ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is
171         not set.
172     * - char *
173       - ``string``
174       - A pointer to a string. Valid if this control is of type
175         ``V4L2_CTRL_TYPE_STRING``.
176     * - __u8 *
177       - ``p_u8``
178       - A pointer to a matrix control of unsigned 8-bit values. Valid if
179         this control is of type ``V4L2_CTRL_TYPE_U8``.
180     * - __u16 *
181       - ``p_u16``
182       - A pointer to a matrix control of unsigned 16-bit values. Valid if
183         this control is of type ``V4L2_CTRL_TYPE_U16``.
184     * - __u32 *
185       - ``p_u32``
186       - A pointer to a matrix control of unsigned 32-bit values. Valid if
187         this control is of type ``V4L2_CTRL_TYPE_U32``.
188     * - struct :c:type:`v4l2_area` *
189       - ``p_area``
190       - A pointer to a struct :c:type:`v4l2_area`. Valid if this control is
191         of type ``V4L2_CTRL_TYPE_AREA``.
192     * - struct :c:type:`v4l2_ctrl_h264_sps` *
193       - ``p_h264_sps``
194       - A pointer to a struct :c:type:`v4l2_ctrl_h264_sps`. Valid if this control is
195         of type ``V4L2_CTRL_TYPE_H264_SPS``.
196     * - struct :c:type:`v4l2_ctrl_h264_pps` *
197       - ``p_h264_pps``
198       - A pointer to a struct :c:type:`v4l2_ctrl_h264_pps`. Valid if this control is
199         of type ``V4L2_CTRL_TYPE_H264_PPS``.
200     * - struct :c:type:`v4l2_ctrl_h264_scaling_matrix` *
201       - ``p_h264_scaling_matrix``
202       - A pointer to a struct :c:type:`v4l2_ctrl_h264_scaling_matrix`. Valid if this control is
203         of type ``V4L2_CTRL_TYPE_H264_SCALING_MATRIX``.
204     * - struct :c:type:`v4l2_ctrl_h264_pred_weights` *
205       - ``p_h264_pred_weights``
206       - A pointer to a struct :c:type:`v4l2_ctrl_h264_pred_weights`. Valid if this control is
207         of type ``V4L2_CTRL_TYPE_H264_PRED_WEIGHTS``.
208     * - struct :c:type:`v4l2_ctrl_h264_slice_params` *
209       - ``p_h264_slice_params``
210       - A pointer to a struct :c:type:`v4l2_ctrl_h264_slice_params`. Valid if this control is
211         of type ``V4L2_CTRL_TYPE_H264_SLICE_PARAMS``.
212     * - struct :c:type:`v4l2_ctrl_h264_decode_params` *
213       - ``p_h264_decode_params``
214       - A pointer to a struct :c:type:`v4l2_ctrl_h264_decode_params`. Valid if this control is
215         of type ``V4L2_CTRL_TYPE_H264_DECODE_PARAMS``.
216     * - struct :c:type:`v4l2_ctrl_fwht_params` *
217       - ``p_fwht_params``
218       - A pointer to a struct :c:type:`v4l2_ctrl_fwht_params`. Valid if this control is
219         of type ``V4L2_CTRL_TYPE_FWHT_PARAMS``.
220     * - struct :c:type:`v4l2_ctrl_vp8_frame` *
221       - ``p_vp8_frame``
222       - A pointer to a struct :c:type:`v4l2_ctrl_vp8_frame`. Valid if this control is
223         of type ``V4L2_CTRL_TYPE_VP8_FRAME``.
224     * - struct :c:type:`v4l2_ctrl_mpeg2_sequence` *
225       - ``p_mpeg2_sequence``
226       - A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_sequence`. Valid if this control is
227         of type ``V4L2_CTRL_TYPE_MPEG2_SEQUENCE``.
228     * - struct :c:type:`v4l2_ctrl_mpeg2_picture` *
229       - ``p_mpeg2_picture``
230       - A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_picture`. Valid if this control is
231         of type ``V4L2_CTRL_TYPE_MPEG2_PICTURE``.
232     * - struct :c:type:`v4l2_ctrl_mpeg2_quantisation` *
233       - ``p_mpeg2_quantisation``
234       - A pointer to a struct :c:type:`v4l2_ctrl_mpeg2_quantisation`. Valid if this control is
235         of type ``V4L2_CTRL_TYPE_MPEG2_QUANTISATION``.
236     * - struct :c:type:`v4l2_ctrl_vp9_compressed_hdr` *
237       - ``p_vp9_compressed_hdr_probs``
238       - A pointer to a struct :c:type:`v4l2_ctrl_vp9_compressed_hdr`. Valid if this
239         control is of type ``V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR``.
240     * - struct :c:type:`v4l2_ctrl_vp9_frame` *
241       - ``p_vp9_frame``
242       - A pointer to a struct :c:type:`v4l2_ctrl_vp9_frame`. Valid if this
243         control is of type ``V4L2_CTRL_TYPE_VP9_FRAME``.
244     * - struct :c:type:`v4l2_ctrl_hdr10_cll_info` *
245       - ``p_hdr10_cll``
246       - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_cll_info`. Valid if this control is
247         of type ``V4L2_CTRL_TYPE_HDR10_CLL_INFO``.
248     * - struct :c:type:`v4l2_ctrl_hdr10_mastering_display` *
249       - ``p_hdr10_mastering``
250       - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_mastering_display`. Valid if this control is
251         of type ``V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY``.
252     * - struct :c:type:`v4l2_ctrl_hevc_sps` *
253       - ``p_hevc_sps``
254       - A pointer to a struct :c:type:`v4l2_ctrl_hevc_sps`. Valid if this
255         control is of type ``V4L2_CTRL_TYPE_HEVC_SPS``.
256     * - struct :c:type:`v4l2_ctrl_hevc_pps` *
257       - ``p_hevc_pps``
258       - A pointer to a struct :c:type:`v4l2_ctrl_hevc_pps`. Valid if this
259         control is of type ``V4L2_CTRL_TYPE_HEVC_PPS``.
260     * - struct :c:type:`v4l2_ctrl_hevc_slice_params` *
261       - ``p_hevc_slice_params``
262       - A pointer to a struct :c:type:`v4l2_ctrl_hevc_slice_params`. Valid if this
263         control is of type ``V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS``.
264     * - struct :c:type:`v4l2_ctrl_hevc_scaling_matrix` *
265       - ``p_hevc_scaling_matrix``
266       - A pointer to a struct :c:type:`v4l2_ctrl_hevc_scaling_matrix`. Valid if this
267         control is of type ``V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX``.
268     * - struct :c:type:`v4l2_ctrl_hevc_decode_params` *
269       - ``p_hevc_decode_params``
270       - A pointer to a struct :c:type:`v4l2_ctrl_hevc_decode_params`. Valid if this
271         control is of type ``V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS``.
272     * - void *
273       - ``ptr``
274       - A pointer to a compound type which can be an N-dimensional array
275         and/or a compound type (the control's type is >=
276         ``V4L2_CTRL_COMPOUND_TYPES``). Valid if
277         ``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is set for this control.
278     * - }
279       -
280
281 .. raw:: latex
282
283    \normalsize
284
285 .. tabularcolumns:: |p{4.0cm}|p{2.5cm}|p{10.8cm}|
286
287 .. c:type:: v4l2_ext_controls
288
289 .. cssclass:: longtable
290
291 .. flat-table:: struct v4l2_ext_controls
292     :header-rows:  0
293     :stub-columns: 0
294     :widths:       1 1 2
295
296     * - union {
297       - (anonymous)
298     * - __u32
299       - ``which``
300       - Which value of the control to get/set/try.
301     * - :cspan:`2` ``V4L2_CTRL_WHICH_CUR_VAL`` will return the current value of
302         the control, ``V4L2_CTRL_WHICH_DEF_VAL`` will return the default
303         value of the control and ``V4L2_CTRL_WHICH_REQUEST_VAL`` indicates that
304         these controls have to be retrieved from a request or tried/set for
305         a request. In the latter case the ``request_fd`` field contains the
306         file descriptor of the request that should be used. If the device
307         does not support requests, then ``EACCES`` will be returned.
308
309         When using ``V4L2_CTRL_WHICH_DEF_VAL`` be aware that you can only
310         get the default value of the control, you cannot set or try it.
311
312         For backwards compatibility you can also use a control class here
313         (see :ref:`ctrl-class`). In that case all controls have to
314         belong to that control class. This usage is deprecated, instead
315         just use ``V4L2_CTRL_WHICH_CUR_VAL``. There are some very old
316         drivers that do not yet support ``V4L2_CTRL_WHICH_CUR_VAL`` and
317         that require a control class here. You can test for such drivers
318         by setting ``which`` to ``V4L2_CTRL_WHICH_CUR_VAL`` and calling
319         :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` with a count of 0.
320         If that fails, then the driver does not support ``V4L2_CTRL_WHICH_CUR_VAL``.
321     * - __u32
322       - ``ctrl_class``
323       - Deprecated name kept for backwards compatibility. Use ``which`` instead.
324     * - }
325       -
326     * - __u32
327       - ``count``
328       - The number of controls in the controls array. May also be zero.
329     * - __u32
330       - ``error_idx``
331       - Index of the failing control. Set by the driver in case of an error.
332     * - :cspan:`2` If the error is associated
333         with a particular control, then ``error_idx`` is set to the index
334         of that control. If the error is not related to a specific
335         control, or the validation step failed (see below), then
336         ``error_idx`` is set to ``count``. The value is undefined if the
337         ioctl returned 0 (success).
338
339         Before controls are read from/written to hardware a validation
340         step takes place: this checks if all controls in the list are
341         valid controls, if no attempt is made to write to a read-only
342         control or read from a write-only control, and any other up-front
343         checks that can be done without accessing the hardware. The exact
344         validations done during this step are driver dependent since some
345         checks might require hardware access for some devices, thus making
346         it impossible to do those checks up-front. However, drivers should
347         make a best-effort to do as many up-front checks as possible.
348
349         This check is done to avoid leaving the hardware in an
350         inconsistent state due to easy-to-avoid problems. But it leads to
351         another problem: the application needs to know whether an error
352         came from the validation step (meaning that the hardware was not
353         touched) or from an error during the actual reading from/writing
354         to hardware.
355
356         The, in hindsight quite poor, solution for that is to set
357         ``error_idx`` to ``count`` if the validation failed. This has the
358         unfortunate side-effect that it is not possible to see which
359         control failed the validation. If the validation was successful
360         and the error happened while accessing the hardware, then
361         ``error_idx`` is less than ``count`` and only the controls up to
362         ``error_idx-1`` were read or written correctly, and the state of
363         the remaining controls is undefined.
364
365         Since :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` does not access hardware there is
366         also no need to handle the validation step in this special way, so
367         ``error_idx`` will just be set to the control that failed the
368         validation step instead of to ``count``. This means that if
369         :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` fails with ``error_idx`` set to ``count``,
370         then you can call :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` to try to discover the
371         actual control that failed the validation step. Unfortunately,
372         there is no ``TRY`` equivalent for :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>`.
373     * - __s32
374       - ``request_fd``
375       - File descriptor of the request to be used by this operation. Only
376         valid if ``which`` is set to ``V4L2_CTRL_WHICH_REQUEST_VAL``.
377         If the device does not support requests, then ``EACCES`` will be returned.
378         If requests are supported but an invalid request file descriptor is
379         given, then ``EINVAL`` will be returned.
380     * - __u32
381       - ``reserved``\ [1]
382       - Reserved for future extensions.
383
384         Drivers and applications must set the array to zero.
385     * - struct :c:type:`v4l2_ext_control` *
386       - ``controls``
387       - Pointer to an array of ``count`` v4l2_ext_control structures.
388
389         Ignored if ``count`` equals zero.
390
391 .. tabularcolumns:: |p{7.3cm}|p{2.0cm}|p{8.0cm}|
392
393 .. cssclass:: longtable
394
395 .. _ctrl-class:
396
397 .. flat-table:: Control classes
398     :header-rows:  0
399     :stub-columns: 0
400     :widths:       3 1 4
401
402     * - ``V4L2_CTRL_CLASS_USER``
403       - 0x980000
404       - The class containing user controls. These controls are described
405         in :ref:`control`. All controls that can be set using the
406         :ref:`VIDIOC_S_CTRL <VIDIOC_G_CTRL>` and
407         :ref:`VIDIOC_G_CTRL <VIDIOC_G_CTRL>` ioctl belong to this
408         class.
409     * - ``V4L2_CTRL_CLASS_CODEC``
410       - 0x990000
411       - The class containing stateful codec controls. These controls are
412         described in :ref:`codec-controls`.
413     * - ``V4L2_CTRL_CLASS_CAMERA``
414       - 0x9a0000
415       - The class containing camera controls. These controls are described
416         in :ref:`camera-controls`.
417     * - ``V4L2_CTRL_CLASS_FM_TX``
418       - 0x9b0000
419       - The class containing FM Transmitter (FM TX) controls. These
420         controls are described in :ref:`fm-tx-controls`.
421     * - ``V4L2_CTRL_CLASS_FLASH``
422       - 0x9c0000
423       - The class containing flash device controls. These controls are
424         described in :ref:`flash-controls`.
425     * - ``V4L2_CTRL_CLASS_JPEG``
426       - 0x9d0000
427       - The class containing JPEG compression controls. These controls are
428         described in :ref:`jpeg-controls`.
429     * - ``V4L2_CTRL_CLASS_IMAGE_SOURCE``
430       - 0x9e0000
431       - The class containing image source controls. These controls are
432         described in :ref:`image-source-controls`.
433     * - ``V4L2_CTRL_CLASS_IMAGE_PROC``
434       - 0x9f0000
435       - The class containing image processing controls. These controls are
436         described in :ref:`image-process-controls`.
437     * - ``V4L2_CTRL_CLASS_FM_RX``
438       - 0xa10000
439       - The class containing FM Receiver (FM RX) controls. These controls
440         are described in :ref:`fm-rx-controls`.
441     * - ``V4L2_CTRL_CLASS_RF_TUNER``
442       - 0xa20000
443       - The class containing RF tuner controls. These controls are
444         described in :ref:`rf-tuner-controls`.
445     * - ``V4L2_CTRL_CLASS_DETECT``
446       - 0xa30000
447       - The class containing motion or object detection controls. These controls
448         are described in :ref:`detect-controls`.
449     * - ``V4L2_CTRL_CLASS_CODEC_STATELESS``
450       - 0xa40000
451       - The class containing stateless codec controls. These controls are
452         described in :ref:`codec-stateless-controls`.
453     * - ``V4L2_CTRL_CLASS_COLORIMETRY``
454       - 0xa50000
455       - The class containing colorimetry controls. These controls are
456         described in :ref:`colorimetry-controls`.
457
458 Return Value
459 ============
460
461 On success 0 is returned, on error -1 and the ``errno`` variable is set
462 appropriately. The generic error codes are described at the
463 :ref:`Generic Error Codes <gen-errors>` chapter.
464
465 EINVAL
466     The struct :c:type:`v4l2_ext_control` ``id`` is
467     invalid, or the struct :c:type:`v4l2_ext_controls`
468     ``which`` is invalid, or the struct
469     :c:type:`v4l2_ext_control` ``value`` was
470     inappropriate (e.g. the given menu index is not supported by the
471     driver), or the ``which`` field was set to ``V4L2_CTRL_WHICH_REQUEST_VAL``
472     but the given ``request_fd`` was invalid or ``V4L2_CTRL_WHICH_REQUEST_VAL``
473     is not supported by the kernel.
474     This error code is also returned by the
475     :ref:`VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` and :ref:`VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctls if two or
476     more control values are in conflict.
477
478 ERANGE
479     The struct :c:type:`v4l2_ext_control` ``value``
480     is out of bounds.
481
482 EBUSY
483     The control is temporarily not changeable, possibly because another
484     applications took over control of the device function this control
485     belongs to, or (if the ``which`` field was set to
486     ``V4L2_CTRL_WHICH_REQUEST_VAL``) the request was queued but not yet
487     completed.
488
489 ENOSPC
490     The space reserved for the control's payload is insufficient. The
491     field ``size`` is set to a value that is enough to store the payload
492     and this error code is returned.
493
494 EACCES
495     Attempt to try or set a read-only control, or to get a write-only
496     control, or to get a control from a request that has not yet been
497     completed.
498
499     Or the ``which`` field was set to ``V4L2_CTRL_WHICH_REQUEST_VAL`` but the
500     device does not support requests.
501
502     Or if there is an attempt to set an inactive control and the driver is
503     not capable of caching the new value until the control is active again.