← Documents Documentation/userspace-api/media/v4l/dev-rds.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

RDS 인터페이스

RDS/RBDS capability와 3-byte block I/O, block ID 및 오류 flag를 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/dev-rds.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

dev-rds.rst:1-176

RDS는 radio subcarrier의 보조 정보를 3-byte block record로 전달합니다. 장치 역할과 block pass-through 여부를 capability로 확인하고 세 번째 byte에서 block ID와 수정·오류 상태를 해석합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _rds:
5
6 *************
7 RDS Interface
8 *************
9
10 The Radio Data System transmits supplementary information in binary
11 format, for example the station name or travel information, on an
12 inaudible audio subcarrier of a radio program. This interface is aimed
13 at devices capable of receiving and/or transmitting RDS information.
14
15 For more information see the core RDS standard :ref:`iec62106` and the
16 RBDS standard :ref:`nrsc4`.
17
18 .. note::
19
20 Note that the RBDS standard as is used in the USA is almost
21 identical to the RDS standard. Any RDS decoder/encoder can also handle
22 RBDS. Only some of the fields have slightly different meanings. See the
23 RBDS standard for more information.
24
25 The RBDS standard also specifies support for MMBS (Modified Mobile
26 Search). This is a proprietary format which seems to be discontinued.
27 The RDS interface does not support this format. Should support for MMBS
28 (or the so-called 'E blocks' in general) be needed, then please contact
29 the linux-media mailing list:
30 `https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.
31
32 Querying Capabilities
33 =====================
34
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>`__.
49
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.
53
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>`.
70
71 .. _reading-rds-data:
72
73 Reading RDS data
74 ================
75
76 RDS data can be read from the radio device with the
77 :c:func:`read()` function. The data is packed in groups of
78 three bytes.
79
80 .. _writing-rds-data:
81
82 Writing RDS data
83 ================
84
85 RDS data can be written to the radio device with the
86 :c:func:`write()` function. The data is packed in groups of
87 three bytes, as follows:
88
89 RDS datastructures
90 ==================
91
92 .. c:type:: v4l2_rds_data
93
94 .. flat-table:: struct v4l2_rds_data
95 :header-rows: 0
96 :stub-columns: 0
97 :widths: 1 1 5
98
99 * - __u8
100 - ``lsb``
101 - Least Significant Byte of RDS Block
102 * - __u8
103 - ``msb``
104 - Most Significant Byte of RDS Block
105 * - __u8
106 - ``block``
107 - Block description
108
109
110 .. _v4l2-rds-block:
111
112 .. tabularcolumns:: |p{2.9cm}|p{14.6cm}|
113
114 .. flat-table:: Block description
115 :header-rows: 0
116 :stub-columns: 0
117 :widths: 1 5
118
119 * - Bits 0-2
120 - Block (aka offset) of the received data.
121 * - Bits 3-5
122 - Deprecated. Currently identical to bits 0-2. Do not use these
123 bits.
124 * - Bit 6
125 - Corrected bit. Indicates that an error was corrected for this data
126 block.
127 * - Bit 7
128 - Error bit. Indicates that an uncorrectable error occurred during
129 reception of this block.
130
131
132 .. _v4l2-rds-block-codes:
133
134 .. tabularcolumns:: |p{6.4cm}|p{2.0cm}|p{1.2cm}|p{7.0cm}|
135
136 .. flat-table:: Block defines
137 :header-rows: 0
138 :stub-columns: 0
139 :widths: 1 1 1 5
140
141 * - V4L2_RDS_BLOCK_MSK
142 -
143 - 7
144 - Mask for bits 0-2 to get the block ID.
145 * - V4L2_RDS_BLOCK_A
146 -
147 - 0
148 - Block A.
149 * - V4L2_RDS_BLOCK_B
150 -
151 - 1
152 - Block B.
153 * - V4L2_RDS_BLOCK_C
154 -
155 - 2
156 - Block C.
157 * - V4L2_RDS_BLOCK_D
158 -
159 - 3
160 - Block D.
161 * - V4L2_RDS_BLOCK_C_ALT
162 -
163 - 4
164 - Block C'.
165 * - V4L2_RDS_BLOCK_INVALID
166 - read-only
167 - 7
168 - An invalid block.
169 * - V4L2_RDS_BLOCK_CORRECTED
170 - read-only
171 - 0x40
172 - A bit error was detected but corrected.
173 * - V4L2_RDS_BLOCK_ERROR
174 - read-only
175 - 0x80
176 - An uncorrectable error occurred.
177

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

RDS/RBDS와 지원 범위

1-31

Radio Data System은 방송 프로그램의 들리지 않는 audio subcarrier에 방송국 이름이나 교통 정보 같은 보조 정보를 binary 형식으로 전송합니다. 이 인터페이스는 RDS 정보를 수신하거나 송신할 수 있는 장치를 대상으로 합니다.

핵심 규격은 IEC 62106 RDS와 NRSC-4 RBDS입니다. 미국에서 쓰는 RBDS는 RDS와 거의 같아서 같은 decoder/encoder로 처리할 수 있으며 일부 field 의미만 조금 다릅니다.

RBDS가 정의한 MMBS(Modified Mobile Search)는 중단된 것으로 보이는 proprietary format이고 V4L2 RDS 인터페이스는 지원하지 않습니다. MMBS 또는 일반적인 E block 지원이 필요하면 linux-media mailing list에서 API 확장을 논의해야 합니다.

RDS 규격 범위
항목설명
RDSIEC 62106 기반 Radio Data System
RBDSNRSC-4 기반, 미국에서 사용하며 RDS와 거의 동일
MMBSProprietary하고 중단된 것으로 보이며 현재 미지원
E blocks필요하면 linux-media mailing list에서 확장 논의

호환되는 표준과 제외된 확장을 구분합니다.

.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
.. c:namespace:: V4L

.. _rds:

*************
RDS Interface
*************

The Radio Data System transmits supplementary information in binary
format, for example the station name or travel information, on an
inaudible audio subcarrier of a radio program. This interface is aimed
at devices capable of receiving and/or transmitting RDS information.

For more information see the core RDS standard :ref:`iec62106` and the
RBDS standard :ref:`nrsc4`.

.. note::

   Note that the RBDS standard as is used in the USA is almost
   identical to the RDS standard. Any RDS decoder/encoder can also handle
   RBDS. Only some of the fields have slightly different meanings. See the
   RBDS standard for more information.

The RBDS standard also specifies support for MMBS (Modified Mobile
Search). This is a proprietary format which seems to be discontinued.
The RDS interface does not support this format. Should support for MMBS
(or the so-called 'E blocks' in general) be needed, then please contact
the linux-media mailing list:
`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.

Capture/output capability와 signal 상태

32-70

RDS capture 장치는 `VIDIOC_QUERYCAP`의 `capabilities`에 `V4L2_CAP_RDS_CAPTURE`를 설정하고, RDS를 지원하는 tuner는 `struct v4l2_tuner.capability`에 `V4L2_TUNER_CAP_RDS`를 설정합니다.

드라이버가 RDS block을 해석하지 않고 그대로 전달하면 `V4L2_TUNER_CAP_RDS_BLOCK_IO`가 필요합니다. `V4L2_TUNER_CAP_RDS_CONTROLS`도 향후 용도로 정의되어 있지만 해당 capture tuner driver는 아직 없으므로 새 구현은 linux-media mailing list에서 설계를 논의해야 합니다.

RDS signal 검출 여부는 `struct v4l2_tuner.rxsubchans`에서 확인합니다. Data가 감지되면 `V4L2_TUNER_SUB_RDS` bit가 설정됩니다.

RDS output 장치는 `V4L2_CAP_RDS_OUTPUT`, modulator는 `V4L2_TUNER_CAP_RDS`를 설정합니다. 송신을 켜려면 `struct v4l2_modulator.txsubchans`에 `V4L2_TUNER_SUB_RDS`를 설정합니다. Block을 그대로 받는 장치는 `V4L2_TUNER_CAP_RDS_BLOCK_IO`, program identification code나 radio text 같은 entity를 자체 처리하면 `V4L2_TUNER_CAP_RDS_CONTROLS`를 설정합니다.

RDS capture와 output
항목설명
Capture deviceV4L2_CAP_RDS_CAPTURE
Output deviceV4L2_CAP_RDS_OUTPUT
RDS tuner/modulatorV4L2_TUNER_CAP_RDS
Raw block pass-throughV4L2_TUNER_CAP_RDS_BLOCK_IO
Entity controlV4L2_TUNER_CAP_RDS_CONTROLS
수신 감지rxsubchans의 V4L2_TUNER_SUB_RDS
송신 활성화txsubchans의 V4L2_TUNER_SUB_RDS

장치와 tuner/modulator flag의 조합입니다.

RDS signal 제어
VIDIOC_QUERYCAP로 RDS capture/output 확인Tuner 또는 modulator의 RDS capability 확인Capture: rxsubchans에서 RDS 감지 확인Output: txsubchans에 V4L2_TUNER_SUB_RDS 설정BLOCK_IO 또는 CONTROLS 처리 모델 선택

Capture 감지와 output 활성화 경로를 구분합니다.

Querying Capabilities
=====================

Devices supporting the RDS capturing API set the
``V4L2_CAP_RDS_CAPTURE`` flag in the ``capabilities`` field of struct
:c:type:`v4l2_capability` returned by the
:ref:`VIDIOC_QUERYCAP` ioctl. Any tuner that
supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
``capability`` field of struct :c:type:`v4l2_tuner`. If the
driver only passes RDS blocks without interpreting the data the
``V4L2_TUNER_CAP_RDS_BLOCK_IO`` flag has to be set, see
:ref:`Reading RDS data <reading-rds-data>`. For future use the flag
``V4L2_TUNER_CAP_RDS_CONTROLS`` has also been defined. However, a driver
for a radio tuner with this capability does not yet exist, so if you are
planning to write such a driver you should discuss this on the
linux-media mailing list:
`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__.

Whether an RDS signal is present can be detected by looking at the
``rxsubchans`` field of struct :c:type:`v4l2_tuner`: the
``V4L2_TUNER_SUB_RDS`` will be set if RDS data was detected.

Devices supporting the RDS output API set the ``V4L2_CAP_RDS_OUTPUT``
flag in the ``capabilities`` field of struct
:c:type:`v4l2_capability` returned by the
:ref:`VIDIOC_QUERYCAP` ioctl. Any modulator that
supports RDS will set the ``V4L2_TUNER_CAP_RDS`` flag in the
``capability`` field of struct
:c:type:`v4l2_modulator`. In order to enable the RDS
transmission one must set the ``V4L2_TUNER_SUB_RDS`` bit in the
``txsubchans`` field of struct
:c:type:`v4l2_modulator`. If the driver only passes RDS
blocks without interpreting the data the ``V4L2_TUNER_CAP_RDS_BLOCK_IO``
flag has to be set. If the tuner is capable of handling RDS entities
like program identification codes and radio text, the flag
``V4L2_TUNER_CAP_RDS_CONTROLS`` should be set, see
:ref:`Writing RDS data <writing-rds-data>` and
:ref:`FM Transmitter Control Reference <fm-tx-controls>`.

3-byte RDS block 읽기와 쓰기

71-109

RDS data는 radio 장치에서 `read()`로 읽고 `write()`로 씁니다. 양쪽 모두 한 block을 세 byte 묶음으로 전달합니다.

`struct v4l2_rds_data`의 첫 byte `lsb`는 RDS block의 least significant byte, 두 번째 `msb`는 most significant byte, 세 번째 `block`은 block ID와 수신 오류 상태를 담는 설명 byte입니다.

struct v4l2_rds_data
항목설명
Byte 0: lsbRDS block의 Least Significant Byte
Byte 1: msbRDS block의 Most Significant Byte
Byte 2: blockBlock ID, corrected flag, error flag

한 RDS block을 이루는 고정 3-byte 구조입니다.

RDS block I/O
read() 또는 write() buffer 준비3-byte 단위 길이 확인lsb와 msb로 16-bit RDS payload 구성block byte에서 ID와 오류 flag 해석수정 불가 오류 block은 상위 계층 정책으로 처리

항상 3-byte record 경계를 유지합니다.

.. _reading-rds-data:

Reading RDS data
================

RDS data can be read from the radio device with the
:c:func:`read()` function. The data is packed in groups of
three bytes.

.. _writing-rds-data:

Writing RDS data
================

RDS data can be written to the radio device with the
:c:func:`write()` function. The data is packed in groups of
three bytes, as follows:

RDS datastructures
==================

.. c:type:: v4l2_rds_data

.. flat-table:: struct v4l2_rds_data
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 5

    * - __u8
      - ``lsb``
      - Least Significant Byte of RDS Block
    * - __u8
      - ``msb``
      - Most Significant Byte of RDS Block
    * - __u8
      - ``block``
      - Block description

RDS block bit와 상수

110-176

`block` byte의 bits 0-2는 수신 data의 block 또는 offset ID입니다. Bits 3-5는 deprecated이며 현재 bits 0-2와 같지만 사용해서는 안 됩니다. Bit 6은 오류가 수정되었음을, bit 7은 수신 중 수정할 수 없는 오류가 발생했음을 나타냅니다.

`V4L2_RDS_BLOCK_MSK` 값 7로 bits 0-2를 추출합니다. A, B, C, D block은 각각 0, 1, 2, 3이고 C'는 `V4L2_RDS_BLOCK_C_ALT` 값 4입니다.

`V4L2_RDS_BLOCK_INVALID`는 read-only 값 7인 잘못된 block입니다. `V4L2_RDS_BLOCK_CORRECTED`는 read-only `0x40`, `V4L2_RDS_BLOCK_ERROR`는 read-only `0x80`으로 각각 수정된 bit 오류와 수정 불가능한 오류를 나타냅니다.

RDS block description bits
항목설명
Bits 0-2Block ID, V4L2_RDS_BLOCK_MSK로 추출
Bits 3-5Deprecated, 사용 금지
Bit 6Corrected error, 0x40
Bit 7Uncorrectable error, 0x80

세 번째 byte의 bit 배치입니다.

RDS block ID 상수
항목설명
V4L2_RDS_BLOCK_A0
V4L2_RDS_BLOCK_B1
V4L2_RDS_BLOCK_C2
V4L2_RDS_BLOCK_D3
V4L2_RDS_BLOCK_C_ALT4, Block C'
V4L2_RDS_BLOCK_INVALID7, read-only
V4L2_RDS_BLOCK_CORRECTED0x40, read-only
V4L2_RDS_BLOCK_ERROR0x80, read-only

Block offset과 숫자 값을 대응시킵니다.

.. _v4l2-rds-block:

.. tabularcolumns:: |p{2.9cm}|p{14.6cm}|

.. flat-table:: Block description
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 5

    * - Bits 0-2
      - Block (aka offset) of the received data.
    * - Bits 3-5
      - Deprecated. Currently identical to bits 0-2. Do not use these
	bits.
    * - Bit 6
      - Corrected bit. Indicates that an error was corrected for this data
	block.
    * - Bit 7
      - Error bit. Indicates that an uncorrectable error occurred during
	reception of this block.


.. _v4l2-rds-block-codes:

.. tabularcolumns:: |p{6.4cm}|p{2.0cm}|p{1.2cm}|p{7.0cm}|

.. flat-table:: Block defines
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 1 5

    * - V4L2_RDS_BLOCK_MSK
      -
      - 7
      - Mask for bits 0-2 to get the block ID.
    * - V4L2_RDS_BLOCK_A
      -
      - 0
      - Block A.
    * - V4L2_RDS_BLOCK_B
      -
      - 1
      - Block B.
    * - V4L2_RDS_BLOCK_C
      -
      - 2
      - Block C.
    * - V4L2_RDS_BLOCK_D
      -
      - 3
      - Block D.
    * - V4L2_RDS_BLOCK_C_ALT
      -
      - 4
      - Block C'.
    * - V4L2_RDS_BLOCK_INVALID
      - read-only
      - 7
      - An invalid block.
    * - V4L2_RDS_BLOCK_CORRECTED
      - read-only
      - 0x40
      - A bit error was detected but corrected.
    * - V4L2_RDS_BLOCK_ERROR
      - read-only
      - 0x80
      - An uncorrectable error occurred.