vidioc-g-modulator.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <refentry id="vidioc-g-modulator">
  2. <refmeta>
  3. <refentrytitle>ioctl VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</refentrytitle>
  4. &manvol;
  5. </refmeta>
  6. <refnamediv>
  7. <refname>VIDIOC_G_MODULATOR</refname>
  8. <refname>VIDIOC_S_MODULATOR</refname>
  9. <refpurpose>Get or set modulator attributes</refpurpose>
  10. </refnamediv>
  11. <refsynopsisdiv>
  12. <funcsynopsis>
  13. <funcprototype>
  14. <funcdef>int <function>ioctl</function></funcdef>
  15. <paramdef>int <parameter>fd</parameter></paramdef>
  16. <paramdef>int <parameter>request</parameter></paramdef>
  17. <paramdef>struct v4l2_modulator
  18. *<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_modulator
  27. *<parameter>argp</parameter></paramdef>
  28. </funcprototype>
  29. </funcsynopsis>
  30. </refsynopsisdiv>
  31. <refsect1>
  32. <title>Arguments</title>
  33. <variablelist>
  34. <varlistentry>
  35. <term><parameter>fd</parameter></term>
  36. <listitem>
  37. <para>&fd;</para>
  38. </listitem>
  39. </varlistentry>
  40. <varlistentry>
  41. <term><parameter>request</parameter></term>
  42. <listitem>
  43. <para>VIDIOC_G_MODULATOR, VIDIOC_S_MODULATOR</para>
  44. </listitem>
  45. </varlistentry>
  46. <varlistentry>
  47. <term><parameter>argp</parameter></term>
  48. <listitem>
  49. <para></para>
  50. </listitem>
  51. </varlistentry>
  52. </variablelist>
  53. </refsect1>
  54. <refsect1>
  55. <title>Description</title>
  56. <para>To query the attributes of a modulator applications initialize
  57. the <structfield>index</structfield> field and zero out the
  58. <structfield>reserved</structfield> array of a &v4l2-modulator; and
  59. call the <constant>VIDIOC_G_MODULATOR</constant> ioctl with a pointer
  60. to this structure. Drivers fill the rest of the structure or return an
  61. &EINVAL; when the index is out of bounds. To enumerate all modulators
  62. applications shall begin at index zero, incrementing by one until the
  63. driver returns <errorcode>EINVAL</errorcode>.</para>
  64. <para>Modulators have two writable properties, an audio
  65. modulation set and the radio frequency. To change the modulated audio
  66. subprograms, applications initialize the <structfield>index
  67. </structfield> and <structfield>txsubchans</structfield> fields and the
  68. <structfield>reserved</structfield> array and call the
  69. <constant>VIDIOC_S_MODULATOR</constant> ioctl. Drivers may choose a
  70. different audio modulation if the request cannot be satisfied. However
  71. this is a write-only ioctl, it does not return the actual audio
  72. modulation selected.</para>
  73. <para>To change the radio frequency the &VIDIOC-S-FREQUENCY; ioctl
  74. is available.</para>
  75. <table pgwide="1" frame="none" id="v4l2-modulator">
  76. <title>struct <structname>v4l2_modulator</structname></title>
  77. <tgroup cols="3">
  78. &cs-str;
  79. <tbody valign="top">
  80. <row>
  81. <entry>__u32</entry>
  82. <entry><structfield>index</structfield></entry>
  83. <entry>Identifies the modulator, set by the
  84. application.</entry>
  85. </row>
  86. <row>
  87. <entry>__u8</entry>
  88. <entry><structfield>name</structfield>[32]</entry>
  89. <entry>Name of the modulator, a NUL-terminated ASCII
  90. string. This information is intended for the user.</entry>
  91. </row>
  92. <row>
  93. <entry>__u32</entry>
  94. <entry><structfield>capability</structfield></entry>
  95. <entry>Modulator capability flags. No flags are defined
  96. for this field, the tuner flags in &v4l2-tuner;
  97. are used accordingly. The audio flags indicate the ability
  98. to encode audio subprograms. They will <emphasis>not</emphasis>
  99. change for example with the current video standard.</entry>
  100. </row>
  101. <row>
  102. <entry>__u32</entry>
  103. <entry><structfield>rangelow</structfield></entry>
  104. <entry>The lowest tunable frequency in units of 62.5
  105. KHz, or if the <structfield>capability</structfield> flag
  106. <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
  107. Hz.</entry>
  108. </row>
  109. <row>
  110. <entry>__u32</entry>
  111. <entry><structfield>rangehigh</structfield></entry>
  112. <entry>The highest tunable frequency in units of 62.5
  113. KHz, or if the <structfield>capability</structfield> flag
  114. <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
  115. Hz.</entry>
  116. </row>
  117. <row>
  118. <entry>__u32</entry>
  119. <entry><structfield>txsubchans</structfield></entry>
  120. <entry>With this field applications can determine how
  121. audio sub-carriers shall be modulated. It contains a set of flags as
  122. defined in <xref linkend="modulator-txsubchans" />. Note the tuner
  123. <structfield>rxsubchans</structfield> flags are reused, but the
  124. semantics are different. Video output devices are assumed to have an
  125. analog or PCM audio input with 1-3 channels. The
  126. <structfield>txsubchans</structfield> flags select one or more
  127. channels for modulation, together with some audio subprogram
  128. indicator, for example a stereo pilot tone.</entry>
  129. </row>
  130. <row>
  131. <entry>__u32</entry>
  132. <entry><structfield>reserved</structfield>[4]</entry>
  133. <entry>Reserved for future extensions. Drivers and
  134. applications must set the array to zero.</entry>
  135. </row>
  136. </tbody>
  137. </tgroup>
  138. </table>
  139. <table pgwide="1" frame="none" id="modulator-txsubchans">
  140. <title>Modulator Audio Transmission Flags</title>
  141. <tgroup cols="3">
  142. &cs-def;
  143. <tbody valign="top">
  144. <row>
  145. <entry><constant>V4L2_TUNER_SUB_MONO</constant></entry>
  146. <entry>0x0001</entry>
  147. <entry>Modulate channel 1 as mono audio, when the input
  148. has more channels, a down-mix of channel 1 and 2. This flag does not
  149. combine with <constant>V4L2_TUNER_SUB_STEREO</constant> or
  150. <constant>V4L2_TUNER_SUB_LANG1</constant>.</entry>
  151. </row>
  152. <row>
  153. <entry><constant>V4L2_TUNER_SUB_STEREO</constant></entry>
  154. <entry>0x0002</entry>
  155. <entry>Modulate channel 1 and 2 as left and right
  156. channel of a stereo audio signal. When the input has only one channel
  157. or two channels and <constant>V4L2_TUNER_SUB_SAP</constant> is also
  158. set, channel 1 is encoded as left and right channel. This flag does
  159. not combine with <constant>V4L2_TUNER_SUB_MONO</constant> or
  160. <constant>V4L2_TUNER_SUB_LANG1</constant>. When the driver does not
  161. support stereo audio it shall fall back to mono.</entry>
  162. </row>
  163. <row>
  164. <entry><constant>V4L2_TUNER_SUB_LANG1</constant></entry>
  165. <entry>0x0008</entry>
  166. <entry>Modulate channel 1 and 2 as primary and secondary
  167. language of a bilingual audio signal. When the input has only one
  168. channel it is used for both languages. It is not possible to encode
  169. the primary or secondary language only. This flag does not combine
  170. with <constant>V4L2_TUNER_SUB_MONO</constant>,
  171. <constant>V4L2_TUNER_SUB_STEREO</constant> or
  172. <constant>V4L2_TUNER_SUB_SAP</constant>. If the hardware does not
  173. support the respective audio matrix, or the current video standard
  174. does not permit bilingual audio the
  175. <constant>VIDIOC_S_MODULATOR</constant> ioctl shall return an &EINVAL;
  176. and the driver shall fall back to mono or stereo mode.</entry>
  177. </row>
  178. <row>
  179. <entry><constant>V4L2_TUNER_SUB_LANG2</constant></entry>
  180. <entry>0x0004</entry>
  181. <entry>Same effect as
  182. <constant>V4L2_TUNER_SUB_SAP</constant>.</entry>
  183. </row>
  184. <row>
  185. <entry><constant>V4L2_TUNER_SUB_SAP</constant></entry>
  186. <entry>0x0004</entry>
  187. <entry>When combined with <constant>V4L2_TUNER_SUB_MONO
  188. </constant> the first channel is encoded as mono audio, the last
  189. channel as Second Audio Program. When the input has only one channel
  190. it is used for both audio tracks. When the input has three channels
  191. the mono track is a down-mix of channel 1 and 2. When combined with
  192. <constant>V4L2_TUNER_SUB_STEREO</constant> channel 1 and 2 are
  193. encoded as left and right stereo audio, channel 3 as Second Audio
  194. Program. When the input has only two channels, the first is encoded as
  195. left and right channel and the second as SAP. When the input has only
  196. one channel it is used for all audio tracks. It is not possible to
  197. encode a Second Audio Program only. This flag must combine with
  198. <constant>V4L2_TUNER_SUB_MONO</constant> or
  199. <constant>V4L2_TUNER_SUB_STEREO</constant>. If the hardware does not
  200. support the respective audio matrix, or the current video standard
  201. does not permit SAP the <constant>VIDIOC_S_MODULATOR</constant> ioctl
  202. shall return an &EINVAL; and driver shall fall back to mono or stereo
  203. mode.</entry>
  204. </row>
  205. <row>
  206. <entry><constant>V4L2_TUNER_SUB_RDS</constant></entry>
  207. <entry>0x0010</entry>
  208. <entry>Enable the RDS encoder for a radio FM transmitter.</entry>
  209. </row>
  210. </tbody>
  211. </tgroup>
  212. </table>
  213. </refsect1>
  214. <refsect1>
  215. &return-value;
  216. <variablelist>
  217. <varlistentry>
  218. <term><errorcode>EINVAL</errorcode></term>
  219. <listitem>
  220. <para>The &v4l2-modulator;
  221. <structfield>index</structfield> is out of bounds.</para>
  222. </listitem>
  223. </varlistentry>
  224. </variablelist>
  225. </refsect1>
  226. </refentry>
  227. <!--
  228. Local Variables:
  229. mode: sgml
  230. sgml-parent-document: "v4l2.sgml"
  231. indent-tabs-mode: nil
  232. End:
  233. -->