dev-rds.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <title>RDS Interface</title>
  2. <para>The Radio Data System transmits supplementary
  3. information in binary format, for example the station name or travel
  4. information, on an inaudible audio subcarrier of a radio program. This
  5. interface is aimed at devices capable of receiving and/or transmitting RDS
  6. information.</para>
  7. <para>For more information see the core RDS standard <xref linkend="iec62106" />
  8. and the RBDS standard <xref linkend="nrsc4" />.</para>
  9. <para>Note that the RBDS standard as is used in the USA is almost identical
  10. to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the
  11. fields have slightly different meanings. See the RBDS standard for more
  12. information.</para>
  13. <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).
  14. This is a proprietary format which seems to be discontinued. The RDS interface does not
  15. support this format. Should support for MMBS (or the so-called 'E blocks' in general)
  16. be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>
  17. <section>
  18. <title>Querying Capabilities</title>
  19. <para>Devices supporting the RDS capturing API set
  20. the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in
  21. the <structfield>capabilities</structfield> field of &v4l2-capability;
  22. returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS
  23. will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in
  24. the <structfield>capability</structfield> field of &v4l2-tuner;. If
  25. the driver only passes RDS blocks without interpreting the data
  26. the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be
  27. set, see <link linkend="reading-rds-data">Reading RDS data</link>.
  28. For future use the
  29. flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> has also been
  30. defined. However, a driver for a radio tuner with this capability does
  31. not yet exist, so if you are planning to write such a driver you
  32. should discuss this on the linux-media mailing list: &v4l-ml;.</para>
  33. <para> Whether an RDS signal is present can be detected by looking
  34. at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;:
  35. the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data
  36. was detected.</para>
  37. <para>Devices supporting the RDS output API
  38. set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in
  39. the <structfield>capabilities</structfield> field of &v4l2-capability;
  40. returned by the &VIDIOC-QUERYCAP; ioctl.
  41. Any modulator that supports RDS will set the
  42. <constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
  43. field of &v4l2-modulator;.
  44. In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
  45. bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.
  46. If the driver only passes RDS blocks without interpreting the data
  47. the <constant>V4L2_TUNER_CAP_RDS_BLOCK_IO</constant> flag has to be set. If the
  48. tuner is capable of handling RDS entities like program identification codes and radio
  49. text, the flag <constant>V4L2_TUNER_CAP_RDS_CONTROLS</constant> should be set,
  50. see <link linkend="writing-rds-data">Writing RDS data</link> and
  51. <link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>
  52. </section>
  53. <section id="reading-rds-data">
  54. <title>Reading RDS data</title>
  55. <para>RDS data can be read from the radio device
  56. with the &func-read; function. The data is packed in groups of three bytes.</para>
  57. </section>
  58. <section id="writing-rds-data">
  59. <title>Writing RDS data</title>
  60. <para>RDS data can be written to the radio device
  61. with the &func-write; function. The data is packed in groups of three bytes,
  62. as follows:</para>
  63. </section>
  64. <section>
  65. <title>RDS datastructures</title>
  66. <table frame="none" pgwide="1" id="v4l2-rds-data">
  67. <title>struct
  68. <structname>v4l2_rds_data</structname></title>
  69. <tgroup cols="3">
  70. <colspec colname="c1" colwidth="1*" />
  71. <colspec colname="c2" colwidth="1*" />
  72. <colspec colname="c3" colwidth="5*" />
  73. <tbody valign="top">
  74. <row>
  75. <entry>__u8</entry>
  76. <entry><structfield>lsb</structfield></entry>
  77. <entry>Least Significant Byte of RDS Block</entry>
  78. </row>
  79. <row>
  80. <entry>__u8</entry>
  81. <entry><structfield>msb</structfield></entry>
  82. <entry>Most Significant Byte of RDS Block</entry>
  83. </row>
  84. <row>
  85. <entry>__u8</entry>
  86. <entry><structfield>block</structfield></entry>
  87. <entry>Block description</entry>
  88. </row>
  89. </tbody>
  90. </tgroup>
  91. </table>
  92. <table frame="none" pgwide="1" id="v4l2-rds-block">
  93. <title>Block description</title>
  94. <tgroup cols="2">
  95. <colspec colname="c1" colwidth="1*" />
  96. <colspec colname="c2" colwidth="5*" />
  97. <tbody valign="top">
  98. <row>
  99. <entry>Bits 0-2</entry>
  100. <entry>Block (aka offset) of the received data.</entry>
  101. </row>
  102. <row>
  103. <entry>Bits 3-5</entry>
  104. <entry>Deprecated. Currently identical to bits 0-2. Do not use these bits.</entry>
  105. </row>
  106. <row>
  107. <entry>Bit 6</entry>
  108. <entry>Corrected bit. Indicates that an error was corrected for this data block.</entry>
  109. </row>
  110. <row>
  111. <entry>Bit 7</entry>
  112. <entry>Error bit. Indicates that an uncorrectable error occurred during reception of this block.</entry>
  113. </row>
  114. </tbody>
  115. </tgroup>
  116. </table>
  117. <table frame="none" pgwide="1" id="v4l2-rds-block-codes">
  118. <title>Block defines</title>
  119. <tgroup cols="4">
  120. <colspec colname="c1" colwidth="1*" />
  121. <colspec colname="c2" colwidth="1*" />
  122. <colspec colname="c3" colwidth="1*" />
  123. <colspec colname="c4" colwidth="5*" />
  124. <tbody valign="top">
  125. <row>
  126. <entry>V4L2_RDS_BLOCK_MSK</entry>
  127. <entry> </entry>
  128. <entry>7</entry>
  129. <entry>Mask for bits 0-2 to get the block ID.</entry>
  130. </row>
  131. <row>
  132. <entry>V4L2_RDS_BLOCK_A</entry>
  133. <entry> </entry>
  134. <entry>0</entry>
  135. <entry>Block A.</entry>
  136. </row>
  137. <row>
  138. <entry>V4L2_RDS_BLOCK_B</entry>
  139. <entry> </entry>
  140. <entry>1</entry>
  141. <entry>Block B.</entry>
  142. </row>
  143. <row>
  144. <entry>V4L2_RDS_BLOCK_C</entry>
  145. <entry> </entry>
  146. <entry>2</entry>
  147. <entry>Block C.</entry>
  148. </row>
  149. <row>
  150. <entry>V4L2_RDS_BLOCK_D</entry>
  151. <entry> </entry>
  152. <entry>3</entry>
  153. <entry>Block D.</entry>
  154. </row>
  155. <row>
  156. <entry>V4L2_RDS_BLOCK_C_ALT</entry>
  157. <entry> </entry>
  158. <entry>4</entry>
  159. <entry>Block C'.</entry>
  160. </row>
  161. <row>
  162. <entry>V4L2_RDS_BLOCK_INVALID</entry>
  163. <entry>read-only</entry>
  164. <entry>7</entry>
  165. <entry>An invalid block.</entry>
  166. </row>
  167. <row>
  168. <entry>V4L2_RDS_BLOCK_CORRECTED</entry>
  169. <entry>read-only</entry>
  170. <entry>0x40</entry>
  171. <entry>A bit error was detected but corrected.</entry>
  172. </row>
  173. <row>
  174. <entry>V4L2_RDS_BLOCK_ERROR</entry>
  175. <entry>read-only</entry>
  176. <entry>0x80</entry>
  177. <entry>An uncorrectable error occurred.</entry>
  178. </row>
  179. </tbody>
  180. </tgroup>
  181. </table>
  182. </section>