dev-rds.xml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 decoding RDS
  6. information.</para>
  7. <para>For more information see the core RDS standard <xref linkend="en50067" />
  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 can also handle RBDS. Only some of the fields
  11. have slightly different meanings. See the RBDS standard for more information.</para>
  12. <para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).
  13. This is a proprietary format which seems to be discontinued. The RDS interface does not
  14. support this format. Should support for MMBS (or the so-called 'E blocks' in general)
  15. be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>
  16. <section>
  17. <title>Querying Capabilities</title>
  18. <para>Devices supporting the RDS capturing API
  19. set the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in
  20. the <structfield>capabilities</structfield> field of &v4l2-capability;
  21. returned by the &VIDIOC-QUERYCAP; ioctl.
  22. Any tuner that supports RDS will set the
  23. <constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
  24. field of &v4l2-tuner;.
  25. Whether an RDS signal is present can be detected by looking at
  26. the <structfield>rxsubchans</structfield> field of &v4l2-tuner;: the
  27. <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data was detected.</para>
  28. <para>Devices supporting the RDS output API
  29. set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in
  30. the <structfield>capabilities</structfield> field of &v4l2-capability;
  31. returned by the &VIDIOC-QUERYCAP; ioctl.
  32. Any modulator that supports RDS will set the
  33. <constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>
  34. field of &v4l2-modulator;.
  35. In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>
  36. bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.</para>
  37. </section>
  38. <section>
  39. <title>Reading RDS data</title>
  40. <para>RDS data can be read from the radio device
  41. with the &func-read; function. The data is packed in groups of three bytes,
  42. as follows:</para>
  43. <table frame="none" pgwide="1" id="v4l2-rds-data">
  44. <title>struct
  45. <structname>v4l2_rds_data</structname></title>
  46. <tgroup cols="3">
  47. <colspec colname="c1" colwidth="1*" />
  48. <colspec colname="c2" colwidth="1*" />
  49. <colspec colname="c3" colwidth="5*" />
  50. <tbody valign="top">
  51. <row>
  52. <entry>__u8</entry>
  53. <entry><structfield>lsb</structfield></entry>
  54. <entry>Least Significant Byte of RDS Block</entry>
  55. </row>
  56. <row>
  57. <entry>__u8</entry>
  58. <entry><structfield>msb</structfield></entry>
  59. <entry>Most Significant Byte of RDS Block</entry>
  60. </row>
  61. <row>
  62. <entry>__u8</entry>
  63. <entry><structfield>block</structfield></entry>
  64. <entry>Block description</entry>
  65. </row>
  66. </tbody>
  67. </tgroup>
  68. </table>
  69. <table frame="none" pgwide="1" id="v4l2-rds-block">
  70. <title>Block description</title>
  71. <tgroup cols="2">
  72. <colspec colname="c1" colwidth="1*" />
  73. <colspec colname="c2" colwidth="5*" />
  74. <tbody valign="top">
  75. <row>
  76. <entry>Bits 0-2</entry>
  77. <entry>Block (aka offset) of the received data.</entry>
  78. </row>
  79. <row>
  80. <entry>Bits 3-5</entry>
  81. <entry>Deprecated. Currently identical to bits 0-2. Do not use these bits.</entry>
  82. </row>
  83. <row>
  84. <entry>Bit 6</entry>
  85. <entry>Corrected bit. Indicates that an error was corrected for this data block.</entry>
  86. </row>
  87. <row>
  88. <entry>Bit 7</entry>
  89. <entry>Error bit. Indicates that an uncorrectable error occurred during reception of this block.</entry>
  90. </row>
  91. </tbody>
  92. </tgroup>
  93. </table>
  94. <table frame="none" pgwide="1" id="v4l2-rds-block-codes">
  95. <title>Block defines</title>
  96. <tgroup cols="3">
  97. <colspec colname="c1" colwidth="1*" />
  98. <colspec colname="c2" colwidth="1*" />
  99. <colspec colname="c3" colwidth="5*" />
  100. <tbody valign="top">
  101. <row>
  102. <entry>V4L2_RDS_BLOCK_MSK</entry>
  103. <entry>7</entry>
  104. <entry>Mask for bits 0-2 to get the block ID.</entry>
  105. </row>
  106. <row>
  107. <entry>V4L2_RDS_BLOCK_A</entry>
  108. <entry>0</entry>
  109. <entry>Block A.</entry>
  110. </row>
  111. <row>
  112. <entry>V4L2_RDS_BLOCK_B</entry>
  113. <entry>1</entry>
  114. <entry>Block B.</entry>
  115. </row>
  116. <row>
  117. <entry>V4L2_RDS_BLOCK_C</entry>
  118. <entry>2</entry>
  119. <entry>Block C.</entry>
  120. </row>
  121. <row>
  122. <entry>V4L2_RDS_BLOCK_D</entry>
  123. <entry>3</entry>
  124. <entry>Block D.</entry>
  125. </row>
  126. <row>
  127. <entry>V4L2_RDS_BLOCK_C_ALT</entry>
  128. <entry>4</entry>
  129. <entry>Block C'.</entry>
  130. </row>
  131. <row>
  132. <entry>V4L2_RDS_BLOCK_INVALID</entry>
  133. <entry>7</entry>
  134. <entry>An invalid block.</entry>
  135. </row>
  136. <row>
  137. <entry>V4L2_RDS_BLOCK_CORRECTED</entry>
  138. <entry>0x40</entry>
  139. <entry>A bit error was detected but corrected.</entry>
  140. </row>
  141. <row>
  142. <entry>V4L2_RDS_BLOCK_ERROR</entry>
  143. <entry>0x80</entry>
  144. <entry>An incorrectable error occurred.</entry>
  145. </row>
  146. </tbody>
  147. </tgroup>
  148. </table>
  149. </section>
  150. <!--
  151. Local Variables:
  152. mode: sgml
  153. sgml-parent-document: "v4l2.sgml"
  154. indent-tabs-mode: nil
  155. End:
  156. -->