1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/userspace-api/media/fdl-appendix.rst.
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
12 **************************************
13 ioctl VIDIOC_G_AUDOUT, VIDIOC_S_AUDOUT
14 **************************************
19 VIDIOC_G_AUDOUT - VIDIOC_S_AUDOUT - Query or select the current audio output
25 .. c:function:: int ioctl( int fd, VIDIOC_G_AUDOUT, struct v4l2_audioout *argp )
26 :name: VIDIOC_G_AUDOUT
28 .. c:function:: int ioctl( int fd, VIDIOC_S_AUDOUT, const struct v4l2_audioout *argp )
29 :name: VIDIOC_S_AUDOUT
36 File descriptor returned by :ref:`open() <func-open>`.
39 Pointer to struct :c:type:`v4l2_audioout`.
45 To query the current audio output applications zero out the ``reserved``
46 array of a struct :c:type:`v4l2_audioout` and call the
47 ``VIDIOC_G_AUDOUT`` ioctl with a pointer to this structure. Drivers fill
48 the rest of the structure or return an ``EINVAL`` error code when the device
49 has no audio inputs, or none which combine with the current video
52 Audio outputs have no writable properties. Nevertheless, to select the
53 current audio output applications can initialize the ``index`` field and
54 ``reserved`` array (which in the future may contain writable properties)
55 of a struct :c:type:`v4l2_audioout` structure and call the
56 ``VIDIOC_S_AUDOUT`` ioctl. Drivers switch to the requested output or
57 return the ``EINVAL`` error code when the index is out of bounds. This is a
58 write-only ioctl, it does not return the current audio output attributes
59 as ``VIDIOC_G_AUDOUT`` does.
63 Connectors on a TV card to loop back the received audio signal
64 to a sound card are not audio outputs in this sense.
67 .. c:type:: v4l2_audioout
69 .. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
71 .. flat-table:: struct v4l2_audioout
78 - Identifies the audio output, set by the driver or application.
81 - Name of the audio output, a NUL-terminated ASCII string, for
82 example: "Line Out". This information is intended for the user,
83 preferably the connector label on the device itself.
86 - Audio capability flags, none defined yet. Drivers must set this
90 - Audio mode, none defined yet. Drivers and applications (on
91 ``VIDIOC_S_AUDOUT``) must set this field to zero.
94 - Reserved for future extensions. Drivers and applications must set
101 On success 0 is returned, on error -1 and the ``errno`` variable is set
102 appropriately. The generic error codes are described at the
103 :ref:`Generic Error Codes <gen-errors>` chapter.
106 No audio outputs combine with the current video output, or the
107 number of the selected audio output is out of bounds or it does not