1 .. -*- coding: utf-8; mode: rst -*-
9 The Radio Data System transmits supplementary information in binary
10 format, for example the station name or travel information, on an
11 inaudible audio subcarrier of a radio program. This interface is aimed
12 at devices capable of receiving and/or transmitting RDS information.
14 For more information see the core RDS standard :ref:`iec62106` and the
15 RBDS standard :ref:`nrsc4`.
19 Note that the RBDS standard as is used in the USA is almost
20 identical to the RDS standard. Any RDS decoder/encoder can also handle
21 RBDS. Only some of the fields have slightly different meanings. See the
22 RBDS standard for more information.
24 The RBDS standard also specifies support for MMBS (Modified Mobile
25 Search). This is a proprietary format which seems to be discontinued.
26 The RDS interface does not support this format. Should support for MMBS
27 (or the so-called 'E blocks' in general) be needed, then please contact
28 the linux-media mailing list:
29 `https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
35 Devices supporting the RDS capturing API set the
36 ``V4L2_CAP_RDS_CAPTURE`` flag in the ``capabilities`` field of struct
37 :c:type:`v4l2_capability` returned by the
38 :ref:`VIDIOC_QUERYCAP` ioctl. Any tuner that
39 supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
40 ``capability`` field of struct :c:type:`v4l2_tuner`. If the
41 driver only passes RDS blocks without interpreting the data the
42 ``V4L2_TUNER_CAP_RDS_BLOCK_IO`` flag has to be set, see
43 :ref:`Reading RDS data <reading-rds-data>`. For future use the flag
44 ``V4L2_TUNER_CAP_RDS_CONTROLS`` has also been defined. However, a driver
45 for a radio tuner with this capability does not yet exist, so if you are
46 planning to write such a driver you should discuss this on the
47 linux-media mailing list:
48 `https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
50 Whether an RDS signal is present can be detected by looking at the
51 ``rxsubchans`` field of struct :c:type:`v4l2_tuner`: the
52 ``V4L2_TUNER_SUB_RDS`` will be set if RDS data was detected.
54 Devices supporting the RDS output API set the ``V4L2_CAP_RDS_OUTPUT``
55 flag in the ``capabilities`` field of struct
56 :c:type:`v4l2_capability` returned by the
57 :ref:`VIDIOC_QUERYCAP` ioctl. Any modulator that
58 supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
59 ``capability`` field of struct
60 :c:type:`v4l2_modulator`. In order to enable the RDS
61 transmission one must set the ``V4L2_TUNER_SUB_RDS`` bit in the
62 ``txsubchans`` field of struct
63 :c:type:`v4l2_modulator`. If the driver only passes RDS
64 blocks without interpreting the data the ``V4L2_TUNER_CAP_RDS_BLOCK_IO``
65 flag has to be set. If the tuner is capable of handling RDS entities
66 like program identification codes and radio text, the flag
67 ``V4L2_TUNER_CAP_RDS_CONTROLS`` should be set, see
68 :ref:`Writing RDS data <writing-rds-data>` and
69 :ref:`FM Transmitter Control Reference <fm-tx-controls>`.
77 RDS data can be read from the radio device with the
78 :ref:`read() <func-read>` function. The data is packed in groups of
87 RDS data can be written to the radio device with the
88 :ref:`write() <func-write>` function. The data is packed in groups of
89 three bytes, as follows:
96 .. c:type:: v4l2_rds_data
98 .. tabularcolumns:: |p{2.5cm}|p{2.5cm}|p{12.5cm}|
100 .. flat-table:: struct v4l2_rds_data
107 - Least Significant Byte of RDS Block
110 - Most Significant Byte of RDS Block
119 .. tabularcolumns:: |p{2.9cm}|p{14.6cm}|
121 .. flat-table:: Block description
127 - Block (aka offset) of the received data.
129 - Deprecated. Currently identical to bits 0-2. Do not use these
132 - Corrected bit. Indicates that an error was corrected for this data
135 - Error bit. Indicates that an uncorrectable error occurred during
136 reception of this block.
140 .. _v4l2-rds-block-codes:
142 .. tabularcolumns:: |p{5.6cm}|p{2.0cm}|p{1.5cm}|p{7.0cm}|
144 .. flat-table:: Block defines
149 * - V4L2_RDS_BLOCK_MSK
152 - Mask for bits 0-2 to get the block ID.
169 * - V4L2_RDS_BLOCK_C_ALT
173 * - V4L2_RDS_BLOCK_INVALID
177 * - V4L2_RDS_BLOCK_CORRECTED
180 - A bit error was detected but corrected.
181 * - V4L2_RDS_BLOCK_ERROR
184 - An uncorrectable error occurred.