1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>ioctl VIDIOC_ENUM_FREQ_BANDS</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-enum-frameintervals.html" title="ioctl VIDIOC_ENUM_FRAMEINTERVALS"><link rel="next" href="vidioc-enuminput.html" title="ioctl VIDIOC_ENUMINPUT"></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_ENUM_FREQ_BANDS</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="vidioc-enum-frameintervals.html">Prev</a> </td><th width="60%" align="center">Appendix A. Function Reference</th><td width="20%" align="right"> <a accesskey="n" href="vidioc-enuminput.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="vidioc-enum-freq-bands"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>VIDIOC_ENUM_FREQ_BANDS — Enumerate supported frequency bands</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_frequency_band 2*<var class="pdparam">argp</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="idp1113109644"></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_ENUM_FREQ_BANDS</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="idp1113113740"></a><h2>Description</h2><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Experimental</h3><p>This is an <a class="link" href="hist-v4l2.html#experimental" title="Experimental API Elements"> experimental </a> 3 interface and may change in the future.</p></div><p>Enumerates the frequency bands that a tuner or modulator supports. 4To do this applications initialize the <em class="structfield"><code>tuner</code></em>, 5<em class="structfield"><code>type</code></em> and <em class="structfield"><code>index</code></em> fields, 6and zero out the <em class="structfield"><code>reserved</code></em> array of a 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> and 7call the <code class="constant">VIDIOC_ENUM_FREQ_BANDS</code> ioctl with a pointer 8to this structure.</p><p>This ioctl is supported if the <code class="constant">V4L2_TUNER_CAP_FREQ_BANDS</code> capability 9 of the corresponding tuner/modulator is set.</p><div class="table"><a name="v4l2-frequency-band"></a><p class="title"><b>Table A.37. struct <span class="structname">v4l2_frequency_band</span></b></p><div class="table-contents"><table summary="struct v4l2_frequency_band" 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>tuner</code></em></td><td valign="top">The tuner or modulator index number. This is the 10same value as in the struct <a class="link" href="vidioc-enuminput.html#v4l2-input" title="Table A.39. struct v4l2_input">v4l2_input</a> <em class="structfield"><code>tuner</code></em> 11field and 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> field, or 12the struct <a class="link" href="vidioc-enumoutput.html#v4l2-output" title="Table A.43. struct v4l2_output">v4l2_output</a> <em class="structfield"><code>modulator</code></em> field and the 13struct <a class="link" href="vidioc-g-modulator.html#v4l2-modulator" title="Table A.76. struct v4l2_modulator">v4l2_modulator</a> <em class="structfield"><code>index</code></em> field.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>type</code></em></td><td valign="top">The tuner type. This is the same value as in the 14struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a> <em class="structfield"><code>type</code></em> field. The type must be set 15to <code class="constant">V4L2_TUNER_RADIO</code> for <code class="filename">/dev/radioX</code> 16device nodes, and to <code class="constant">V4L2_TUNER_ANALOG_TV</code> 17for all others. Set this field to <code class="constant">V4L2_TUNER_RADIO</code> for 18modulators (currently only radio modulators are supported). 19See <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>index</code></em></td><td valign="top">Identifies the frequency band, set by the application.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>capability</code></em></td><td colspan="3" valign="top">The tuner/modulator capability flags for 20this frequency band, see <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>. The <code class="constant">V4L2_TUNER_CAP_LOW</code> 21or <code class="constant">V4L2_TUNER_CAP_1HZ</code> capability must be the same for all frequency bands of the selected tuner/modulator. 22So either all bands have that capability set, or none of them have that capability.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>rangelow</code></em></td><td colspan="3" valign="top">The lowest tunable frequency in 23units of 62.5 kHz, or if the <em class="structfield"><code>capability</code></em> 24flag <code class="constant">V4L2_TUNER_CAP_LOW</code> is set, in units of 62.5 25Hz, for this frequency band. A 1 Hz unit is used when the <em class="structfield"><code>capability</code></em> flag 26<code class="constant">V4L2_TUNER_CAP_1HZ</code> is set.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>rangehigh</code></em></td><td colspan="3" valign="top">The highest tunable frequency in 27units of 62.5 kHz, or if the <em class="structfield"><code>capability</code></em> 28flag <code class="constant">V4L2_TUNER_CAP_LOW</code> is set, in units of 62.5 29Hz, for this frequency band. A 1 Hz unit is used when the <em class="structfield"><code>capability</code></em> flag 30<code class="constant">V4L2_TUNER_CAP_1HZ</code> is set.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>modulation</code></em></td><td colspan="3" valign="top">The supported modulation systems of this frequency band. 31 See <a class="xref" href="vidioc-enum-freq-bands.html#band-modulation" title="Table A.38. Band Modulation Systems">Table A.38, “Band Modulation Systems”</a>. Note that currently only one 32 modulation system per frequency band is supported. More work will need to 33 be done if multiple modulation systems are possible. Contact the 34 linux-media mailing list (<a class="ulink" href="http://www.linuxtv.org/lists.php" target="_top">http://www.linuxtv.org/lists.php</a>) if you need that functionality.</td></tr><tr><td valign="top">__u32</td><td valign="top"><em class="structfield"><code>reserved</code></em>[9]</td><td valign="top">Reserved for future extensions. Applications and drivers 35 must set the array to zero.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="band-modulation"></a><p class="title"><b>Table A.38. Band Modulation Systems</b></p><div class="table-contents"><table summary="Band Modulation Systems" 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_BAND_MODULATION_VSB</code></td><td valign="top">0x02</td><td valign="top">Vestigial Sideband modulation, used for analog TV.</td></tr><tr><td valign="top"><code class="constant">V4L2_BAND_MODULATION_FM</code></td><td valign="top">0x04</td><td valign="top">Frequency Modulation, commonly used for analog radio.</td></tr><tr><td valign="top"><code class="constant">V4L2_BAND_MODULATION_AM</code></td><td valign="top">0x08</td><td valign="top">Amplitude Modulation, commonly used for analog radio.</td></tr></tbody></table></div></div><br class="table-break"></div><div class="refsect1"><a name="idp1113143988"></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 <em class="structfield"><code>tuner</code></em> or <em class="structfield"><code>index</code></em> 36is out of bounds or the <em class="structfield"><code>type</code></em> field is wrong.</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-enum-frameintervals.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-enuminput.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ioctl VIDIOC_ENUM_FRAMEINTERVALS </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ioctl VIDIOC_ENUMINPUT</td></tr></table></div></body></html> 37