1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>RDS Interface</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="devices.html" title="Chapter 4. Interfaces"><link rel="prev" href="radio.html" title="Radio Interface"><link rel="next" href="sdr.html" title="Software Defined Radio Interface (SDR)"></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">RDS Interface</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="radio.html">Prev</a> </td><th width="60%" align="center">Chapter 4. Interfaces</th><td width="20%" align="right"> <a accesskey="n" href="sdr.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="rds"></a>RDS Interface</h2></div></div></div><div class="toc"><dl class="toc"><dt><span class="section"><a href="rds.html#idp1105886212">Querying Capabilities</a></span></dt><dt><span class="section"><a href="rds.html#reading-rds-data">Reading RDS data</a></span></dt><dt><span class="section"><a href="rds.html#writing-rds-data">Writing RDS data</a></span></dt><dt><span class="section"><a href="rds.html#idp1105953116">RDS datastructures</a></span></dt></dl></div><p>The Radio Data System transmits supplementary 2information in binary format, for example the station name or travel 3information, on an inaudible audio subcarrier of a radio program. This 4interface is aimed at devices capable of receiving and/or transmitting RDS 5information.</p><p>For more information see the core RDS standard <a class="xref" href="bi01.html#iec62106" title="Specification of the radio data system (RDS) for VHF/FM sound broadcasting in the frequency range from 87,5 to 108,0 MHz">[<abbr class="abbrev">IEC 62106</abbr>]</a> 6and the RBDS standard <a class="xref" href="bi01.html#nrsc4" title="NRSC-4-B: United States RBDS Standard">[<abbr class="abbrev">NRSC-4-B</abbr>]</a>.</p><p>Note that the RBDS standard as is used in the USA is almost identical 7to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the 8fields have slightly different meanings. See the RBDS standard for more 9information.</p><p>The RBDS standard also specifies support for MMBS (Modified Mobile Search). 10This is a proprietary format which seems to be discontinued. The RDS interface does not 11support this format. Should support for MMBS (or the so-called 'E blocks' in general) 12be needed, then 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="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp1105886212"></a>Querying Capabilities</h3></div></div></div><p>Devices supporting the RDS capturing API set 13the <code class="constant">V4L2_CAP_RDS_CAPTURE</code> flag in 14the <em class="structfield"><code>capabilities</code></em> field of struct <a class="link" href="vidioc-querycap.html#v4l2-capability" title="Table A.93. struct v4l2_capability">v4l2_capability</a> 15returned by the <a class="link" href="vidioc-querycap.html" title="ioctl VIDIOC_QUERYCAP"><code class="constant">VIDIOC_QUERYCAP</code></a> ioctl. Any tuner that supports RDS 16will set the <code class="constant">V4L2_TUNER_CAP_RDS</code> flag in 17the <em class="structfield"><code>capability</code></em> field of struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a>. If 18the driver only passes RDS blocks without interpreting the data 19the <code class="constant">V4L2_TUNER_CAP_RDS_BLOCK_IO</code> flag has to be 20set, see <a class="link" href="rds.html#reading-rds-data" title="Reading RDS data">Reading RDS data</a>. 21For future use the 22flag <code class="constant">V4L2_TUNER_CAP_RDS_CONTROLS</code> has also been 23defined. However, a driver for a radio tuner with this capability does 24not yet exist, so if you are planning to write such a driver you 25should discuss this on 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><p> Whether an RDS signal is present can be detected by looking 26at the <em class="structfield"><code>rxsubchans</code></em> field of struct <a class="link" href="vidioc-g-tuner.html#v4l2-tuner" title="Table A.87. struct v4l2_tuner">v4l2_tuner</a>: 27the <code class="constant">V4L2_TUNER_SUB_RDS</code> will be set if RDS data 28was detected.</p><p>Devices supporting the RDS output API 29set the <code class="constant">V4L2_CAP_RDS_OUTPUT</code> flag in 30the <em class="structfield"><code>capabilities</code></em> field of struct <a class="link" href="vidioc-querycap.html#v4l2-capability" title="Table A.93. struct v4l2_capability">v4l2_capability</a> 31returned by the <a class="link" href="vidioc-querycap.html" title="ioctl VIDIOC_QUERYCAP"><code class="constant">VIDIOC_QUERYCAP</code></a> ioctl. 32Any modulator that supports RDS will set the 33<code class="constant">V4L2_TUNER_CAP_RDS</code> flag in the <em class="structfield"><code>capability</code></em> 34field of struct <a class="link" href="vidioc-g-modulator.html#v4l2-modulator" title="Table A.76. struct v4l2_modulator">v4l2_modulator</a>. 35In order to enable the RDS transmission one must set the <code class="constant">V4L2_TUNER_SUB_RDS</code> 36bit in the <em class="structfield"><code>txsubchans</code></em> field of struct <a class="link" href="vidioc-g-modulator.html#v4l2-modulator" title="Table A.76. struct v4l2_modulator">v4l2_modulator</a>. 37If the driver only passes RDS blocks without interpreting the data 38the <code class="constant">V4L2_TUNER_CAP_RDS_BLOCK_IO</code> flag has to be set. If the 39tuner is capable of handling RDS entities like program identification codes and radio 40text, the flag <code class="constant">V4L2_TUNER_CAP_RDS_CONTROLS</code> should be set, 41see <a class="link" href="rds.html#writing-rds-data" title="Writing RDS data">Writing RDS data</a> and 42<a class="link" href="extended-controls.html#fm-tx-controls" title="FM Transmitter Control Reference">FM Transmitter Control Reference</a>.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="reading-rds-data"></a>Reading RDS data</h3></div></div></div><p>RDS data can be read from the radio device 43with the <a class="link" href="func-read.html" title="V4L2 read()"><code class="function">read()</code></a> function. The data is packed in groups of three bytes.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="writing-rds-data"></a>Writing RDS data</h3></div></div></div><p>RDS data can be written to the radio device 44with the <a class="link" href="func-write.html" title="V4L2 write()"><code class="function">write()</code></a> function. The data is packed in groups of three bytes, 45as follows:</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a name="idp1105953116"></a>RDS datastructures</h3></div></div></div><div class="table"><a name="v4l2-rds-data"></a><p class="title"><b>Table 4.15. struct 46<span class="structname">v4l2_rds_data</span></b></p><div class="table-contents"><table summary="struct 47v4l2_rds_data" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"></colgroup><tbody valign="top"><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>lsb</code></em></td><td valign="top">Least Significant Byte of RDS Block</td></tr><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>msb</code></em></td><td valign="top">Most Significant Byte of RDS Block</td></tr><tr><td valign="top">__u8</td><td valign="top"><em class="structfield"><code>block</code></em></td><td valign="top">Block description</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="v4l2-rds-block"></a><p class="title"><b>Table 4.16. Block description</b></p><div class="table-contents"><table summary="Block description" width="100%" border="0"><colgroup><col class="c1"><col class="c2"></colgroup><tbody valign="top"><tr><td valign="top">Bits 0-2</td><td valign="top">Block (aka offset) of the received data.</td></tr><tr><td valign="top">Bits 3-5</td><td valign="top">Deprecated. Currently identical to bits 0-2. Do not use these bits.</td></tr><tr><td valign="top">Bit 6</td><td valign="top">Corrected bit. Indicates that an error was corrected for this data block.</td></tr><tr><td valign="top">Bit 7</td><td valign="top">Error bit. Indicates that an uncorrectable error occurred during reception of this block.</td></tr></tbody></table></div></div><br class="table-break"><div class="table"><a name="v4l2-rds-block-codes"></a><p class="title"><b>Table 4.17. Block defines</b></p><div class="table-contents"><table summary="Block defines" width="100%" border="0"><colgroup><col class="c1"><col class="c2"><col class="c3"><col class="c4"></colgroup><tbody valign="top"><tr><td valign="top">V4L2_RDS_BLOCK_MSK</td><td valign="top"> </td><td valign="top">7</td><td valign="top">Mask for bits 0-2 to get the block ID.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_A</td><td valign="top"> </td><td valign="top">0</td><td valign="top">Block A.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_B</td><td valign="top"> </td><td valign="top">1</td><td valign="top">Block B.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_C</td><td valign="top"> </td><td valign="top">2</td><td valign="top">Block C.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_D</td><td valign="top"> </td><td valign="top">3</td><td valign="top">Block D.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_C_ALT</td><td valign="top"> </td><td valign="top">4</td><td valign="top">Block C'.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_INVALID</td><td valign="top">read-only</td><td valign="top">7</td><td valign="top">An invalid block.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_CORRECTED</td><td valign="top">read-only</td><td valign="top">0x40</td><td valign="top">A bit error was detected but corrected.</td></tr><tr><td valign="top">V4L2_RDS_BLOCK_ERROR</td><td valign="top">read-only</td><td valign="top">0x80</td><td valign="top">An uncorrectable error occurred.</td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="radio.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="devices.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="sdr.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Radio Interface </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Software Defined Radio Interface (SDR)</td></tr></table></div></body></html> 48