1 <refentry id="vidioc-g-audio">
3 <refentrytitle>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</refentrytitle>
8 <refname>VIDIOC_G_AUDIO</refname>
9 <refname>VIDIOC_S_AUDIO</refname>
10 <refpurpose>Query or select the current audio input and its
11 attributes</refpurpose>
17 <funcdef>int <function>ioctl</function></funcdef>
18 <paramdef>int <parameter>fd</parameter></paramdef>
19 <paramdef>int <parameter>request</parameter></paramdef>
20 <paramdef>struct v4l2_audio *<parameter>argp</parameter></paramdef>
25 <funcdef>int <function>ioctl</function></funcdef>
26 <paramdef>int <parameter>fd</parameter></paramdef>
27 <paramdef>int <parameter>request</parameter></paramdef>
28 <paramdef>const struct v4l2_audio *<parameter>argp</parameter></paramdef>
34 <title>Arguments</title>
38 <term><parameter>fd</parameter></term>
44 <term><parameter>request</parameter></term>
46 <para>VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</para>
50 <term><parameter>argp</parameter></term>
59 <title>Description</title>
61 <para>To query the current audio input applications zero out the
62 <structfield>reserved</structfield> array of a &v4l2-audio;
63 and call the <constant>VIDIOC_G_AUDIO</constant> ioctl with a pointer
64 to this structure. Drivers fill the rest of the structure or return an
65 &EINVAL; when the device has no audio inputs, or none which combine
66 with the current video input.</para>
68 <para>Audio inputs have one writable property, the audio mode. To
69 select the current audio input <emphasis>and</emphasis> change the
70 audio mode, applications initialize the
71 <structfield>index</structfield> and <structfield>mode</structfield>
73 <structfield>reserved</structfield> array of a
74 <structname>v4l2_audio</structname> structure and call the
75 <constant>VIDIOC_S_AUDIO</constant> ioctl. Drivers may switch to a
76 different audio mode if the request cannot be satisfied. However, this
77 is a write-only ioctl, it does not return the actual new audio
80 <table pgwide="1" frame="none" id="v4l2-audio">
81 <title>struct <structname>v4l2_audio</structname></title>
87 <entry><structfield>index</structfield></entry>
88 <entry>Identifies the audio input, set by the
89 driver or application.</entry>
93 <entry><structfield>name</structfield>[32]</entry>
94 <entry>Name of the audio input, a NUL-terminated ASCII
95 string, for example: "Line In". This information is intended for the
96 user, preferably the connector label on the device itself.</entry>
100 <entry><structfield>capability</structfield></entry>
101 <entry>Audio capability flags, see <xref
102 linkend="audio-capability" />.</entry>
106 <entry><structfield>mode</structfield></entry>
107 <entry>Audio mode flags set by drivers and applications (on
108 <constant>VIDIOC_S_AUDIO</constant> ioctl), see <xref linkend="audio-mode" />.</entry>
112 <entry><structfield>reserved</structfield>[2]</entry>
113 <entry>Reserved for future extensions. Drivers and
114 applications must set the array to zero.</entry>
120 <table pgwide="1" frame="none" id="audio-capability">
121 <title>Audio Capability Flags</title>
126 <entry><constant>V4L2_AUDCAP_STEREO</constant></entry>
127 <entry>0x00001</entry>
128 <entry>This is a stereo input. The flag is intended to
129 automatically disable stereo recording etc. when the signal is always
130 monaural. The API provides no means to detect if stereo is
131 <emphasis>received</emphasis>, unless the audio input belongs to a
135 <entry><constant>V4L2_AUDCAP_AVL</constant></entry>
136 <entry>0x00002</entry>
137 <entry>Automatic Volume Level mode is supported.</entry>
143 <table pgwide="1" frame="none" id="audio-mode">
144 <title>Audio Mode Flags</title>
149 <entry><constant>V4L2_AUDMODE_AVL</constant></entry>
150 <entry>0x00001</entry>
151 <entry>AVL mode is on.</entry>
163 <term><errorcode>EINVAL</errorcode></term>
165 <para>No audio inputs combine with the current video input,
166 or the number of the selected audio input is out of bounds or it does
167 not combine, or there are no audio inputs at all and the ioctl is not
172 <term><errorcode>EBUSY</errorcode></term>
174 <para>I/O is in progress, the input cannot be
185 sgml-parent-document: "v4l2.sgml"
186 indent-tabs-mode: nil