← Documents Documentation/userspace-api/media/dvb/dvbproperty.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / DVB / Frontend

Property types

DVBv5/S2API의 cmd/data property 집합과 DVB-C 설정 예제를 설명합니다.

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

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

1. 요약·해설

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

요약·해설

dvbproperty.rst:1-126

Property API는 기존 고정 union의 ABI 한계를 해결하고 한 ioctl에서 최대 64개 cmd/data 쌍을 처리합니다. 원문의 DVB-C 주파수 표기와 예제 배열 개수 불일치는 코드를 바꾸지 않고 검수 주의점으로 표시했습니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3 .. _frontend-properties:
4
5 **************
6 Property types
7 **************
8
9 Tuning into a Digital TV physical channel and starting decoding it
10 requires changing a set of parameters, in order to control the tuner,
11 the demodulator, the Linear Low-noise Amplifier (LNA) and to set the
12 antenna subsystem via Satellite Equipment Control - SEC (on satellite
13 systems). The actual parameters are specific to each particular digital
14 TV standards, and may change as the digital TV specs evolves.
15
16 In the past (up to DVB API version 3 - DVBv3), the strategy used was to have a
17 union with the parameters needed to tune for DVB-S, DVB-C, DVB-T and
18 ATSC delivery systems grouped there. The problem is that, as the second
19 generation standards appeared, the size of such union was not big
20 enough to group the structs that would be required for those new
21 standards. Also, extending it would break userspace.
22
23 So, the legacy union/struct based approach was deprecated, in favor
24 of a properties set approach. On such approach,
25 :ref:`FE_GET_PROPERTY and FE_SET_PROPERTY <FE_GET_PROPERTY>` are used
26 to setup the frontend and read its status.
27
28 The actual action is determined by a set of dtv_property cmd/data pairs.
29 With one single ioctl, is possible to get/set up to 64 properties.
30
31 This section describes the new and recommended way to set the frontend,
32 with supports all digital TV delivery systems.
33
34 .. note::
35
36 1. On Linux DVB API version 3, setting a frontend was done via
37 struct :c:type:`dvb_frontend_parameters`.
38
39 2. Don't use DVB API version 3 calls on hardware with supports
40 newer standards. Such API provides no support or a very limited
41 support to new standards and/or new hardware.
42
43 3. Nowadays, most frontends support multiple delivery systems.
44 Only with DVB API version 5 calls it is possible to switch between
45 the multiple delivery systems supported by a frontend.
46
47 4. DVB API version 5 is also called *S2API*, as the first
48 new standard added to it was DVB-S2.
49
50 **Example**: in order to set the hardware to tune into a DVB-C channel
51 at 651 kHz, modulated with 256-QAM, FEC 3/4 and symbol rate of 5.217
52 Mbauds, those properties should be sent to
53 :ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` ioctl:
54
55 :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` = SYS_DVBC_ANNEX_A
56
57 :ref:`DTV_FREQUENCY <DTV-FREQUENCY>` = 651000000
58
59 :ref:`DTV_MODULATION <DTV-MODULATION>` = QAM_256
60
61 :ref:`DTV_INVERSION <DTV-INVERSION>` = INVERSION_AUTO
62
63 :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>` = 5217000
64
65 :ref:`DTV_INNER_FEC <DTV-INNER-FEC>` = FEC_3_4
66
67 :ref:`DTV_TUNE <DTV-TUNE>`
68
69 The code that would that would do the above is show in
70 :ref:`dtv-prop-example`.
71
72 .. code-block:: c
73 :caption: Example: Setting digital TV frontend properties
74 :name: dtv-prop-example
75
76 #include <stdio.h>
77 #include <fcntl.h>
78 #include <sys/ioctl.h>
79 #include <linux/dvb/frontend.h>
80
81 static struct dtv_property props[] = {
82 { .cmd = DTV_DELIVERY_SYSTEM, .u.data = SYS_DVBC_ANNEX_A },
83 { .cmd = DTV_FREQUENCY, .u.data = 651000000 },
84 { .cmd = DTV_MODULATION, .u.data = QAM_256 },
85 { .cmd = DTV_INVERSION, .u.data = INVERSION_AUTO },
86 { .cmd = DTV_SYMBOL_RATE, .u.data = 5217000 },
87 { .cmd = DTV_INNER_FEC, .u.data = FEC_3_4 },
88 { .cmd = DTV_TUNE }
89 };
90
91 static struct dtv_properties dtv_prop = {
92 .num = 6, .props = props
93 };
94
95 int main(void)
96 {
97 int fd = open("/dev/dvb/adapter0/frontend0", O_RDWR);
98
99 if (!fd) {
100 perror ("open");
101 return -1;
102 }
103 if (ioctl(fd, FE_SET_PROPERTY, &dtv_prop) == -1) {
104 perror("ioctl");
105 return -1;
106 }
107 printf("Frontend set\\n");
108 return 0;
109 }
110
111 .. attention:: While it is possible to directly call the Kernel code like the
112 above example, it is strongly recommended to use
113 `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__, as it
114 provides abstraction to work with the supported digital TV standards and
115 provides methods for usual operations like program scanning and to
116 read/write channel descriptor files.
117
118 .. toctree::
119 :maxdepth: 1
120
121 fe_property_parameters
122 frontend-stat-properties
123 frontend-property-terrestrial-systems
124 frontend-property-cable-systems
125 frontend-property-satellite-systems
126 frontend-header
127

3. 한국어 전문 번역

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

튜닝 property가 제어하는 하드웨어

1-14

이 문서는 GFDL-1.1-no-invariants-or-later 라이선스를 따르며 `frontend-properties` 참조 대상으로 frontend property 형식을 설명합니다.

Digital TV 물리 채널에 맞춰 튜닝하고 디코딩을 시작하려면 tuner, demodulator, Linear Low-noise Amplifier(LNA)를 제어하는 여러 매개변수를 바꿔야 합니다.

위성 시스템에서는 Satellite Equipment Control(SEC)을 통해 안테나 하위 시스템도 설정합니다.

실제 매개변수는 각 Digital TV 표준에 따라 다르며 표준 사양이 발전함에 따라 바뀔 수 있습니다.

Frontend property 제어 대상
항목설명
Tuner물리 채널 주파수 선택
Demodulator전송 방식에 맞춘 복조
LNA저잡음 증폭 경로 제어
SEC위성 안테나 하위 시스템 제어

한 번의 튜닝 요청에 관여하는 하드웨어 블록입니다.

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

.. _frontend-properties:

**************
Property types
**************

Tuning into a Digital TV physical channel and starting decoding it
requires changing a set of parameters, in order to control the tuner,
the demodulator, the Linear Low-noise Amplifier (LNA) and to set the
antenna subsystem via Satellite Equipment Control - SEC (on satellite
systems). The actual parameters are specific to each particular digital
TV standards, and may change as the digital TV specs evolves.

DVBv3 union에서 property 집합으로

15-32

과거 DVB API version 3(DVBv3)까지는 DVB-S, DVB-C, DVB-T, ATSC delivery system의 튜닝 매개변수를 하나의 union에 묶었습니다.

2세대 표준이 등장하자 새 구조체를 모두 넣기에 union 크기가 부족했고, 크기를 확장하면 기존 사용자 공간 ABI가 깨지는 문제가 생겼습니다.

따라서 legacy union/struct 방식은 폐기 예정이 되었고 property set 방식으로 대체되었습니다. `FE_GET_PROPERTY`와 `FE_SET_PROPERTY`로 frontend를 구성하고 상태를 읽습니다.

실제 동작은 `dtv_property`의 cmd/data 쌍 집합으로 정합니다. 한 번의 ioctl로 최대 64개 property를 가져오거나 설정할 수 있습니다.

이 절은 모든 Digital TV delivery system을 지원하는 새롭고 권장되는 frontend 설정 방식을 설명합니다.

DVB frontend 설정 모델의 전환
DVBv3 union에 시스템별 구조체 집약2세대 표준 추가로 공간 부족union 확대 시 기존 사용자 공간 ABI 손상dtv_property cmd/data 목록으로 전환FE_GET_PROPERTY/FE_SET_PROPERTY 한 번에 최대 64개 처리

고정 union 대신 확장 가능한 property 목록을 사용합니다.


In the past (up to DVB API version 3 - DVBv3), the strategy used was to have a
union with the parameters needed to tune for DVB-S, DVB-C, DVB-T and
ATSC delivery systems grouped there. The problem is that, as the second
generation standards appeared, the size of such union was not big
enough to group the structs that would be required for those new
standards. Also, extending it would break userspace.

So, the legacy union/struct based approach was deprecated, in favor
of a properties set approach. On such approach,
:ref:`FE_GET_PROPERTY and FE_SET_PROPERTY <FE_GET_PROPERTY>` are used
to setup the frontend and read its status.

The actual action is determined by a set of dtv_property cmd/data pairs.
With one single ioctl, is possible to get/set up to 64 properties.

This section describes the new and recommended way to set the frontend,
with supports all digital TV delivery systems.

DVB API version 3과 5 선택

33-49

Linux DVB API version 3에서는 `struct dvb_frontend_parameters`로 frontend를 설정했습니다.

새 표준을 지원하는 하드웨어에서는 version 3 호출을 사용하지 않아야 합니다. 새 표준과 새 하드웨어를 지원하지 못하거나 지원 범위가 매우 제한적입니다.

오늘날 대부분의 frontend는 여러 delivery system을 지원하며, frontend가 제공하는 시스템 사이를 전환하려면 DVB API version 5 호출이 필요합니다.

DVB API version 5는 처음 추가된 새 표준이 DVB-S2였기 때문에 `S2API`라고도 합니다.

Frontend API 세대
항목설명
DVB API v3dvb_frontend_parameters 기반, 새 표준 지원이 없거나 제한적
DVB API v5 / S2APIproperty 기반, 여러 delivery system 전환과 확장 지원

레거시 구조체 API와 property API의 적용 범위입니다.


.. note::

   1. On Linux DVB API version 3, setting a frontend was done via
      struct :c:type:`dvb_frontend_parameters`.

   2. Don't use DVB API version 3 calls on hardware with supports
      newer standards. Such API provides no support or a very limited
      support to new standards and/or new hardware.

   3. Nowadays, most frontends support multiple delivery systems.
      Only with DVB API version 5 calls it is possible to switch between
      the multiple delivery systems supported by a frontend.

   4. DVB API version 5 is also called *S2API*, as the first
      new standard added to it was DVB-S2.

DVB-C 튜닝 property 예

50-70

예제는 256-QAM, FEC 3/4, symbol rate 5.217 Mbaud인 DVB-C 채널에 맞춰 하드웨어를 튜닝하는 property 목록을 제시합니다.

원문 본문은 채널을 651 kHz라고 적지만 `DTV_FREQUENCY` 값은 `651000000`입니다. 두 값을 자동으로 고치거나 통일하지 않고 원문상 불일치로 표시합니다.

설정은 delivery system, frequency, modulation, inversion, symbol rate, inner FEC를 지정한 뒤 `DTV_TUNE`으로 끝납니다.

DVB-C property 예제
property값 또는 의미
DTV_DELIVERY_SYSTEMSYS_DVBC_ANNEX_A
DTV_FREQUENCY651000000
DTV_MODULATIONQAM_256
DTV_INVERSIONINVERSION_AUTO
DTV_SYMBOL_RATE5217000
DTV_INNER_FECFEC_3_4
DTV_TUNE튜닝 실행 명령

FE_SET_PROPERTY로 전달하는 cmd/data 값을 원문 순서대로 정리합니다.

이어지는 `dtv-prop-example` 코드가 위 동작을 구현합니다.

**Example**: in order to set the hardware to tune into a DVB-C channel
at 651 kHz, modulated with 256-QAM, FEC 3/4 and symbol rate of 5.217
Mbauds, those properties should be sent to
:ref:`FE_SET_PROPERTY <FE_GET_PROPERTY>` ioctl:

  :ref:`DTV_DELIVERY_SYSTEM <DTV-DELIVERY-SYSTEM>` = SYS_DVBC_ANNEX_A

  :ref:`DTV_FREQUENCY <DTV-FREQUENCY>` = 651000000

  :ref:`DTV_MODULATION <DTV-MODULATION>` = QAM_256

  :ref:`DTV_INVERSION <DTV-INVERSION>` = INVERSION_AUTO

  :ref:`DTV_SYMBOL_RATE <DTV-SYMBOL-RATE>` = 5217000

  :ref:`DTV_INNER_FEC <DTV-INNER-FEC>` = FEC_3_4

  :ref:`DTV_TUNE <DTV-TUNE>`

The code that would that would do the above is show in
:ref:`dtv-prop-example`.

C 코드의 설정과 호출

71-110

예제 코드는 `stdio.h`, `fcntl.h`, `sys/ioctl.h`, `linux/dvb/frontend.h`를 포함합니다.

정적 `props` 배열에는 여섯 개의 값 property와 마지막 `DTV_TUNE` 항목이 들어 있습니다.

`struct dtv_properties dtv_prop`은 원문 코드에서 `.num = 6`과 `.props = props`로 초기화합니다. 배열에는 `DTV_TUNE`까지 7개 항목이 보이지만 원문 코드는 수정하지 않고 검수 주의점으로 남깁니다.

`main()`은 `/dev/dvb/adapter0/frontend0`을 `O_RDWR`로 열고 실패 시 `perror("open")` 뒤 -1을 반환합니다. 원문의 `if (!fd)` 조건도 그대로 보존합니다.

그 다음 `ioctl(fd, FE_SET_PROPERTY, &dtv_prop)`을 호출하고 실패 시 오류를 출력하며, 성공하면 `Frontend set`을 출력하고 0을 반환합니다.

Property 예제 코드
dtv_property props 배열 준비dtv_properties에 num과 props 연결frontend0을 O_RDWR로 openFE_SET_PROPERTY ioctl 호출성공 메시지 출력

원문 코드가 frontend를 설정하는 순서입니다.


.. code-block:: c
    :caption: Example: Setting digital TV frontend properties
    :name: dtv-prop-example

    #include <stdio.h>
    #include <fcntl.h>
    #include <sys/ioctl.h>
    #include <linux/dvb/frontend.h>

    static struct dtv_property props[] = {
	{ .cmd = DTV_DELIVERY_SYSTEM, .u.data = SYS_DVBC_ANNEX_A },
	{ .cmd = DTV_FREQUENCY,       .u.data = 651000000 },
	{ .cmd = DTV_MODULATION,      .u.data = QAM_256 },
	{ .cmd = DTV_INVERSION,       .u.data = INVERSION_AUTO },
	{ .cmd = DTV_SYMBOL_RATE,     .u.data = 5217000 },
	{ .cmd = DTV_INNER_FEC,       .u.data = FEC_3_4 },
	{ .cmd = DTV_TUNE }
    };

    static struct dtv_properties dtv_prop = {
	.num = 6, .props = props
    };

    int main(void)
    {
	int fd = open("/dev/dvb/adapter0/frontend0", O_RDWR);

	if (!fd) {
	    perror ("open");
	    return -1;
	}
	if (ioctl(fd, FE_SET_PROPERTY, &dtv_prop) == -1) {
	    perror("ioctl");
	    return -1;
	}
	printf("Frontend set\\n");
	return 0;
    }

libdvbv5 권장과 하위 문서

111-126

예제처럼 커널 API를 직접 호출할 수 있지만 문서는 `libdvbv5` 사용을 강하게 권장합니다.

libdvbv5는 지원되는 Digital TV 표준을 다루는 추상화, 프로그램 검색, 채널 descriptor 파일 읽기·쓰기 같은 일반 작업 방법을 제공합니다.

하위 목차는 property 매개변수, frontend 통계 지표, 지상파·케이블·위성 property, frontend 헤더 문서로 이어지며 최대 깊이는 1입니다.

Frontend property 하위 문서
항목설명
fe_property_parametersFrontend property 매개변수
frontend-stat-propertiesFrontend 통계 property
frontend-property-terrestrial-systems지상파 시스템 property
frontend-property-cable-systems케이블 시스템 property
frontend-property-satellite-systems위성 시스템 property
frontend-headerFrontend UAPI 헤더

toctree에 선언된 여섯 문서입니다.

.. attention:: While it is possible to directly call the Kernel code like the
   above example, it is strongly recommended to use
   `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__, as it
   provides abstraction to work with the supported digital TV standards and
   provides methods for usual operations like program scanning and to
   read/write channel descriptor files.

.. toctree::
    :maxdepth: 1

    fe_property_parameters
    frontend-stat-properties
    frontend-property-terrestrial-systems
    frontend-property-cable-systems
    frontend-property-satellite-systems
    frontend-header