2009-09-14 09:16:04 +08:00
|
|
|
<title>RDS Interface</title>
|
|
|
|
|
|
|
|
<para>The Radio Data System transmits supplementary
|
|
|
|
information in binary format, for example the station name or travel
|
|
|
|
information, on an inaudible audio subcarrier of a radio program. This
|
2010-10-18 21:52:37 +08:00
|
|
|
interface is aimed at devices capable of receiving and/or transmitting RDS
|
2009-09-14 09:16:04 +08:00
|
|
|
information.</para>
|
|
|
|
|
2012-08-14 17:10:02 +08:00
|
|
|
<para>For more information see the core RDS standard <xref linkend="iec62106" />
|
2009-09-14 09:16:04 +08:00
|
|
|
and the RBDS standard <xref linkend="nrsc4" />.</para>
|
|
|
|
|
|
|
|
<para>Note that the RBDS standard as is used in the USA is almost identical
|
2010-10-18 21:52:37 +08:00
|
|
|
to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the
|
|
|
|
fields have slightly different meanings. See the RBDS standard for more
|
|
|
|
information.</para>
|
2009-09-14 09:16:04 +08:00
|
|
|
|
|
|
|
<para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).
|
|
|
|
This is a proprietary format which seems to be discontinued. The RDS interface does not
|
|
|
|
support this format. Should support for MMBS (or the so-called 'E blocks' in general)
|
|
|
|
be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<title>Querying Capabilities</title>
|
|
|
|
|
2010-10-18 21:52:37 +08:00
|
|
|
<para>Devices supporting the RDS capturing API set
|
|
|
|
the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in
|
2009-09-14 09:16:04 +08:00
|
|
|
the <structfield>capabilities</structfield> field of &v4l2-capability;
|
2010-10-18 21:52:37 +08:00
|
|
|
returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS
|
|
|
|
will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in
|
|
|
|
the <structfield>capability</structfield> field of &v4l2-tuner;. If
|
|
|
|
the driver only passes RDS blocks without interpreting the data
|
2011-10-12 17:58:44 +08:00
|
|
|
the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be
|
2010-10-18 21:52:37 +08:00
|
|
|
set, see <link linkend="reading-rds-data">Reading RDS data</link>.
|
|
|
|
For future use the
|
2011-10-12 17:58:44 +08:00
|
|
|
flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> has also been
|
2010-10-18 21:52:37 +08:00
|
|
|
defined. However, a driver for a radio tuner with this capability does
|
|
|
|
not yet exist, so if you are planning to write such a driver you
|
|
|
|
should discuss this on the linux-media mailing list: &v4l-ml;.</para>
|
|
|
|
|
|
|
|
<para> Whether an RDS signal is present can be detected by looking
|
|
|
|
at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;:
|
|
|
|
the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data
|
|
|
|
was detected.</para>
|
2009-09-14 09:16:04 +08:00
|
|
|
|
|
|
|
<para>Devices supporting the RDS output API
|
|
|
|
set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in
|
|
|
|
the <structfield>capabilities</structfield> field of &v4l2-capability;
|
|
|
|
returned by the &VIDIOC-QUERYCAP; ioctl.
|
|
|
|
Any modulator that supports RDS will set the
|
|
|
|
<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
|
|
|
|
field of &v4l2-modulator;.
|
|
|
|
In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
|
2010-10-18 21:52:37 +08:00
|
|
|
bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.
|
|
|
|
If the driver only passes RDS blocks without interpreting the data
|
2011-10-12 17:58:44 +08:00
|
|
|
the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be set. If the
|
2010-10-18 21:52:37 +08:00
|
|
|
tuner is capable of handling RDS entities like program identification codes and radio
|
2011-10-12 17:58:44 +08:00
|
|
|
text, the flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> should be set,
|
2010-10-18 21:52:37 +08:00
|
|
|
see <link linkend="writing-rds-data">Writing RDS data</link> and
|
|
|
|
<link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>
|
2009-09-14 09:16:04 +08:00
|
|
|
</section>
|
|
|
|
|
2010-10-18 21:52:37 +08:00
|
|
|
<section id="reading-rds-data">
|
2009-09-14 09:16:04 +08:00
|
|
|
<title>Reading RDS data</title>
|
|
|
|
|
|
|
|
<para>RDS data can be read from the radio device
|
2010-10-18 21:52:37 +08:00
|
|
|
with the &func-read; function. The data is packed in groups of three bytes.</para>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section id="writing-rds-data">
|
|
|
|
<title>Writing RDS data</title>
|
|
|
|
|
|
|
|
<para>RDS data can be written to the radio device
|
|
|
|
with the &func-write; function. The data is packed in groups of three bytes,
|
2009-09-14 09:16:04 +08:00
|
|
|
as follows:</para>
|
2010-10-18 21:52:37 +08:00
|
|
|
</section>
|
|
|
|
|
|
|
|
<section>
|
2011-01-17 04:09:54 +08:00
|
|
|
<title>RDS datastructures</title>
|
2009-09-14 09:16:04 +08:00
|
|
|
<table frame="none" pgwide="1" id="v4l2-rds-data">
|
|
|
|
<title>struct
|
|
|
|
<structname>v4l2_rds_data</structname></title>
|
|
|
|
<tgroup cols="3">
|
|
|
|
<colspec colname="c1" colwidth="1*" />
|
|
|
|
<colspec colname="c2" colwidth="1*" />
|
|
|
|
<colspec colname="c3" colwidth="5*" />
|
|
|
|
<tbody valign="top">
|
|
|
|
<row>
|
|
|
|
<entry>__u8</entry>
|
|
|
|
<entry><structfield>lsb</structfield></entry>
|
|
|
|
<entry>Least Significant Byte of RDS Block</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>__u8</entry>
|
|
|
|
<entry><structfield>msb</structfield></entry>
|
|
|
|
<entry>Most Significant Byte of RDS Block</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>__u8</entry>
|
|
|
|
<entry><structfield>block</structfield></entry>
|
|
|
|
<entry>Block description</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
<table frame="none" pgwide="1" id="v4l2-rds-block">
|
|
|
|
<title>Block description</title>
|
|
|
|
<tgroup cols="2">
|
|
|
|
<colspec colname="c1" colwidth="1*" />
|
|
|
|
<colspec colname="c2" colwidth="5*" />
|
|
|
|
<tbody valign="top">
|
|
|
|
<row>
|
|
|
|
<entry>Bits 0-2</entry>
|
|
|
|
<entry>Block (aka offset) of the received data.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>Bits 3-5</entry>
|
|
|
|
<entry>Deprecated. Currently identical to bits 0-2. Do not use these bits.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>Bit 6</entry>
|
|
|
|
<entry>Corrected bit. Indicates that an error was corrected for this data block.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>Bit 7</entry>
|
|
|
|
<entry>Error bit. Indicates that an uncorrectable error occurred during reception of this block.</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<table frame="none" pgwide="1" id="v4l2-rds-block-codes">
|
|
|
|
<title>Block defines</title>
|
2011-01-17 04:09:54 +08:00
|
|
|
<tgroup cols="4">
|
2009-09-14 09:16:04 +08:00
|
|
|
<colspec colname="c1" colwidth="1*" />
|
|
|
|
<colspec colname="c2" colwidth="1*" />
|
2011-01-17 04:09:54 +08:00
|
|
|
<colspec colname="c3" colwidth="1*" />
|
|
|
|
<colspec colname="c4" colwidth="5*" />
|
2009-09-14 09:16:04 +08:00
|
|
|
<tbody valign="top">
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_MSK</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry> </entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>7</entry>
|
|
|
|
<entry>Mask for bits 0-2 to get the block ID.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_A</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry> </entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>0</entry>
|
|
|
|
<entry>Block A.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_B</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry> </entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>1</entry>
|
|
|
|
<entry>Block B.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_C</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry> </entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>2</entry>
|
|
|
|
<entry>Block C.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_D</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry> </entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>3</entry>
|
|
|
|
<entry>Block D.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_C_ALT</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry> </entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>4</entry>
|
|
|
|
<entry>Block C'.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_INVALID</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry>read-only</entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>7</entry>
|
|
|
|
<entry>An invalid block.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_CORRECTED</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry>read-only</entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>0x40</entry>
|
|
|
|
<entry>A bit error was detected but corrected.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>V4L2_RDS_BLOCK_ERROR</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry>read-only</entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
<entry>0x80</entry>
|
2010-10-18 21:52:37 +08:00
|
|
|
<entry>An uncorrectable error occurred.</entry>
|
2009-09-14 09:16:04 +08:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</section>
|