요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. 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>`__.
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>`.
.. _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
.. _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.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
RDS/RBDS와 지원 범위
1-31Radio 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 확장을 논의해야 합니다.
호환되는 표준과 제외된 확장을 구분합니다.
.. 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-70RDS 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`를 설정합니다.
장치와 tuner/modulator flag의 조합입니다.
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-109RDS 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입니다.
한 RDS block을 이루는 고정 3-byte 구조입니다.
항상 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 오류와 수정 불가능한 오류를 나타냅니다.
세 번째 byte의 bit 배치입니다.
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.
요약·해설
dev-rds.rst:1-176RDS는 radio subcarrier의 보조 정보를 3-byte block record로 전달합니다. 장치 역할과 block pass-through 여부를 capability로 확인하고 세 번째 byte에서 block ID와 수정·오류 상태를 해석합니다.