1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</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="user-func.html" title="Appendix A. Function Reference"><link rel="prev" href="vidioc-g-std.html" title="ioctl VIDIOC_G_STD, VIDIOC_S_STD"><link rel="next" href="vidioc-log-status.html" title="ioctl VIDIOC_LOG_STATUS"></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">ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-g-std.html">Prev</a> </td><th width="60%" align="center">Appendix A. Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="vidioc-log-status.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-g-tuner"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_G_TUNER, VIDIOC_S_TUNER — Get or set tuner attributes</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">request</var>, </td></tr><tr><td> </td><td>struct v4l2_tuner 2*<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">ioctl</b>(</code></td><td>int <var class="pdparam">fd</var>, </td></tr><tr><td> </td><td>int <var class="pdparam">request</var>, </td></tr><tr><td> </td><td>const struct v4l2_tuner 3*<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1115277428"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>fd</code></em></span></dt><dd><p>File descriptor returned by <a class="link" href="func-open.html" title="V4L2 open()"><code class="function">open()</code></a>.</p></dd><dt><span class="term"><em class="parameter"><code>request</code></em></span></dt><dd><p>VIDIOC_G_TUNER, VIDIOC_S_TUNER</p></dd><dt><span class="term"><em class="parameter"><code>argp</code></em></span></dt><dd><p></p></dd></dl></div></div><div class="refsect1"><a name="idp1115337540"></a><h2>Description</h2><p>To query the attributes of a tuner applications initialize the 4<em class="structfield"><code>index</code></em> field and zero out the 5<em class="structfield"><code>reserved</code></em> array of a struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a> and call the 6<code class="constant">VIDIOC_G_TUNER</code> ioctl with a pointer to this 7structure. Drivers fill the rest of the structure or return an 8<span class="errorcode">EINVAL</span> error code when the index is out of bounds. To enumerate all tuners 9applications shall begin at index zero, incrementing by one until the 10driver returns <span class="errorcode">EINVAL</span>.</p><p>Tuners have two writable properties, the audio mode and 11the radio frequency. To change the audio mode, applications initialize 12the <em class="structfield"><code>index</code></em>, 13<em class="structfield"><code>audmode</code></em> and 14<em class="structfield"><code>reserved</code></em> fields and call the 15<code class="constant">VIDIOC_S_TUNER</code> ioctl. This will 16<span class="emphasis"><em>not</em></span> change the current tuner, which is determined 17by the current video input. Drivers may choose a different audio mode 18if the requested mode is invalid or unsupported. Since this is a 19write-only ioctl, it does not return the actually 20selected audio mode.</p><p>To change the radio frequency the <a class="link" href="vidioc-g-frequency.html" title="ioctl VIDIOC_G_FREQUENCY, VIDIOC_S_FREQUENCY"><code class="constant">VIDIOC_S_FREQUENCY</code></a> ioctl 21is available.</p><div class="table"><a name="v4l2-tuner"></a><p class="title"><b>Table A.87. struct <span class="structname">v4l2_tuner</span></b></p><div class="table-contents"><table summary="struct v4l2_tuner" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>index</code></em></td><td colspan="2" valign="top">Identifies the tuner, set by the 22application.</td></tr><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>name</code></em>[32]</td><td colspan="2" valign="top"><p>Name of the tuner, a 23NUL-terminated ASCII string. This information is intended for the 24user.</p></td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>type</code></em></td><td colspan="2" valign="top">Type of the tuner, see <a class="xref" href="vidioc-g-tuner.html#v4l2-tuner-type" title="Table A.88. enum v4l2_tuner_type">Table A.88, “enum v4l2_tuner_type”</a>.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>capability</code></em></td><td colspan="2" valign="top"><p>Tuner capability flags, see 25<a class="xref" href="vidioc-g-tuner.html#tuner-capability" title="Table A.89. Tuner and Modulator Capability Flags">Table A.89, “Tuner and Modulator Capability Flags”</a>. Audio flags indicate the ability 26to decode audio subprograms. They will <span class="emphasis"><em>not</em></span> 27change, for example with the current video standard.</p><p>When 28the structure refers to a radio tuner the 29<code class="constant">V4L2_TUNER_CAP_LANG1</code>, 30<code class="constant">V4L2_TUNER_CAP_LANG2</code> and 31<code class="constant">V4L2_TUNER_CAP_NORM</code> flags can't be used.</p> 32<p>If multiple frequency bands are supported, then 33<em class="structfield"><code>capability</code></em> is the union of all 34<em class="structfield"><code>capability</code></em> fields of each struct <a class="link" href="vidioc-enum-freq-bands.html#v4l2-frequency-band" title="Table A.37. struct v4l2_frequency_band">v4l2_frequency_band</a>. 35</p></td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>rangelow</code></em></td><td colspan="2" valign="top">The lowest tunable frequency in 36units of 62.5 kHz, or if the <em class="structfield"><code>capability</code></em> 37flag <code class="constant">V4L2_TUNER_CAP_LOW</code> is set, in units of 62.5 38Hz, or if the <em class="structfield"><code>capability</code></em> flag 39<code class="constant">V4L2_TUNER_CAP_1HZ</code> is set, in units of 1 Hz. 40If multiple frequency bands are supported, then 41<em class="structfield"><code>rangelow</code></em> is the lowest frequency 42of all the frequency bands.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>rangehigh</code></em></td><td colspan="2" valign="top">The highest tunable frequency in 43units of 62.5 kHz, or if the <em class="structfield"><code>capability</code></em> 44flag <code class="constant">V4L2_TUNER_CAP_LOW</code> is set, in units of 62.5 45Hz, or if the <em class="structfield"><code>capability</code></em> flag 46<code class="constant">V4L2_TUNER_CAP_1HZ</code> is set, in units of 1 Hz. 47If multiple frequency bands are supported, then 48<em class="structfield"><code>rangehigh</code></em> is the highest frequency 49of all the frequency bands.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>rxsubchans</code></em></td><td colspan="2" valign="top"><p>Some tuners or audio 50decoders can determine the received audio subprograms by analyzing 51audio carriers, pilot tones or other indicators. To pass this 52information drivers set flags defined in <a class="xref" href="vidioc-g-tuner.html#tuner-rxsubchans" title="Table A.90. Tuner Audio Reception Flags">Table A.90, “Tuner Audio Reception Flags”</a> in this field. For 53example:</p></td></tr><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"><code class="constant">V4L2_TUNER_SUB_MONO</code></td><td valign="top">receiving mono audio</td></tr><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"><code class="constant">STEREO | SAP</code></td><td valign="top">receiving stereo audio and a secondary audio 54program</td></tr><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"><code class="constant">MONO | STEREO</code></td><td valign="top">receiving mono or stereo audio, the hardware cannot 55distinguish</td></tr><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"><code class="constant">LANG1 | LANG2</code></td><td valign="top">receiving bilingual audio</td></tr><tr><td valign="top"> </td><td valign="top"> </td><td valign="top"><code class="constant">MONO | STEREO | LANG1 | LANG2</code></td><td valign="top">receiving mono, stereo or bilingual 56audio</td></tr><tr><td valign="top"> </td><td valign="top"> </td><td colspan="2" valign="top"><p>When the 57<code class="constant">V4L2_TUNER_CAP_STEREO</code>, 58<code class="constant">_LANG1</code>, <code class="constant">_LANG2</code> or 59<code class="constant">_SAP</code> flag is cleared in the 60<em class="structfield"><code>capability</code></em> field, the corresponding 61<code class="constant">V4L2_TUNER_SUB_</code> flag must not be set 62here.</p><p>This field is valid only if this is the tuner of the 63current video input, or when the structure refers to a radio 64tuner.</p></td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>audmode</code></em></td><td colspan="2" valign="top"><p>The selected audio mode, see 65<a class="xref" href="vidioc-g-tuner.html#tuner-audmode" title="Table A.91. Tuner Audio Modes">Table A.91, “Tuner Audio Modes”</a> for valid values. The audio mode does 66not affect audio subprogram detection, and like a <a class="link" href="control.html" title="User Controls">control</a> it does not automatically change 67unless the requested mode is invalid or unsupported. See <a class="xref" href="vidioc-g-tuner.html#tuner-matrix" title="Table A.92. Tuner Audio Matrix">Table A.92, “Tuner Audio Matrix”</a> for possible results when 68the selected and received audio programs do not 69match.</p><p>Currently this is the only field of struct 70<span class="structname">v4l2_tuner</span> applications can 71change.</p></td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>signal</code></em></td><td colspan="2" valign="top">The signal strength if known, ranging 72from 0 to 65535. Higher values indicate a better signal.</td></tr><tr><td valign="top">__s32</td><td valign="top"><em class="structfield"><code>afc</code></em></td><td colspan="2" valign="top">Automatic frequency control: When the 73<em class="structfield"><code>afc</code></em> value is negative, the frequency is too 74low, when positive too high.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[4]</td><td colspan="2" valign="top">Reserved for future extensions. Drivers and 75applications must set the array to zero.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="v4l2-tuner-type"></a><p class="title"><b>Table A.88. enum v4l2_tuner_type</b></p><div class="table-contents"><table summary="enum v4l2_tuner_type" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_TUNER_RADIO</code></td><td valign="top">1</td><td valign="top"> </td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_ANALOG_TV</code></td><td valign="top">2</td><td valign="top"> </td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="tuner-capability"></a><p class="title"><b>Table A.89. Tuner and Modulator Capability Flags</b></p><div class="table-contents"><table summary="Tuner and Modulator Capability Flags" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_LOW</code></td><td valign="top">0x0001</td><td valign="top">When set, tuning frequencies are expressed in units of 7662.5 Hz instead of 62.5 kHz.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_NORM</code></td><td valign="top">0x0002</td><td valign="top">This is a multi-standard tuner; the video standard 77can or must be switched. (B/G PAL tuners for example are typically not 78 considered multi-standard because the video standard is automatically 79 determined from the frequency band.) The set of supported video 80 standards is available from the struct <a class="link" href="vidioc-enuminput.html#v4l2-input" title="Table A.39. struct v4l2_input">v4l2_input</a> pointing to this tuner, 81 see the description of ioctl <a class="link" href="vidioc-enuminput.html" title="ioctl VIDIOC_ENUMINPUT"><code class="constant">VIDIOC_ENUMINPUT</code></a> for details. Only 82 <code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners can have this capability.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_HWSEEK_BOUNDED</code></td><td valign="top">0x0004</td><td valign="top">If set, then this tuner supports the hardware seek functionality 83 where the seek stops when it reaches the end of the frequency range.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_HWSEEK_WRAP</code></td><td valign="top">0x0008</td><td valign="top">If set, then this tuner supports the hardware seek functionality 84 where the seek wraps around when it reaches the end of the frequency range.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_STEREO</code></td><td valign="top">0x0010</td><td valign="top">Stereo audio reception is supported.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_LANG1</code></td><td valign="top">0x0040</td><td valign="top">Reception of the primary language of a bilingual 85audio program is supported. Bilingual audio is a feature of 86two-channel systems, transmitting the primary language monaural on the 87main audio carrier and a secondary language monaural on a second 88carrier. Only 89 <code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners can have this capability.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_LANG2</code></td><td valign="top">0x0020</td><td valign="top">Reception of the secondary language of a bilingual 90audio program is supported. Only 91 <code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners can have this capability.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_SAP</code></td><td valign="top">0x0020</td><td valign="top"><p>Reception of a secondary audio program is 92supported. This is a feature of the BTSC system which accompanies the 93NTSC video standard. Two audio carriers are available for mono or 94stereo transmissions of a primary language, and an independent third 95carrier for a monaural secondary language. Only 96 <code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners can have this capability.</p><p>Note the 97<code class="constant">V4L2_TUNER_CAP_LANG2</code> and 98<code class="constant">V4L2_TUNER_CAP_SAP</code> flags are synonyms. 99<code class="constant">V4L2_TUNER_CAP_SAP</code> applies when the tuner 100supports the <code class="constant">V4L2_STD_NTSC_M</code> video 101standard.</p></td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_RDS</code></td><td valign="top">0x0080</td><td valign="top">RDS capture is supported. This capability is only valid for 102radio tuners.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_RDS_BLOCK_IO</code></td><td valign="top">0x0100</td><td valign="top">The RDS data is passed as unparsed RDS blocks.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_RDS_CONTROLS</code></td><td valign="top">0x0200</td><td valign="top">The RDS data is parsed by the hardware and set via controls.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_FREQ_BANDS</code></td><td valign="top">0x0400</td><td valign="top">The <a class="link" href="vidioc-enum-freq-bands.html" title="ioctl VIDIOC_ENUM_FREQ_BANDS"><code class="constant">VIDIOC_ENUM_FREQ_BANDS</code></a> ioctl can be used to enumerate 103 the available frequency bands.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_HWSEEK_PROG_LIM</code></td><td valign="top">0x0800</td><td valign="top">The range to search when using the hardware seek functionality 104 is programmable, see <a class="link" href="vidioc-s-hw-freq-seek.html" title="ioctl VIDIOC_S_HW_FREQ_SEEK"><code class="constant">VIDIOC_S_HW_FREQ_SEEK</code></a> for details.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_CAP_1HZ</code></td><td valign="top">0x1000</td><td valign="top">When set, tuning frequencies are expressed in units of 1 Hz instead of 62.5 kHz.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="tuner-rxsubchans"></a><p class="title"><b>Table A.90. Tuner Audio Reception Flags</b></p><div class="table-contents"><table summary="Tuner Audio Reception Flags" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_TUNER_SUB_MONO</code></td><td valign="top">0x0001</td><td valign="top">The tuner receives a mono audio signal.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_SUB_STEREO</code></td><td valign="top">0x0002</td><td valign="top">The tuner receives a stereo audio signal.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_SUB_LANG1</code></td><td valign="top">0x0008</td><td valign="top">The tuner receives the primary language of a 105bilingual audio signal. Drivers must clear this flag when the current 106video standard is <code class="constant">V4L2_STD_NTSC_M</code>.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_SUB_LANG2</code></td><td valign="top">0x0004</td><td valign="top">The tuner receives the secondary language of a 107bilingual audio signal (or a second audio program).</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_SUB_SAP</code></td><td valign="top">0x0004</td><td valign="top">The tuner receives a Second Audio Program. Note the 108<code class="constant">V4L2_TUNER_SUB_LANG2</code> and 109<code class="constant">V4L2_TUNER_SUB_SAP</code> flags are synonyms. The 110<code class="constant">V4L2_TUNER_SUB_SAP</code> flag applies when the 111current video standard is <code class="constant">V4L2_STD_NTSC_M</code>.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_SUB_RDS</code></td><td valign="top">0x0010</td><td valign="top">The tuner receives an RDS channel.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="tuner-audmode"></a><p class="title"><b>Table A.91. Tuner Audio Modes</b></p><div class="table-contents"><table summary="Tuner Audio Modes" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top"><code class="constant">V4L2_TUNER_MODE_MONO</code></td><td valign="top">0</td><td valign="top">Play mono audio. When the tuner receives a stereo 112signal this a down-mix of the left and right channel. When the tuner 113receives a bilingual or SAP signal this mode selects the primary 114language.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_MODE_STEREO</code></td><td valign="top">1</td><td valign="top"><p>Play stereo audio. When the tuner receives 115bilingual audio it may play different languages on the left and right 116channel or the primary language is played on both channels.</p><p>Playing 117different languages in this mode is 118deprecated. New drivers should do this only in 119<code class="constant">MODE_LANG1_LANG2</code>.</p><p>When the tuner 120receives no stereo signal or does not support stereo reception the 121driver shall fall back to <code class="constant">MODE_MONO</code>.</p></td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_MODE_LANG1</code></td><td valign="top">3</td><td valign="top">Play the primary language, mono or stereo. Only 122<code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners support this 123mode.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_MODE_LANG2</code></td><td valign="top">2</td><td valign="top">Play the secondary language, mono. When the tuner 124receives no bilingual audio or SAP, or their reception is not 125supported the driver shall fall back to mono or stereo mode. Only 126<code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners support this 127mode.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_MODE_SAP</code></td><td valign="top">2</td><td valign="top">Play the Second Audio Program. When the tuner 128receives no bilingual audio or SAP, or their reception is not 129supported the driver shall fall back to mono or stereo mode. Only 130<code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners support this mode. 131Note the <code class="constant">V4L2_TUNER_MODE_LANG2</code> and 132<code class="constant">V4L2_TUNER_MODE_SAP</code> are synonyms.</td></tr><tr><td valign="top"><code class="constant">V4L2_TUNER_MODE_LANG1_LANG2</code></td><td valign="top">4</td><td valign="top">Play the primary language on the left channel, the 133secondary language on the right channel. When the tuner receives no 134bilingual audio or SAP, it shall fall back to 135<code class="constant">MODE_LANG1</code> or <code class="constant">MODE_MONO</code>. 136Only <code class="constant">V4L2_TUNER_ANALOG_TV</code> tuners support this 137mode.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="tuner-matrix"></a><p class="title"><b>Table A.92. Tuner Audio Matrix</b></p><div class="table-contents"><table summary="Tuner Audio Matrix" width="100%" border="1"><colgroup><col align="left"><col align="center" class="c2"><col align="center"><col align="center"><col><col align="center" class="c6"></colgroup><thead><tr><th align="left"> </th><th colspan="5" align="center">Selected 138<code class="constant">V4L2_TUNER_MODE_</code></th></tr><tr><th align="left">Received <code class="constant">V4L2_TUNER_SUB_</code></th><th align="center"><code class="constant">MONO</code></th><th align="center"><code class="constant">STEREO</code></th><th align="center"><code class="constant">LANG1</code></th><th align="center"><code class="constant">LANG2 = SAP</code></th><th align="center"><code class="constant">LANG1_LANG2</code><a href="#ftn.idp1115428964" class="footnote" name="idp1115428964"><sup class="footnote">[a]</sup></a></th></tr></thead><tbody valign="top"><tr><td align="left" valign="top"><code class="constant">MONO</code></td><td align="center" valign="top">Mono</td><td align="center" valign="top">Mono/Mono</td><td align="center" valign="top">Mono</td><td align="center" valign="top">Mono</td><td align="center" valign="top">Mono/Mono</td></tr><tr><td align="left" valign="top"><code class="constant">MONO | SAP</code></td><td align="center" valign="top">Mono</td><td align="center" valign="top">Mono/Mono</td><td align="center" valign="top">Mono</td><td align="center" valign="top">SAP</td><td align="center" valign="top">Mono/SAP (preferred) or Mono/Mono</td></tr><tr><td align="left" valign="top"><code class="constant">STEREO</code></td><td align="center" valign="top">L+R</td><td align="center" valign="top">L/R</td><td align="center" valign="top">Stereo L/R (preferred) or Mono L+R</td><td align="center" valign="top">Stereo L/R (preferred) or Mono L+R</td><td align="center" valign="top">L/R (preferred) or L+R/L+R</td></tr><tr><td align="left" valign="top"><code class="constant">STEREO | SAP</code></td><td align="center" valign="top">L+R</td><td align="center" valign="top">L/R</td><td align="center" valign="top">Stereo L/R (preferred) or Mono L+R</td><td align="center" valign="top">SAP</td><td align="center" valign="top">L+R/SAP (preferred) or L/R or L+R/L+R</td></tr><tr><td align="left" valign="top"><code class="constant">LANG1 | LANG2</code></td><td align="center" valign="top">Language 1</td><td align="center" valign="top">Lang1/Lang2 (deprecated<a href="#ftn.idp1115436620" class="footnote" name="idp1115436620"><sup class="footnote">[b]</sup></a>) or 139Lang1/Lang1</td><td align="center" valign="top">Language 1</td><td align="center" valign="top">Language 2</td><td align="center" valign="top">Lang1/Lang2 (preferred) or Lang1/Lang1</td></tr></tbody><tbody class="footnotes"><tr><td colspan="6"><div id="ftn.idp1115428964" class="footnote"><p><a href="#idp1115428964" class="para"><sup class="para">[a] </sup></a>This 140mode has been added in Linux 2.6.17 and may not be supported by older 141drivers.</p></div><div id="ftn.idp1115436620" class="footnote"><p><a href="#idp1115436620" class="para"><sup class="para">[b] </sup></a>Playback of 142both languages in <code class="constant">MODE_STEREO</code> is deprecated. In 143the future drivers should produce only the primary language in this 144mode. Applications should request 145<code class="constant">MODE_LANG1_LANG2</code> to record both languages or a 146stereo signal.</p></div></td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1115438716"></a><h2>Return Value</h2><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 19.1. Generic error codes">Generic Error Codes</a> chapter.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">EINVAL</span></span></dt><dd><p>The struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a> <em class="structfield"><code>index</code></em> is 147out of bounds.</p></dd></dl></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="vidioc-g-std.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="user-func.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="vidioc-log-status.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_G_STD, VIDIOC_S_STD </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ioctl VIDIOC_LOG_STATUS</td></tr></table></div></body></html> 148