blob: 360d2737e64946d2ad9a33185ea4a3335962284c [file] [log] [blame]
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -03001 <title>RDS Interface</title>
2
3 <para>The Radio Data System transmits supplementary
4information in binary format, for example the station name or travel
5information, on an inaudible audio subcarrier of a radio program. This
Matti Aaltoneneb8942e2010-10-18 10:52:37 -03006interface is aimed at devices capable of receiving and/or transmitting RDS
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -03007information.</para>
8
9 <para>For more information see the core RDS standard <xref linkend="en50067" />
10and the RBDS standard <xref linkend="nrsc4" />.</para>
11
12 <para>Note that the RBDS standard as is used in the USA is almost identical
Matti Aaltoneneb8942e2010-10-18 10:52:37 -030013to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the
14fields have slightly different meanings. See the RBDS standard for more
15information.</para>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -030016
17 <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).
18This is a proprietary format which seems to be discontinued. The RDS interface does not
19support this format. Should support for MMBS (or the so-called 'E blocks' in general)
20be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>
21
22 <section>
23 <title>Querying Capabilities</title>
24
Matti Aaltoneneb8942e2010-10-18 10:52:37 -030025 <para>Devices supporting the RDS capturing API set
26the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -030027the <structfield>capabilities</structfield> field of &v4l2-capability;
Matti Aaltoneneb8942e2010-10-18 10:52:37 -030028returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS
29will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in
30the <structfield>capability</structfield> field of &v4l2-tuner;. If
31the driver only passes RDS blocks without interpreting the data
32the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be
33set, see <link linkend="reading-rds-data">Reading RDS data</link>.
34For future use the
35flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> has also been
36defined. However, a driver for a radio tuner with this capability does
37not yet exist, so if you are planning to write such a driver you
38should discuss this on the linux-media mailing list: &v4l-ml;.</para>
39
40 <para> Whether an RDS signal is present can be detected by looking
41at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;:
42the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data
43was detected.</para>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -030044
45 <para>Devices supporting the RDS output API
46set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in
47the <structfield>capabilities</structfield> field of &v4l2-capability;
48returned by the &VIDIOC-QUERYCAP; ioctl.
49Any modulator that supports RDS will set the
50<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
51field of &v4l2-modulator;.
52In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -030053bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.
54If the driver only passes RDS blocks without interpreting the data
55the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be set. If the
56tuner is capable of handling RDS entities like program identification codes and radio
57text, the flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> should be set,
58see <link linkend="writing-rds-data">Writing RDS data</link> and
59<link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -030060 </section>
61
Matti Aaltoneneb8942e2010-10-18 10:52:37 -030062 <section id="reading-rds-data">
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -030063 <title>Reading RDS data</title>
64
65 <para>RDS data can be read from the radio device
Matti Aaltoneneb8942e2010-10-18 10:52:37 -030066with the &func-read; function. The data is packed in groups of three bytes.</para>
67 </section>
68
69 <section id="writing-rds-data">
70 <title>Writing RDS data</title>
71
72 <para>RDS data can be written to the radio device
73with the &func-write; function. The data is packed in groups of three bytes,
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -030074as follows:</para>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -030075 </section>
76
77 <section>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -030078 <table frame="none" pgwide="1" id="v4l2-rds-data">
79 <title>struct
80<structname>v4l2_rds_data</structname></title>
81 <tgroup cols="3">
82 <colspec colname="c1" colwidth="1*" />
83 <colspec colname="c2" colwidth="1*" />
84 <colspec colname="c3" colwidth="5*" />
85 <tbody valign="top">
86 <row>
87 <entry>__u8</entry>
88 <entry><structfield>lsb</structfield></entry>
89 <entry>Least Significant Byte of RDS Block</entry>
90 </row>
91 <row>
92 <entry>__u8</entry>
93 <entry><structfield>msb</structfield></entry>
94 <entry>Most Significant Byte of RDS Block</entry>
95 </row>
96 <row>
97 <entry>__u8</entry>
98 <entry><structfield>block</structfield></entry>
99 <entry>Block description</entry>
100 </row>
101 </tbody>
102 </tgroup>
103 </table>
104 <table frame="none" pgwide="1" id="v4l2-rds-block">
105 <title>Block description</title>
106 <tgroup cols="2">
107 <colspec colname="c1" colwidth="1*" />
108 <colspec colname="c2" colwidth="5*" />
109 <tbody valign="top">
110 <row>
111 <entry>Bits 0-2</entry>
112 <entry>Block (aka offset) of the received data.</entry>
113 </row>
114 <row>
115 <entry>Bits 3-5</entry>
116 <entry>Deprecated. Currently identical to bits 0-2. Do not use these bits.</entry>
117 </row>
118 <row>
119 <entry>Bit 6</entry>
120 <entry>Corrected bit. Indicates that an error was corrected for this data block.</entry>
121 </row>
122 <row>
123 <entry>Bit 7</entry>
124 <entry>Error bit. Indicates that an uncorrectable error occurred during reception of this block.</entry>
125 </row>
126 </tbody>
127 </tgroup>
128 </table>
129
130 <table frame="none" pgwide="1" id="v4l2-rds-block-codes">
131 <title>Block defines</title>
132 <tgroup cols="3">
133 <colspec colname="c1" colwidth="1*" />
134 <colspec colname="c2" colwidth="1*" />
135 <colspec colname="c3" colwidth="5*" />
136 <tbody valign="top">
137 <row>
138 <entry>V4L2_RDS_BLOCK_MSK</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300139 <entry> </entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300140 <entry>7</entry>
141 <entry>Mask for bits 0-2 to get the block ID.</entry>
142 </row>
143 <row>
144 <entry>V4L2_RDS_BLOCK_A</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300145 <entry> </entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300146 <entry>0</entry>
147 <entry>Block A.</entry>
148 </row>
149 <row>
150 <entry>V4L2_RDS_BLOCK_B</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300151 <entry> </entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300152 <entry>1</entry>
153 <entry>Block B.</entry>
154 </row>
155 <row>
156 <entry>V4L2_RDS_BLOCK_C</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300157 <entry> </entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300158 <entry>2</entry>
159 <entry>Block C.</entry>
160 </row>
161 <row>
162 <entry>V4L2_RDS_BLOCK_D</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300163 <entry> </entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300164 <entry>3</entry>
165 <entry>Block D.</entry>
166 </row>
167 <row>
168 <entry>V4L2_RDS_BLOCK_C_ALT</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300169 <entry> </entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300170 <entry>4</entry>
171 <entry>Block C'.</entry>
172 </row>
173 <row>
174 <entry>V4L2_RDS_BLOCK_INVALID</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300175 <entry>read-only</entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300176 <entry>7</entry>
177 <entry>An invalid block.</entry>
178 </row>
179 <row>
180 <entry>V4L2_RDS_BLOCK_CORRECTED</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300181 <entry>read-only</entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300182 <entry>0x40</entry>
183 <entry>A bit error was detected but corrected.</entry>
184 </row>
185 <row>
186 <entry>V4L2_RDS_BLOCK_ERROR</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300187 <entry>read-only</entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300188 <entry>0x80</entry>
Matti Aaltoneneb8942e2010-10-18 10:52:37 -0300189 <entry>An uncorrectable error occurred.</entry>
Mauro Carvalho Chehab8e080c2e2009-09-13 22:16:04 -0300190 </row>
191 </tbody>
192 </tgroup>
193 </table>
194 </section>
195
196<!--
197Local Variables:
198mode: sgml
199sgml-parent-document: "v4l2.sgml"
200indent-tabs-mode: nil
201End:
202 -->