Path: blob/master/Documentation/DocBook/v4l/dev-rds.xml
10821 views
<title>RDS Interface</title>12<para>The Radio Data System transmits supplementary3information in binary format, for example the station name or travel4information, on an inaudible audio subcarrier of a radio program. This5interface is aimed at devices capable of receiving and/or transmitting RDS6information.</para>78<para>For more information see the core RDS standard <xref linkend="en50067" />9and the RBDS standard <xref linkend="nrsc4" />.</para>1011<para>Note that the RBDS standard as is used in the USA is almost identical12to the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only some of the13fields have slightly different meanings. See the RBDS standard for more14information.</para>1516<para>The RBDS standard also specifies support for MMBS (Modified Mobile Search).17This is a proprietary format which seems to be discontinued. The RDS interface does not18support this format. Should support for MMBS (or the so-called 'E blocks' in general)19be needed, then please contact the linux-media mailing list: &v4l-ml;.</para>2021<section>22<title>Querying Capabilities</title>2324<para>Devices supporting the RDS capturing API set25the <constant>V4L2_CAP_RDS_CAPTURE</constant> flag in26the <structfield>capabilities</structfield> field of &v4l2-capability;27returned by the &VIDIOC-QUERYCAP; ioctl. Any tuner that supports RDS28will set the <constant>V4L2_TUNER_CAP_RDS</constant> flag in29the <structfield>capability</structfield> field of &v4l2-tuner;. If30the driver only passes RDS blocks without interpreting the data31the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be32set, see <link linkend="reading-rds-data">Reading RDS data</link>.33For future use the34flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> has also been35defined. However, a driver for a radio tuner with this capability does36not yet exist, so if you are planning to write such a driver you37should discuss this on the linux-media mailing list: &v4l-ml;.</para>3839<para> Whether an RDS signal is present can be detected by looking40at the <structfield>rxsubchans</structfield> field of &v4l2-tuner;:41the <constant>V4L2_TUNER_SUB_RDS</constant> will be set if RDS data42was detected.</para>4344<para>Devices supporting the RDS output API45set the <constant>V4L2_CAP_RDS_OUTPUT</constant> flag in46the <structfield>capabilities</structfield> field of &v4l2-capability;47returned by the &VIDIOC-QUERYCAP; ioctl.48Any modulator that supports RDS will set the49<constant>V4L2_TUNER_CAP_RDS</constant> flag in the <structfield>capability</structfield>50field of &v4l2-modulator;.51In order to enable the RDS transmission one must set the <constant>V4L2_TUNER_SUB_RDS</constant>52bit in the <structfield>txsubchans</structfield> field of &v4l2-modulator;.53If the driver only passes RDS blocks without interpreting the data54the <constant>V4L2_TUNER_SUB_RDS_BLOCK_IO</constant> flag has to be set. If the55tuner is capable of handling RDS entities like program identification codes and radio56text, the flag <constant>V4L2_TUNER_SUB_RDS_CONTROLS</constant> should be set,57see <link linkend="writing-rds-data">Writing RDS data</link> and58<link linkend="fm-tx-controls">FM Transmitter Control Reference</link>.</para>59</section>6061<section id="reading-rds-data">62<title>Reading RDS data</title>6364<para>RDS data can be read from the radio device65with the &func-read; function. The data is packed in groups of three bytes.</para>66</section>6768<section id="writing-rds-data">69<title>Writing RDS data</title>7071<para>RDS data can be written to the radio device72with the &func-write; function. The data is packed in groups of three bytes,73as follows:</para>74</section>7576<section>77<title>RDS datastructures</title>78<table frame="none" pgwide="1" id="v4l2-rds-data">79<title>struct80<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>129130<table frame="none" pgwide="1" id="v4l2-rds-block-codes">131<title>Block defines</title>132<tgroup cols="4">133<colspec colname="c1" colwidth="1*" />134<colspec colname="c2" colwidth="1*" />135<colspec colname="c3" colwidth="1*" />136<colspec colname="c4" colwidth="5*" />137<tbody valign="top">138<row>139<entry>V4L2_RDS_BLOCK_MSK</entry>140<entry> </entry>141<entry>7</entry>142<entry>Mask for bits 0-2 to get the block ID.</entry>143</row>144<row>145<entry>V4L2_RDS_BLOCK_A</entry>146<entry> </entry>147<entry>0</entry>148<entry>Block A.</entry>149</row>150<row>151<entry>V4L2_RDS_BLOCK_B</entry>152<entry> </entry>153<entry>1</entry>154<entry>Block B.</entry>155</row>156<row>157<entry>V4L2_RDS_BLOCK_C</entry>158<entry> </entry>159<entry>2</entry>160<entry>Block C.</entry>161</row>162<row>163<entry>V4L2_RDS_BLOCK_D</entry>164<entry> </entry>165<entry>3</entry>166<entry>Block D.</entry>167</row>168<row>169<entry>V4L2_RDS_BLOCK_C_ALT</entry>170<entry> </entry>171<entry>4</entry>172<entry>Block C'.</entry>173</row>174<row>175<entry>V4L2_RDS_BLOCK_INVALID</entry>176<entry>read-only</entry>177<entry>7</entry>178<entry>An invalid block.</entry>179</row>180<row>181<entry>V4L2_RDS_BLOCK_CORRECTED</entry>182<entry>read-only</entry>183<entry>0x40</entry>184<entry>A bit error was detected but corrected.</entry>185</row>186<row>187<entry>V4L2_RDS_BLOCK_ERROR</entry>188<entry>read-only</entry>189<entry>0x80</entry>190<entry>An uncorrectable error occurred.</entry>191</row>192</tbody>193</tgroup>194</table>195</section>196197<!--198Local Variables:199mode: sgml200sgml-parent-document: "v4l2.sgml"201indent-tabs-mode: nil202End:203-->204205206