← Documents Documentation/userspace-api/media/v4l/vidioc-enum-freq-bands.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_ENUM_FREQ_BANDS ioctl

V4L2 tuner·modulator의 주파수 band를 열거하고 대역별 capability, 주파수 단위, 변조 방식과 오류 조건을 설명합니다.

Source pathDocumentation/userspace-api/media/v4l/vidioc-enum-freq-bands.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

vidioc-enum-freq-bands.rst:1-139

V4L2 tuner·modulator의 주파수 band를 열거하고 대역별 capability, 주파수 단위, 변조 방식과 오류 조건을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_ENUM_FREQ_BANDS:
5
6 ****************************
7 ioctl VIDIOC_ENUM_FREQ_BANDS
8 ****************************
9
10 Name
11 ====
12
13 VIDIOC_ENUM_FREQ_BANDS - Enumerate supported frequency bands
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_ENUM_FREQ_BANDS
19
20 ``int ioctl(int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp)``
21
22 Arguments
23 =========
24
25 ``fd``
26 File descriptor returned by :c:func:`open()`.
27
28 ``argp``
29 Pointer to struct :c:type:`v4l2_frequency_band`.
30
31 Description
32 ===========
33
34 Enumerates the frequency bands that a tuner or modulator supports. To do
35 this applications initialize the ``tuner``, ``type`` and ``index``
36 fields, and zero out the ``reserved`` array of a struct
37 :c:type:`v4l2_frequency_band` and call the
38 :ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure.
39
40 This ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability
41 of the corresponding tuner/modulator is set.
42
43 .. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{2.4cm}|
44
45 .. c:type:: v4l2_frequency_band
46
47 .. flat-table:: struct v4l2_frequency_band
48 :header-rows: 0
49 :stub-columns: 0
50 :widths: 1 1 2 1 1
51
52 * - __u32
53 - ``tuner``
54 - The tuner or modulator index number. This is the same value as in
55 the struct :c:type:`v4l2_input` ``tuner`` field and
56 the struct :c:type:`v4l2_tuner` ``index`` field, or
57 the struct :c:type:`v4l2_output` ``modulator`` field
58 and the struct :c:type:`v4l2_modulator` ``index``
59 field.
60 * - __u32
61 - ``type``
62 - The tuner type. This is the same value as in the struct
63 :c:type:`v4l2_tuner` ``type`` field. The type must be
64 set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
65 to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
66 ``V4L2_TUNER_RADIO`` for modulators (currently only radio
67 modulators are supported). See :c:type:`v4l2_tuner_type`
68 * - __u32
69 - ``index``
70 - Identifies the frequency band, set by the application.
71 * - __u32
72 - ``capability``
73 - :cspan:`2` The tuner/modulator capability flags for this
74 frequency band, see :ref:`tuner-capability`. The
75 ``V4L2_TUNER_CAP_LOW`` or ``V4L2_TUNER_CAP_1HZ`` capability must
76 be the same for all frequency bands of the selected
77 tuner/modulator. So either all bands have that capability set, or
78 none of them have that capability.
79 * - __u32
80 - ``rangelow``
81 - :cspan:`2` The lowest tunable frequency in units of 62.5 kHz, or
82 if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
83 of 62.5 Hz, for this frequency band. A 1 Hz unit is used when the
84 ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
85 * - __u32
86 - ``rangehigh``
87 - :cspan:`2` The highest tunable frequency in units of 62.5 kHz,
88 or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
89 units of 62.5 Hz, for this frequency band. A 1 Hz unit is used
90 when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
91 * - __u32
92 - ``modulation``
93 - :cspan:`2` The supported modulation systems of this frequency
94 band. See :ref:`band-modulation`.
95
96 .. note::
97
98 Currently only one modulation system per frequency band
99 is supported. More work will need to be done if multiple
100 modulation systems are possible. Contact the linux-media
101 mailing list
102 (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
103 if you need such functionality.
104 * - __u32
105 - ``reserved``\ [9]
106 - Reserved for future extensions.
107
108 Applications and drivers must set the array to zero.
109
110
111 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
112
113 .. _band-modulation:
114
115 .. flat-table:: Band Modulation Systems
116 :header-rows: 0
117 :stub-columns: 0
118 :widths: 3 1 4
119
120 * - ``V4L2_BAND_MODULATION_VSB``
121 - 0x02
122 - Vestigial Sideband modulation, used for analog TV.
123 * - ``V4L2_BAND_MODULATION_FM``
124 - 0x04
125 - Frequency Modulation, commonly used for analog radio.
126 * - ``V4L2_BAND_MODULATION_AM``
127 - 0x08
128 - Amplitude Modulation, commonly used for analog radio.
129
130 Return Value
131 ============
132
133 On success 0 is returned, on error -1 and the ``errno`` variable is set
134 appropriately. The generic error codes are described at the
135 :ref:`Generic Error Codes <gen-errors>` chapter.
136
137 EINVAL
138 The ``tuner`` or ``index`` is out of bounds or the ``type`` field is
139 wrong.
140

3. 한국어 전문 번역

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

목적, 호출 형식과 인자

1-30

`VIDIOC_ENUM_FREQ_BANDS`는 tuner 또는 modulator가 지원하는 주파수 대역을 열거하는 ioctl입니다. 호출 형식은 `int ioctl(int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp)`입니다.

`fd`는 `open()`이 반환한 파일 디스크립터이고, `argp`는 조회할 tuner·유형·대역 순번과 반환 정보를 담는 `struct v4l2_frequency_band`를 가리킵니다.

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

.. _VIDIOC_ENUM_FREQ_BANDS:

****************************
ioctl VIDIOC_ENUM_FREQ_BANDS
****************************

Name
====

VIDIOC_ENUM_FREQ_BANDS - Enumerate supported frequency bands

Synopsis
========

.. c:macro:: VIDIOC_ENUM_FREQ_BANDS

``int ioctl(int fd, VIDIOC_ENUM_FREQ_BANDS, struct v4l2_frequency_band *argp)``

Arguments
=========

``fd``
    File descriptor returned by :c:func:`open()`.

``argp``
    Pointer to struct :c:type:`v4l2_frequency_band`.

지원 조건과 열거 절차

31-44

응용 프로그램은 `v4l2_frequency_band`의 `tuner`, `type`, `index`를 초기화하고 `reserved` 배열을 0으로 만든 뒤 ioctl을 호출합니다. 대응하는 tuner 또는 modulator에 `V4L2_TUNER_CAP_FREQ_BANDS` capability가 설정된 경우에만 이 ioctl이 지원됩니다.

주파수 대역 열거
tuner/modulator index 선택장치 노드에 맞는 type 설정index=0, reserved=0VIDIOC_ENUM_FREQ_BANDS 호출범위·capability·modulation 기록index 증가 후 EINVAL까지 반복

선택한 tuner 또는 modulator의 band를 순서대로 조사합니다.

Description
===========

Enumerates the frequency bands that a tuner or modulator supports. To do
this applications initialize the ``tuner``, ``type`` and ``index``
fields, and zero out the ``reserved`` array of a struct
:c:type:`v4l2_frequency_band` and call the
:ref:`VIDIOC_ENUM_FREQ_BANDS` ioctl with a pointer to this structure.

This ioctl is supported if the ``V4L2_TUNER_CAP_FREQ_BANDS`` capability
of the corresponding tuner/modulator is set.

.. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{2.4cm}|

v4l2_frequency_band 구조체

45-112
struct v4l2_frequency_band
형식필드의미
`__u32``tuner`tuner 또는 modulator 순번. `v4l2_input.tuner`·`v4l2_tuner.index` 또는 `v4l2_output.modulator`·`v4l2_modulator.index`와 같은 값
`__u32``type`tuner 유형. `/dev/radioX`와 modulator는 `V4L2_TUNER_RADIO`, 그 밖에는 `V4L2_TUNER_ANALOG_TV`
`__u32``index`응용 프로그램이 지정하는 주파수 band 순번
`__u32``capability`이 주파수 band의 tuner/modulator capability 플래그
`__u32``rangelow`이 band에서 조정 가능한 최저 주파수
`__u32``rangehigh`이 band에서 조정 가능한 최고 주파수
`__u32``modulation`이 주파수 band가 지원하는 변조 방식
`__u32[9]``reserved`미래 확장용이며 응용 프로그램과 드라이버 모두 0으로 설정

응용 프로그램 입력과 드라이버가 반환하는 대역 속성을 원문 순서대로 정리합니다.

`type`은 `v4l2_tuner.type`과 같은 값입니다. `/dev/radioX` 장치 노드는 `V4L2_TUNER_RADIO`, 그 밖의 노드는 `V4L2_TUNER_ANALOG_TV`를 사용합니다. 현재는 radio modulator만 지원하므로 modulator에도 `V4L2_TUNER_RADIO`를 설정합니다.

`capability`의 `V4L2_TUNER_CAP_LOW` 또는 `V4L2_TUNER_CAP_1HZ`는 선택한 tuner/modulator의 모든 주파수 band에서 같아야 합니다. 즉 모든 band에 해당 capability가 있거나 어느 band에도 없어야 합니다.

`rangelow`와 `rangehigh`의 기본 단위는 62.5 kHz입니다. `V4L2_TUNER_CAP_LOW`가 설정되면 62.5 Hz, `V4L2_TUNER_CAP_1HZ`가 설정되면 1 Hz 단위를 사용합니다.

현재는 주파수 band 하나당 변조 방식 하나만 지원합니다. 여러 변조 방식을 한 band에 표현해야 한다면 API 작업이 더 필요하며 원문이 안내한 linux-media 메일링 리스트에 논의해야 합니다.

.. c:type:: v4l2_frequency_band

.. flat-table:: struct v4l2_frequency_band
    :header-rows:  0
    :stub-columns: 0
    :widths:       1 1 2 1 1

    * - __u32
      - ``tuner``
      - The tuner or modulator index number. This is the same value as in
	the struct :c:type:`v4l2_input` ``tuner`` field and
	the struct :c:type:`v4l2_tuner` ``index`` field, or
	the struct :c:type:`v4l2_output` ``modulator`` field
	and the struct :c:type:`v4l2_modulator` ``index``
	field.
    * - __u32
      - ``type``
      - The tuner type. This is the same value as in the struct
	:c:type:`v4l2_tuner` ``type`` field. The type must be
	set to ``V4L2_TUNER_RADIO`` for ``/dev/radioX`` device nodes, and
	to ``V4L2_TUNER_ANALOG_TV`` for all others. Set this field to
	``V4L2_TUNER_RADIO`` for modulators (currently only radio
	modulators are supported). See :c:type:`v4l2_tuner_type`
    * - __u32
      - ``index``
      - Identifies the frequency band, set by the application.
    * - __u32
      - ``capability``
      - :cspan:`2` The tuner/modulator capability flags for this
	frequency band, see :ref:`tuner-capability`. The
	``V4L2_TUNER_CAP_LOW`` or ``V4L2_TUNER_CAP_1HZ`` capability must
	be the same for all frequency bands of the selected
	tuner/modulator. So either all bands have that capability set, or
	none of them have that capability.
    * - __u32
      - ``rangelow``
      - :cspan:`2` The lowest tunable frequency in units of 62.5 kHz, or
	if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
	of 62.5 Hz, for this frequency band. A 1 Hz unit is used when the
	``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
    * - __u32
      - ``rangehigh``
      - :cspan:`2` The highest tunable frequency in units of 62.5 kHz,
	or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
	units of 62.5 Hz, for this frequency band. A 1 Hz unit is used
	when the ``capability`` flag ``V4L2_TUNER_CAP_1HZ`` is set.
    * - __u32
      - ``modulation``
      - :cspan:`2` The supported modulation systems of this frequency
	band. See :ref:`band-modulation`.

	.. note::

	   Currently only one modulation system per frequency band
	   is supported. More work will need to be done if multiple
	   modulation systems are possible. Contact the linux-media
	   mailing list
	   (`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
	   if you need such functionality.
    * - __u32
      - ``reserved``\ [9]
      - Reserved for future extensions.

	Applications and drivers must set the array to zero.


.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|

Band 변조 방식

113-129
Band Modulation Systems
상수의미
`V4L2_BAND_MODULATION_VSB``0x02`아날로그 TV에 사용하는 Vestigial Sideband modulation
`V4L2_BAND_MODULATION_FM``0x04`아날로그 radio에 흔히 사용하는 Frequency Modulation
`V4L2_BAND_MODULATION_AM``0x08`아날로그 radio에 흔히 사용하는 Amplitude Modulation

`modulation` 필드가 나타내는 지원 변조 방식입니다.

.. _band-modulation:

.. flat-table:: Band Modulation Systems
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 4

    * - ``V4L2_BAND_MODULATION_VSB``
      - 0x02
      - Vestigial Sideband modulation, used for analog TV.
    * - ``V4L2_BAND_MODULATION_FM``
      - 0x04
      - Frequency Modulation, commonly used for analog radio.
    * - ``V4L2_BAND_MODULATION_AM``
      - 0x08
      - Amplitude Modulation, commonly used for analog radio.

반환값과 EINVAL

130-139

성공하면 0을 반환합니다. 오류가 발생하면 -1을 반환하고 `errno`를 적절한 값으로 설정하며, 공통 오류 코드는 Generic Error Codes 장을 따릅니다.

VIDIOC_ENUM_FREQ_BANDS 오류
errno조건
`EINVAL``tuner` 또는 `index`가 범위를 벗어나거나 `type` 필드가 잘못됨

입력 선택이나 열거 순번이 잘못된 경우입니다.

Return Value
============

On success 0 is returned, on error -1 and the ``errno`` variable is set
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.

EINVAL
    The ``tuner`` or ``index`` is out of bounds or the ``type`` field is
    wrong.