1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Audio Function Calls</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="LINUX MEDIA INFRASTRUCTURE API"><link rel="up" href="dvb_audio.html" title="Chapter&#160;12.&#160;DVB Audio Device"><link rel="prev" href="dvb_audio.html" title="Chapter&#160;12.&#160;DVB Audio Device"><link rel="next" href="dvb_ca.html" title="Chapter&#160;13.&#160;DVB CA Device"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Audio Function Calls</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dvb_audio.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;12.&#160;DVB Audio Device</th><td width="20%" align="right">&#160;<a accesskey="n" href="dvb_ca.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="audio_function_calls"></a>Audio Function Calls</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="audio_function_calls.html#audio_fopen">open()</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#audio_fclose">close()</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#audio_fwrite">write()</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_STOP">AUDIO_STOP</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_PLAY">AUDIO_PLAY</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_PAUSE">AUDIO_PAUSE</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_CONTINUE">AUDIO_CONTINUE</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SELECT_SOURCE">AUDIO_SELECT_SOURCE</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_MUTE">AUDIO_SET_MUTE</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_AV_SYNC">AUDIO_SET_AV_SYNC</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_BYPASS_MODE">AUDIO_SET_BYPASS_MODE</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_CHANNEL_SELECT">AUDIO_CHANNEL_SELECT</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_BILINGUAL_CHANNEL_SELECT">AUDIO_BILINGUAL_CHANNEL_SELECT</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_GET_PTS">AUDIO_GET_PTS</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_GET_STATUS">AUDIO_GET_STATUS</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_GET_CAPABILITIES">AUDIO_GET_CAPABILITIES</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_CLEAR_BUFFER">AUDIO_CLEAR_BUFFER</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_ID">AUDIO_SET_ID</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_MIXER">AUDIO_SET_MIXER</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_STREAMTYPE">AUDIO_SET_STREAMTYPE</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_EXT_ID">AUDIO_SET_EXT_ID</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_ATTRIBUTES">AUDIO_SET_ATTRIBUTES</a></span></dt><dt><span class="section"><a href="audio_function_calls.html#AUDIO_SET_KARAOKE">AUDIO_SET_KARAOKE</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="audio_fopen"></a>open()</h3></div></div></div><p>DESCRIPTION
2</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
3<p>This system call opens a named audio device (e.g. /dev/dvb/adapter0/audio0)
4 for subsequent use. When an open() call has succeeded, the device will be ready
5 for use. The significance of blocking or non-blocking mode is described in the
6 documentation for functions where there is a difference. It does not affect the
7 semantics of the open() call itself. A device opened in blocking mode can later
8 be put into non-blocking mode (and vice versa) using the F_SETFL command
9 of the fcntl system call. This is a standard system call, documented in the Linux
10 manual page for fcntl. Only one user can open the Audio Device in O_RDWR
11 mode. All other attempts to open the device in this mode will fail, and an error
12 code will be returned. If the Audio Device is opened in O_RDONLY mode, the
13 only ioctl call that can be used is AUDIO_GET_STATUS. All other call will
14 return with an error code.</p>
15</td></tr></tbody></table></div><p>SYNOPSIS
16</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
17<p>int open(const char &#8902;deviceName, int flags);</p>
18</td></tr></tbody></table></div><p>PARAMETERS
19</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
20<p>const char
21 *deviceName</p>
22</td><td align="char">
23<p>Name of specific audio device.</p>
24</td></tr><tr><td align="char">
25<p>int flags</p>
26</td><td align="char">
27<p>A bit-wise OR of the following flags:</p>
28</td></tr><tr><td align="char">
29</td><td align="char">
30<p>O_RDONLY read-only access</p>
31</td></tr><tr><td align="char">
32</td><td align="char">
33<p>O_RDWR read/write access</p>
34</td></tr><tr><td align="char">
35</td><td align="char">
36<p>O_NONBLOCK open in non-blocking mode</p>
37</td></tr><tr><td align="char">
38</td><td align="char">
39<p>(blocking mode is the default)</p>
40</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
41<p>ENODEV</p>
42</td><td align="char">
43<p>Device driver not loaded/available.</p>
44</td></tr><tr><td align="char">
45<p>EBUSY</p>
46</td><td align="char">
47<p>Device or resource busy.</p>
48</td></tr><tr><td align="char">
49<p>EINVAL</p>
50</td><td align="char">
51<p>Invalid argument.</p>
52</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="audio_fclose"></a>close()</h3></div></div></div><p>DESCRIPTION
53</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
54<p>This system call closes a previously opened audio device.</p>
55</td></tr></tbody></table></div><p>SYNOPSIS
56</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
57<p>int close(int fd);</p>
58</td></tr></tbody></table></div><p>PARAMETERS
59</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
60<p>int fd</p>
61</td><td align="char">
62<p>File descriptor returned by a previous call to open().</p>
63</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
64<p>EBADF</p>
65</td><td align="char">
66<p>fd is not a valid open file descriptor.</p>
67</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="audio_fwrite"></a>write()</h3></div></div></div><p>DESCRIPTION
68</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
69<p>This system call can only be used if AUDIO_SOURCE_MEMORY is selected
70 in the ioctl call AUDIO_SELECT_SOURCE. The data provided shall be in
71 PES format. If O_NONBLOCK is not specified the function will block until
72 buffer space is available. The amount of data to be transferred is implied by
73 count.</p>
74</td></tr></tbody></table></div><p>SYNOPSIS
75</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
76<p>size_t write(int fd, const void &#8902;buf, size_t count);</p>
77</td></tr></tbody></table></div><p>PARAMETERS
78</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
79<p>int fd</p>
80</td><td align="char">
81<p>File descriptor returned by a previous call to open().</p>
82</td></tr><tr><td align="char">
83<p>void *buf</p>
84</td><td align="char">
85<p>Pointer to the buffer containing the PES data.</p>
86</td></tr><tr><td align="char">
87<p>size_t count</p>
88</td><td align="char">
89<p>Size of buf.</p>
90</td></tr></tbody></table></div><p>RETURN VALUE</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
91<p>EPERM</p>
92</td><td align="char">
93<p>Mode AUDIO_SOURCE_MEMORY not selected.</p>
94</td></tr><tr><td align="char">
95<p>ENOMEM</p>
96</td><td align="char">
97<p>Attempted to write more data than the internal buffer can
98 hold.</p>
99</td></tr><tr><td align="char">
100<p>EBADF</p>
101</td><td align="char">
102<p>fd is not a valid open file descriptor.</p>
103</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_STOP"></a>AUDIO_STOP</h3></div></div></div><p>DESCRIPTION
104</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
105<p>This ioctl call asks the Audio Device to stop playing the current stream.</p>
106</td></tr></tbody></table></div><p>SYNOPSIS
107</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
108<p>int ioctl(int fd, int request = AUDIO_STOP);</p>
109</td></tr></tbody></table></div><p>PARAMETERS
110</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
111<p>int fd</p>
112</td><td align="char">
113<p>File descriptor returned by a previous call to open().</p>
114</td></tr><tr><td align="char">
115<p>int request</p>
116</td><td align="char">
117<p>Equals AUDIO_STOP for this command.</p>
118</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_PLAY"></a>AUDIO_PLAY</h3></div></div></div><p>DESCRIPTION
119</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
120<p>This ioctl call asks the Audio Device to start playing an audio stream from the
121 selected source.</p>
122</td></tr></tbody></table></div><p>SYNOPSIS
123</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
124<p>int ioctl(int fd, int request = AUDIO_PLAY);</p>
125</td></tr></tbody></table></div><p>PARAMETERS
126</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
127<p>int fd</p>
128</td><td align="char">
129<p>File descriptor returned by a previous call to open().</p>
130</td></tr><tr><td align="char">
131<p>int request</p>
132</td><td align="char">
133<p>Equals AUDIO_PLAY for this command.</p>
134</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_PAUSE"></a>AUDIO_PAUSE</h3></div></div></div><p>DESCRIPTION
135</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
136<p>This ioctl call suspends the audio stream being played. Decoding and playing
137 are paused. It is then possible to restart again decoding and playing process of
138 the audio stream using AUDIO_CONTINUE command.</p>
139</td></tr><tr><td align="char">
140<p>If AUDIO_SOURCE_MEMORY is selected in the ioctl call
141 AUDIO_SELECT_SOURCE, the DVB-subsystem will not decode (consume)
142 any more data until the ioctl call AUDIO_CONTINUE or AUDIO_PLAY is
143 performed.</p>
144</td></tr></tbody></table></div><p>SYNOPSIS
145</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
146<p>int ioctl(int fd, int request = AUDIO_PAUSE);</p>
147</td></tr></tbody></table></div><p>PARAMETERS
148</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
149<p>int fd</p>
150</td><td align="char">
151<p>File descriptor returned by a previous call to open().</p>
152</td></tr><tr><td align="char">
153<p>int request</p>
154</td><td align="char">
155<p>Equals AUDIO_PAUSE for this command.</p>
156</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_CONTINUE"></a>AUDIO_CONTINUE</h3></div></div></div><p>DESCRIPTION
157</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
158<p>This ioctl restarts the decoding and playing process previously paused
159with AUDIO_PAUSE command.</p>
160</td></tr><tr><td align="char">
161<p>It only works if the stream were previously stopped with AUDIO_PAUSE</p>
162</td></tr></tbody></table></div><p>SYNOPSIS
163</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
164<p>int ioctl(int fd, int request = AUDIO_CONTINUE);</p>
165</td></tr></tbody></table></div><p>PARAMETERS
166</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
167<p>int fd</p>
168</td><td align="char">
169<p>File descriptor returned by a previous call to open().</p>
170</td></tr><tr><td align="char">
171<p>int request</p>
172</td><td align="char">
173<p>Equals AUDIO_CONTINUE for this command.</p>
174</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SELECT_SOURCE"></a>AUDIO_SELECT_SOURCE</h3></div></div></div><p>DESCRIPTION
175</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
176<p>This ioctl call informs the audio device which source shall be used
177 for the input data. The possible sources are demux or memory. If
178 AUDIO_SOURCE_MEMORY is selected, the data is fed to the Audio Device
179 through the write command.</p>
180</td></tr></tbody></table></div><p>SYNOPSIS
181</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
182<p>int ioctl(int fd, int request = AUDIO_SELECT_SOURCE,
183 audio_stream_source_t source);</p>
184</td></tr></tbody></table></div><p>PARAMETERS
185</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
186<p>int fd</p>
187</td><td align="char">
188<p>File descriptor returned by a previous call to open().</p>
189</td></tr><tr><td align="char">
190<p>int request</p>
191</td><td align="char">
192<p>Equals AUDIO_SELECT_SOURCE for this command.</p>
193</td></tr><tr><td align="char">
194<p>audio_stream_source_t
195 source</p>
196</td><td align="char">
197<p>Indicates the source that shall be used for the Audio
198 stream.</p>
199</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_MUTE"></a>AUDIO_SET_MUTE</h3></div></div></div><p>DESCRIPTION
200</p><p>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
201<a class="link" href="vidioc-decoder-cmd.html" title="ioctl VIDIOC_DECODER_CMD, VIDIOC_TRY_DECODER_CMD"><code class="constant">VIDIOC_DECODER_CMD</code></a> with the <code class="constant">V4L2_DEC_CMD_START_MUTE_AUDIO</code> flag instead.</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
202<p>This ioctl call asks the audio device to mute the stream that is currently being
203 played.</p>
204</td></tr></tbody></table></div><p>SYNOPSIS
205</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
206<p>int ioctl(int fd, int request = AUDIO_SET_MUTE,
207 boolean state);</p>
208</td></tr></tbody></table></div><p>PARAMETERS
209</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
210<p>int fd</p>
211</td><td align="char">
212<p>File descriptor returned by a previous call to open().</p>
213</td></tr><tr><td align="char">
214<p>int request</p>
215</td><td align="char">
216<p>Equals AUDIO_SET_MUTE for this command.</p>
217</td></tr><tr><td align="char">
218<p>boolean state</p>
219</td><td align="char">
220<p>Indicates if audio device shall mute or not.</p>
221</td></tr><tr><td align="char">
222</td><td align="char">
223<p>TRUE Audio Mute</p>
224</td></tr><tr><td align="char">
225</td><td align="char">
226<p>FALSE Audio Un-mute</p>
227</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_AV_SYNC"></a>AUDIO_SET_AV_SYNC</h3></div></div></div><p>DESCRIPTION
228</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
229<p>This ioctl call asks the Audio Device to turn ON or OFF A/V synchronization.</p>
230</td></tr></tbody></table></div><p>SYNOPSIS
231</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
232<p>int ioctl(int fd, int request = AUDIO_SET_AV_SYNC,
233 boolean state);</p>
234</td></tr></tbody></table></div><p>PARAMETERS
235</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
236<p>int fd</p>
237</td><td align="char">
238<p>File descriptor returned by a previous call to open().</p>
239</td></tr><tr><td align="char">
240<p>int request</p>
241</td><td align="char">
242<p>Equals AUDIO_AV_SYNC for this command.</p>
243</td></tr><tr><td align="char">
244<p>boolean state</p>
245</td><td align="char">
246<p>Tells the DVB subsystem if A/V synchronization shall be
247 ON or OFF.</p>
248</td></tr><tr><td align="char">
249</td><td align="char">
250<p>TRUE AV-sync ON</p>
251</td></tr><tr><td align="char">
252</td><td align="char">
253<p>FALSE AV-sync OFF</p>
254</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_BYPASS_MODE"></a>AUDIO_SET_BYPASS_MODE</h3></div></div></div><p>DESCRIPTION
255</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
256<p>This ioctl call asks the Audio Device to bypass the Audio decoder and forward
257 the stream without decoding. This mode shall be used if streams that can&#8217;t be
258 handled by the DVB system shall be decoded. Dolby DigitalTM streams are
259 automatically forwarded by the DVB subsystem if the hardware can handle it.</p>
260</td></tr></tbody></table></div><p>SYNOPSIS
261</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
262<p>int ioctl(int fd, int request =
263 AUDIO_SET_BYPASS_MODE, boolean mode);</p>
264</td></tr></tbody></table></div><p>PARAMETERS
265</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
266<p>int fd</p>
267</td><td align="char">
268<p>File descriptor returned by a previous call to open().</p>
269</td></tr><tr><td align="char">
270<p>int request</p>
271</td><td align="char">
272<p>Equals AUDIO_SET_BYPASS_MODE for this
273 command.</p>
274</td></tr><tr><td align="char">
275<p>boolean mode</p>
276</td><td align="char">
277<p>Enables or disables the decoding of the current Audio
278 stream in the DVB subsystem.</p>
279</td></tr><tr><td align="char">
280</td><td align="char">
281<p>TRUE Bypass is disabled</p>
282</td></tr><tr><td align="char">
283</td><td align="char">
284<p>FALSE Bypass is enabled</p>
285</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_CHANNEL_SELECT"></a>AUDIO_CHANNEL_SELECT</h3></div></div></div><p>DESCRIPTION
286</p><p>This ioctl is for DVB devices only. To control a V4L2 decoder use the V4L2
287<code class="constant">V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK</code> control instead.</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
288<p>This ioctl call asks the Audio Device to select the requested channel if possible.</p>
289</td></tr></tbody></table></div><p>SYNOPSIS
290</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
291<p>int ioctl(int fd, int request =
292 AUDIO_CHANNEL_SELECT, audio_channel_select_t);</p>
293</td></tr></tbody></table></div><p>PARAMETERS
294</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
295<p>int fd</p>
296</td><td align="char">
297<p>File descriptor returned by a previous call to open().</p>
298</td></tr><tr><td align="char">
299<p>int request</p>
300</td><td align="char">
301<p>Equals AUDIO_CHANNEL_SELECT for this
302 command.</p>
303</td></tr><tr><td align="char">
304<p>audio_channel_select_t
305 ch</p>
306</td><td align="char">
307<p>Select the output format of the audio (mono left/right,
308 stereo).</p>
309</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_BILINGUAL_CHANNEL_SELECT"></a>AUDIO_BILINGUAL_CHANNEL_SELECT</h3></div></div></div><p>DESCRIPTION
310</p><p>This ioctl is obsolete. Do not use in new drivers. It has been replaced by
311the V4L2 <code class="constant">V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK</code> control
312for MPEG decoders controlled through V4L2.</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
313<p>This ioctl call asks the Audio Device to select the requested channel for bilingual streams if possible.</p>
314</td></tr></tbody></table></div><p>SYNOPSIS
315</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
316<p>int ioctl(int fd, int request =
317 AUDIO_BILINGUAL_CHANNEL_SELECT, audio_channel_select_t);</p>
318</td></tr></tbody></table></div><p>PARAMETERS
319</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
320<p>int fd</p>
321</td><td align="char">
322<p>File descriptor returned by a previous call to open().</p>
323</td></tr><tr><td align="char">
324<p>int request</p>
325</td><td align="char">
326<p>Equals AUDIO_BILINGUAL_CHANNEL_SELECT for this
327 command.</p>
328</td></tr><tr><td align="char">
329<p>audio_channel_select_t
330ch</p>
331</td><td align="char">
332<p>Select the output format of the audio (mono left/right,
333 stereo).</p>
334</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_GET_PTS"></a>AUDIO_GET_PTS</h3></div></div></div><p>DESCRIPTION
335</p><p>This ioctl is obsolete. Do not use in new drivers. If you need this functionality,
336then please contact the linux-media mailing list (<a class="ulink" href="http://www.linuxtv.org/lists.php" target="_top">http://www.linuxtv.org/lists.php</a>).</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
337<p>This ioctl call asks the Audio Device to return the current PTS timestamp.</p>
338</td></tr></tbody></table></div><p>SYNOPSIS
339</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
340<p>int ioctl(int fd, int request =
341 AUDIO_GET_PTS, __u64 *pts);</p>
342</td></tr></tbody></table></div><p>PARAMETERS
343</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
344<p>int fd</p>
345</td><td align="char">
346<p>File descriptor returned by a previous call to open().</p>
347</td></tr><tr><td align="char">
348<p>int request</p>
349</td><td align="char">
350<p>Equals AUDIO_GET_PTS for this
351 command.</p>
352</td></tr><tr><td align="char">
353<p>__u64 *pts
354</p>
355</td><td align="char">
356<p>Returns the 33-bit timestamp as defined in ITU T-REC-H.222.0 / ISO/IEC 13818-1.
357</p>
358<p>
359The PTS should belong to the currently played
360frame if possible, but may also be a value close to it
361like the PTS of the last decoded frame or the last PTS
362extracted by the PES parser.</p>
363</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_GET_STATUS"></a>AUDIO_GET_STATUS</h3></div></div></div><p>DESCRIPTION
364</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
365<p>This ioctl call asks the Audio Device to return the current state of the Audio
366 Device.</p>
367</td></tr></tbody></table></div><p>SYNOPSIS
368</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
369<p>int ioctl(int fd, int request = AUDIO_GET_STATUS,
370 struct audio_status &#8902;status);</p>
371</td></tr></tbody></table></div><p>PARAMETERS
372</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
373<p>int fd</p>
374</td><td align="char">
375<p>File descriptor returned by a previous call to open().</p>
376</td></tr><tr><td align="char">
377<p>int request</p>
378</td><td align="char">
379<p>Equals AUDIO_GET_STATUS for this command.</p>
380</td></tr><tr><td align="char">
381<p>struct audio_status
382 *status</p>
383</td><td align="char">
384<p>Returns the current state of Audio Device.</p>
385</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_GET_CAPABILITIES"></a>AUDIO_GET_CAPABILITIES</h3></div></div></div><p>DESCRIPTION
386</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
387<p>This ioctl call asks the Audio Device to tell us about the decoding capabilities
388 of the audio hardware.</p>
389</td></tr></tbody></table></div><p>SYNOPSIS
390</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
391<p>int ioctl(int fd, int request =
392 AUDIO_GET_CAPABILITIES, unsigned int &#8902;cap);</p>
393</td></tr></tbody></table></div><p>PARAMETERS
394</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
395<p>int fd</p>
396</td><td align="char">
397<p>File descriptor returned by a previous call to open().</p>
398</td></tr><tr><td align="char">
399<p>int request</p>
400</td><td align="char">
401<p>Equals AUDIO_GET_CAPABILITIES for this
402 command.</p>
403</td></tr><tr><td align="char">
404<p>unsigned int *cap</p>
405</td><td align="char">
406<p>Returns a bit array of supported sound formats.</p>
407</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_CLEAR_BUFFER"></a>AUDIO_CLEAR_BUFFER</h3></div></div></div><p>DESCRIPTION
408</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
409<p>This ioctl call asks the Audio Device to clear all software and hardware buffers
410 of the audio decoder device.</p>
411</td></tr></tbody></table></div><p>SYNOPSIS
412</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
413<p>int ioctl(int fd, int request = AUDIO_CLEAR_BUFFER);</p>
414</td></tr></tbody></table></div><p>PARAMETERS
415</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
416<p>int fd</p>
417</td><td align="char">
418<p>File descriptor returned by a previous call to open().</p>
419</td></tr><tr><td align="char">
420<p>int request</p>
421</td><td align="char">
422<p>Equals AUDIO_CLEAR_BUFFER for this command.</p>
423</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_ID"></a>AUDIO_SET_ID</h3></div></div></div><p>DESCRIPTION
424</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
425<p>This ioctl selects which sub-stream is to be decoded if a program or system
426 stream is sent to the video device. If no audio stream type is set the id has to be
427 in [0xC0,0xDF] for MPEG sound, in [0x80,0x87] for AC3 and in [0xA0,0xA7]
428 for LPCM. More specifications may follow for other stream types. If the stream
429 type is set the id just specifies the substream id of the audio stream and only
430 the first 5 bits are recognized.</p>
431</td></tr></tbody></table></div><p>SYNOPSIS
432</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
433<p>int ioctl(int fd, int request = AUDIO_SET_ID, int
434 id);</p>
435</td></tr></tbody></table></div><p>PARAMETERS
436</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
437<p>int fd</p>
438</td><td align="char">
439<p>File descriptor returned by a previous call to open().</p>
440</td></tr><tr><td align="char">
441<p>int request</p>
442</td><td align="char">
443<p>Equals AUDIO_SET_ID for this command.</p>
444</td></tr><tr><td align="char">
445<p>int id</p>
446</td><td align="char">
447<p>audio sub-stream id</p>
448</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_MIXER"></a>AUDIO_SET_MIXER</h3></div></div></div><p>DESCRIPTION
449</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
450<p>This ioctl lets you adjust the mixer settings of the audio decoder.</p>
451</td></tr></tbody></table></div><p>SYNOPSIS
452</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
453<p>int ioctl(int fd, int request = AUDIO_SET_MIXER,
454 audio_mixer_t &#8902;mix);</p>
455</td></tr></tbody></table></div><p>PARAMETERS
456</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
457<p>int fd</p>
458</td><td align="char">
459<p>File descriptor returned by a previous call to open().</p>
460</td></tr><tr><td align="char">
461<p>int request</p>
462</td><td align="char">
463<p>Equals AUDIO_SET_ID for this command.</p>
464</td></tr><tr><td align="char">
465<p>audio_mixer_t *mix</p>
466</td><td align="char">
467<p>mixer settings.</p>
468</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_STREAMTYPE"></a>AUDIO_SET_STREAMTYPE</h3></div></div></div><p>DESCRIPTION
469</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
470<p>This ioctl tells the driver which kind of audio stream to expect. This is useful
471 if the stream offers several audio sub-streams like LPCM and AC3.</p>
472</td></tr></tbody></table></div><p>SYNOPSIS
473</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
474<p>int ioctl(fd, int request = AUDIO_SET_STREAMTYPE,
475 int type);</p>
476</td></tr></tbody></table></div><p>PARAMETERS
477</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
478<p>int fd</p>
479</td><td align="char">
480<p>File descriptor returned by a previous call to open().</p>
481</td></tr><tr><td align="char">
482<p>int request</p>
483</td><td align="char">
484<p>Equals AUDIO_SET_STREAMTYPE for this
485 command.</p>
486</td></tr><tr><td align="char">
487<p>int type</p>
488</td><td align="char">
489<p>stream type</p>
490</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
491<p>EINVAL</p>
492</td><td align="char">
493<p>type is not a valid or supported stream type.</p>
494</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_EXT_ID"></a>AUDIO_SET_EXT_ID</h3></div></div></div><p>DESCRIPTION
495</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
496<p>This ioctl can be used to set the extension id for MPEG streams in DVD
497 playback. Only the first 3 bits are recognized.</p>
498</td></tr></tbody></table></div><p>SYNOPSIS
499</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
500<p>int ioctl(fd, int request = AUDIO_SET_EXT_ID, int
501 id);</p>
502</td></tr></tbody></table></div><p>PARAMETERS
503</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
504<p>int fd</p>
505</td><td align="char">
506<p>File descriptor returned by a previous call to open().</p>
507</td></tr><tr><td align="char">
508<p>int request</p>
509</td><td align="char">
510<p>Equals AUDIO_SET_EXT_ID for this command.</p>
511</td></tr><tr><td align="char">
512<p>int id</p>
513</td><td align="char">
514<p>audio sub_stream_id</p>
515</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
516<p>EINVAL</p>
517</td><td align="char">
518<p>id is not a valid id.</p>
519</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_ATTRIBUTES"></a>AUDIO_SET_ATTRIBUTES</h3></div></div></div><p>DESCRIPTION
520</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
521<p>This ioctl is intended for DVD playback and allows you to set certain
522 information about the audio stream.</p>
523</td></tr></tbody></table></div><p>SYNOPSIS
524</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
525<p>int ioctl(fd, int request = AUDIO_SET_ATTRIBUTES,
526 audio_attributes_t attr );</p>
527</td></tr></tbody></table></div><p>PARAMETERS
528</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
529<p>int fd</p>
530</td><td align="char">
531<p>File descriptor returned by a previous call to open().</p>
532</td></tr><tr><td align="char">
533<p>int request</p>
534</td><td align="char">
535<p>Equals AUDIO_SET_ATTRIBUTES for this command.</p>
536</td></tr><tr><td align="char">
537<p>audio_attributes_t
538 attr</p>
539</td><td align="char">
540<p>audio attributes according to section ??</p>
541</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
542<p>EINVAL</p>
543</td><td align="char">
544<p>attr is not a valid or supported attribute setting.</p>
545</td></tr></tbody></table></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="AUDIO_SET_KARAOKE"></a>AUDIO_SET_KARAOKE</h3></div></div></div><p>DESCRIPTION
546</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
547<p>This ioctl allows one to set the mixer settings for a karaoke DVD.</p>
548</td></tr></tbody></table></div><p>SYNOPSIS
549</p><div class="informaltable"><table border="1"><colgroup><col></colgroup><tbody><tr><td align="char">
550<p>int ioctl(fd, int request = AUDIO_SET_KARAOKE,
551 audio_karaoke_t &#8902;karaoke);</p>
552</td></tr></tbody></table></div><p>PARAMETERS
553</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
554<p>int fd</p>
555</td><td align="char">
556<p>File descriptor returned by a previous call to open().</p>
557</td></tr><tr><td align="char">
558<p>int request</p>
559</td><td align="char">
560<p>Equals AUDIO_SET_KARAOKE for this
561 command.</p>
562</td></tr><tr><td align="char">
563<p>audio_karaoke_t
564 *karaoke</p>
565</td><td align="char">
566<p>karaoke settings according to section ??.</p>
567</td></tr></tbody></table></div><p>RETURN VALUE</p><p>On success <span class="returnvalue">0</span> is returned, on error <span class="returnvalue">-1</span> and the <code class="varname">errno</code> variable is set appropriately. The generic error codes are described at the <a class="link" href="gen_errors.html#gen-errors" title="Table&#160;19.1.&#160;Generic error codes">Generic Error Codes</a> chapter.</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td align="char">
568<p>EINVAL</p>
569</td><td align="char">
570<p>karaoke is not a valid or supported karaoke setting.</p>
571</td></tr></tbody></table></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dvb_audio.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="dvb_audio.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="dvb_ca.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;12.&#160;DVB Audio Device&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Chapter&#160;13.&#160;DVB CA Device</td></tr></table></div></body></html>
572