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