vidioc-g-audio.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <refentry id="vidioc-g-audio">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_G_AUDIO</refname>
  8. <refname>VIDIOC_S_AUDIO</refname>
  9. <refpurpose>Query or select the current audio input and its
  10. attributes</refpurpose>
  11. </refnamediv>
  12. <refsynopsisdiv>
  13. <funcsynopsis>
  14. <funcprototype>
  15. <funcdef>int <function>ioctl</function></funcdef>
  16. <paramdef>int <parameter>fd</parameter></paramdef>
  17. <paramdef>int <parameter>request</parameter></paramdef>
  18. <paramdef>struct v4l2_audio *<parameter>argp</parameter></paramdef>
  19. </funcprototype>
  20. </funcsynopsis>
  21. <funcsynopsis>
  22. <funcprototype>
  23. <funcdef>int <function>ioctl</function></funcdef>
  24. <paramdef>int <parameter>fd</parameter></paramdef>
  25. <paramdef>int <parameter>request</parameter></paramdef>
  26. <paramdef>const struct v4l2_audio *<parameter>argp</parameter></paramdef>
  27. </funcprototype>
  28. </funcsynopsis>
  29. </refsynopsisdiv>
  30. <refsect1>
  31. <title>Arguments</title>
  32. <variablelist>
  33. <varlistentry>
  34. <term><parameter>fd</parameter></term>
  35. <listitem>
  36. <para>&fd;</para>
  37. </listitem>
  38. </varlistentry>
  39. <varlistentry>
  40. <term><parameter>request</parameter></term>
  41. <listitem>
  42. <para>VIDIOC_G_AUDIO, VIDIOC_S_AUDIO</para>
  43. </listitem>
  44. </varlistentry>
  45. <varlistentry>
  46. <term><parameter>argp</parameter></term>
  47. <listitem>
  48. <para></para>
  49. </listitem>
  50. </varlistentry>
  51. </variablelist>
  52. </refsect1>
  53. <refsect1>
  54. <title>Description</title>
  55. <para>To query the current audio input applications zero out the
  56. <structfield>reserved</structfield> array of a &v4l2-audio;
  57. and call the <constant>VIDIOC_G_AUDIO</constant> ioctl with a pointer
  58. to this structure. Drivers fill the rest of the structure or return an
  59. &EINVAL; when the device has no audio inputs, or none which combine
  60. with the current video input.</para>
  61. <para>Audio inputs have one writable property, the audio mode. To
  62. select the current audio input <emphasis>and</emphasis> change the
  63. audio mode, applications initialize the
  64. <structfield>index</structfield> and <structfield>mode</structfield>
  65. fields, and the
  66. <structfield>reserved</structfield> array of a
  67. <structname>v4l2_audio</structname> structure and call the
  68. <constant>VIDIOC_S_AUDIO</constant> ioctl. Drivers may switch to a
  69. different audio mode if the request cannot be satisfied. However, this
  70. is a write-only ioctl, it does not return the actual new audio
  71. mode.</para>
  72. <table pgwide="1" frame="none" id="v4l2-audio">
  73. <title>struct <structname>v4l2_audio</structname></title>
  74. <tgroup cols="3">
  75. &cs-str;
  76. <tbody valign="top">
  77. <row>
  78. <entry>__u32</entry>
  79. <entry><structfield>index</structfield></entry>
  80. <entry>Identifies the audio input, set by the
  81. driver or application.</entry>
  82. </row>
  83. <row>
  84. <entry>__u8</entry>
  85. <entry><structfield>name</structfield>[32]</entry>
  86. <entry>Name of the audio input, a NUL-terminated ASCII
  87. string, for example: "Line In". This information is intended for the
  88. user, preferably the connector label on the device itself.</entry>
  89. </row>
  90. <row>
  91. <entry>__u32</entry>
  92. <entry><structfield>capability</structfield></entry>
  93. <entry>Audio capability flags, see <xref
  94. linkend="audio-capability" />.</entry>
  95. </row>
  96. <row>
  97. <entry>__u32</entry>
  98. <entry><structfield>mode</structfield></entry>
  99. <entry>Audio mode flags set by drivers and applications (on
  100. <constant>VIDIOC_S_AUDIO</constant> ioctl), see <xref linkend="audio-mode" />.</entry>
  101. </row>
  102. <row>
  103. <entry>__u32</entry>
  104. <entry><structfield>reserved</structfield>[2]</entry>
  105. <entry>Reserved for future extensions. Drivers and
  106. applications must set the array to zero.</entry>
  107. </row>
  108. </tbody>
  109. </tgroup>
  110. </table>
  111. <table pgwide="1" frame="none" id="audio-capability">
  112. <title>Audio Capability Flags</title>
  113. <tgroup cols="3">
  114. &cs-def;
  115. <tbody valign="top">
  116. <row>
  117. <entry><constant>V4L2_AUDCAP_STEREO</constant></entry>
  118. <entry>0x00001</entry>
  119. <entry>This is a stereo input. The flag is intended to
  120. automatically disable stereo recording etc. when the signal is always
  121. monaural. The API provides no means to detect if stereo is
  122. <emphasis>received</emphasis>, unless the audio input belongs to a
  123. tuner.</entry>
  124. </row>
  125. <row>
  126. <entry><constant>V4L2_AUDCAP_AVL</constant></entry>
  127. <entry>0x00002</entry>
  128. <entry>Automatic Volume Level mode is supported.</entry>
  129. </row>
  130. </tbody>
  131. </tgroup>
  132. </table>
  133. <table pgwide="1" frame="none" id="audio-mode">
  134. <title>Audio Mode Flags</title>
  135. <tgroup cols="3">
  136. &cs-def;
  137. <tbody valign="top">
  138. <row>
  139. <entry><constant>V4L2_AUDMODE_AVL</constant></entry>
  140. <entry>0x00001</entry>
  141. <entry>AVL mode is on.</entry>
  142. </row>
  143. </tbody>
  144. </tgroup>
  145. </table>
  146. </refsect1>
  147. <refsect1>
  148. &return-value;
  149. <variablelist>
  150. <varlistentry>
  151. <term><errorcode>EINVAL</errorcode></term>
  152. <listitem>
  153. <para>No audio inputs combine with the current video input,
  154. or the number of the selected audio input is out of bounds or it does
  155. not combine.</para>
  156. </listitem>
  157. </varlistentry>
  158. </variablelist>
  159. </refsect1>
  160. </refentry>