vidioc-g-modulator.xml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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><link linkend="sdr">SDR</link> specific modulator types are
  74. <constant>V4L2_TUNER_SDR</constant> and <constant>V4L2_TUNER_RF</constant>.
  75. For SDR devices <structfield>txsubchans</structfield> field must be
  76. initialized to zero.
  77. The term 'modulator' means SDR transmitter in this context.</para>
  78. <para>To change the radio frequency the &VIDIOC-S-FREQUENCY; ioctl
  79. is available.</para>
  80. <table pgwide="1" frame="none" id="v4l2-modulator">
  81. <title>struct <structname>v4l2_modulator</structname></title>
  82. <tgroup cols="3">
  83. &cs-str;
  84. <tbody valign="top">
  85. <row>
  86. <entry>__u32</entry>
  87. <entry><structfield>index</structfield></entry>
  88. <entry>Identifies the modulator, set by the
  89. application.</entry>
  90. </row>
  91. <row>
  92. <entry>__u8</entry>
  93. <entry><structfield>name</structfield>[32]</entry>
  94. <entry>Name of the modulator, a NUL-terminated ASCII
  95. string. This information is intended for the user.</entry>
  96. </row>
  97. <row>
  98. <entry>__u32</entry>
  99. <entry><structfield>capability</structfield></entry>
  100. <entry>Modulator capability flags. No flags are defined
  101. for this field, the tuner flags in &v4l2-tuner;
  102. are used accordingly. The audio flags indicate the ability
  103. to encode audio subprograms. They will <emphasis>not</emphasis>
  104. change for example with the current video standard.</entry>
  105. </row>
  106. <row>
  107. <entry>__u32</entry>
  108. <entry><structfield>rangelow</structfield></entry>
  109. <entry>The lowest tunable frequency in units of 62.5
  110. KHz, or if the <structfield>capability</structfield> flag
  111. <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
  112. Hz, or if the <structfield>capability</structfield> flag
  113. <constant>V4L2_TUNER_CAP_1HZ</constant> is set, in units of 1 Hz.</entry>
  114. </row>
  115. <row>
  116. <entry>__u32</entry>
  117. <entry><structfield>rangehigh</structfield></entry>
  118. <entry>The highest tunable frequency in units of 62.5
  119. KHz, or if the <structfield>capability</structfield> flag
  120. <constant>V4L2_TUNER_CAP_LOW</constant> is set, in units of 62.5
  121. Hz, or if the <structfield>capability</structfield> flag
  122. <constant>V4L2_TUNER_CAP_1HZ</constant> is set, in units of 1 Hz.</entry>
  123. </row>
  124. <row>
  125. <entry>__u32</entry>
  126. <entry><structfield>txsubchans</structfield></entry>
  127. <entry>With this field applications can determine how
  128. audio sub-carriers shall be modulated. It contains a set of flags as
  129. defined in <xref linkend="modulator-txsubchans" />. Note the tuner
  130. <structfield>rxsubchans</structfield> flags are reused, but the
  131. semantics are different. Video output devices are assumed to have an
  132. analog or PCM audio input with 1-3 channels. The
  133. <structfield>txsubchans</structfield> flags select one or more
  134. channels for modulation, together with some audio subprogram
  135. indicator, for example a stereo pilot tone.</entry>
  136. </row>
  137. <row>
  138. <entry>__u32</entry>
  139. <entry><structfield>type</structfield></entry>
  140. <entry spanname="hspan">Type of the modulator, see <xref
  141. linkend="v4l2-tuner-type" />.</entry>
  142. </row>
  143. <row>
  144. <entry>__u32</entry>
  145. <entry><structfield>reserved</structfield>[3]</entry>
  146. <entry>Reserved for future extensions. Drivers and
  147. applications must set the array to zero.</entry>
  148. </row>
  149. </tbody>
  150. </tgroup>
  151. </table>
  152. <table pgwide="1" frame="none" id="modulator-txsubchans">
  153. <title>Modulator Audio Transmission Flags</title>
  154. <tgroup cols="3">
  155. &cs-def;
  156. <tbody valign="top">
  157. <row>
  158. <entry><constant>V4L2_TUNER_SUB_MONO</constant></entry>
  159. <entry>0x0001</entry>
  160. <entry>Modulate channel 1 as mono audio, when the input
  161. has more channels, a down-mix of channel 1 and 2. This flag does not
  162. combine with <constant>V4L2_TUNER_SUB_STEREO</constant> or
  163. <constant>V4L2_TUNER_SUB_LANG1</constant>.</entry>
  164. </row>
  165. <row>
  166. <entry><constant>V4L2_TUNER_SUB_STEREO</constant></entry>
  167. <entry>0x0002</entry>
  168. <entry>Modulate channel 1 and 2 as left and right
  169. channel of a stereo audio signal. When the input has only one channel
  170. or two channels and <constant>V4L2_TUNER_SUB_SAP</constant> is also
  171. set, channel 1 is encoded as left and right channel. This flag does
  172. not combine with <constant>V4L2_TUNER_SUB_MONO</constant> or
  173. <constant>V4L2_TUNER_SUB_LANG1</constant>. When the driver does not
  174. support stereo audio it shall fall back to mono.</entry>
  175. </row>
  176. <row>
  177. <entry><constant>V4L2_TUNER_SUB_LANG1</constant></entry>
  178. <entry>0x0008</entry>
  179. <entry>Modulate channel 1 and 2 as primary and secondary
  180. language of a bilingual audio signal. When the input has only one
  181. channel it is used for both languages. It is not possible to encode
  182. the primary or secondary language only. This flag does not combine
  183. with <constant>V4L2_TUNER_SUB_MONO</constant>,
  184. <constant>V4L2_TUNER_SUB_STEREO</constant> or
  185. <constant>V4L2_TUNER_SUB_SAP</constant>. If the hardware does not
  186. support the respective audio matrix, or the current video standard
  187. does not permit bilingual audio the
  188. <constant>VIDIOC_S_MODULATOR</constant> ioctl shall return an &EINVAL;
  189. and the driver shall fall back to mono or stereo mode.</entry>
  190. </row>
  191. <row>
  192. <entry><constant>V4L2_TUNER_SUB_LANG2</constant></entry>
  193. <entry>0x0004</entry>
  194. <entry>Same effect as
  195. <constant>V4L2_TUNER_SUB_SAP</constant>.</entry>
  196. </row>
  197. <row>
  198. <entry><constant>V4L2_TUNER_SUB_SAP</constant></entry>
  199. <entry>0x0004</entry>
  200. <entry>When combined with <constant>V4L2_TUNER_SUB_MONO
  201. </constant> the first channel is encoded as mono audio, the last
  202. channel as Second Audio Program. When the input has only one channel
  203. it is used for both audio tracks. When the input has three channels
  204. the mono track is a down-mix of channel 1 and 2. When combined with
  205. <constant>V4L2_TUNER_SUB_STEREO</constant> channel 1 and 2 are
  206. encoded as left and right stereo audio, channel 3 as Second Audio
  207. Program. When the input has only two channels, the first is encoded as
  208. left and right channel and the second as SAP. When the input has only
  209. one channel it is used for all audio tracks. It is not possible to
  210. encode a Second Audio Program only. This flag must combine with
  211. <constant>V4L2_TUNER_SUB_MONO</constant> or
  212. <constant>V4L2_TUNER_SUB_STEREO</constant>. If the hardware does not
  213. support the respective audio matrix, or the current video standard
  214. does not permit SAP the <constant>VIDIOC_S_MODULATOR</constant> ioctl
  215. shall return an &EINVAL; and driver shall fall back to mono or stereo
  216. mode.</entry>
  217. </row>
  218. <row>
  219. <entry><constant>V4L2_TUNER_SUB_RDS</constant></entry>
  220. <entry>0x0010</entry>
  221. <entry>Enable the RDS encoder for a radio FM transmitter.</entry>
  222. </row>
  223. </tbody>
  224. </tgroup>
  225. </table>
  226. </refsect1>
  227. <refsect1>
  228. &return-value;
  229. <variablelist>
  230. <varlistentry>
  231. <term><errorcode>EINVAL</errorcode></term>
  232. <listitem>
  233. <para>The &v4l2-modulator;
  234. <structfield>index</structfield> is out of bounds.</para>
  235. </listitem>
  236. </varlistentry>
  237. </variablelist>
  238. </refsect1>
  239. </refentry>