← Documents Documentation/userspace-api/media/v4l/vidioc-g-tuner.rst GitHub 원문 ↗

Linux 6.18.37 · 사용자 공간 API

VIDIOC_G_TUNER·VIDIOC_S_TUNER ioctl

V4L2 tuner를 열거하고 오디오 모드를 설정하며, 주파수 범위·기능 플래그·수신 subchannel·audio mode와 실제 재생 결과 행렬을 해석하는 방법을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

vidioc-g-tuner.rst:1-464

Tuner 조회와 설정에서는 현재 입력이 선택하는 tuner, capability에 따른 주파수 단위, 실제 수신 상태와 요청 audio mode의 차이를 분리해 다뤄야 합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2 .. c:namespace:: V4L
3
4 .. _VIDIOC_G_TUNER:
5
6 ************************************
7 ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER
8 ************************************
9
10 Name
11 ====
12
13 VIDIOC_G_TUNER - VIDIOC_S_TUNER - Get or set tuner attributes
14
15 Synopsis
16 ========
17
18 .. c:macro:: VIDIOC_G_TUNER
19
20 ``int ioctl(int fd, VIDIOC_G_TUNER, struct v4l2_tuner *argp)``
21
22 .. c:macro:: VIDIOC_S_TUNER
23
24 ``int ioctl(int fd, VIDIOC_S_TUNER, const struct v4l2_tuner *argp)``
25
26 Arguments
27 =========
28
29 ``fd``
30 File descriptor returned by :c:func:`open()`.
31
32 ``argp``
33 Pointer to struct :c:type:`v4l2_tuner`.
34
35 Description
36 ===========
37
38 To query the attributes of a tuner applications initialize the ``index``
39 field and zero out the ``reserved`` array of a struct
40 :c:type:`v4l2_tuner` and call the ``VIDIOC_G_TUNER`` ioctl
41 with a pointer to this structure. Drivers fill the rest of the structure
42 or return an ``EINVAL`` error code when the index is out of bounds. To
43 enumerate all tuners applications shall begin at index zero,
44 incrementing by one until the driver returns ``EINVAL``.
45
46 Tuners have two writable properties, the audio mode and the radio
47 frequency. To change the audio mode, applications initialize the
48 ``index``, ``audmode`` and ``reserved`` fields and call the
49 ``VIDIOC_S_TUNER`` ioctl. This will *not* change the current tuner,
50 which is determined by the current video input. Drivers may choose a
51 different audio mode if the requested mode is invalid or unsupported.
52 Since this is a write-only ioctl, it does not return the actually
53 selected audio mode.
54
55 :ref:`SDR <sdr>` specific tuner types are ``V4L2_TUNER_SDR`` and
56 ``V4L2_TUNER_RF``. For SDR devices ``audmode`` field must be initialized
57 to zero. The term 'tuner' means SDR receiver in this context.
58
59 To change the radio frequency the
60 :ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available.
61
62 .. tabularcolumns:: |p{1.3cm}|p{3.0cm}|p{7.0cm}|p{5.8cm}|
63
64 .. c:type:: v4l2_tuner
65
66 .. cssclass:: longtable
67
68 .. flat-table:: struct v4l2_tuner
69 :header-rows: 0
70 :stub-columns: 0
71
72 * - __u32
73 - ``index``
74 - :cspan:`1` Identifies the tuner, set by the application.
75 * - __u8
76 - ``name``\ [32]
77 - :cspan:`1`
78
79 Name of the tuner, a NUL-terminated ASCII string.
80
81 This information is intended for the user.
82 * - __u32
83 - ``type``
84 - :cspan:`1` Type of the tuner, see :c:type:`v4l2_tuner_type`.
85 * - __u32
86 - ``capability``
87 - :cspan:`1`
88
89 Tuner capability flags, see :ref:`tuner-capability`. Audio flags
90 indicate the ability to decode audio subprograms. They will *not*
91 change, for example with the current video standard.
92
93 When the structure refers to a radio tuner the
94 ``V4L2_TUNER_CAP_LANG1``, ``V4L2_TUNER_CAP_LANG2`` and
95 ``V4L2_TUNER_CAP_NORM`` flags can't be used.
96
97 If multiple frequency bands are supported, then ``capability`` is
98 the union of all ``capability`` fields of each struct
99 :c:type:`v4l2_frequency_band`.
100 * - __u32
101 - ``rangelow``
102 - :cspan:`1` The lowest tunable frequency in units of 62.5 kHz, or
103 if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in units
104 of 62.5 Hz, or if the ``capability`` flag ``V4L2_TUNER_CAP_1HZ``
105 is set, in units of 1 Hz. If multiple frequency bands are
106 supported, then ``rangelow`` is the lowest frequency of all the
107 frequency bands.
108 * - __u32
109 - ``rangehigh``
110 - :cspan:`1` The highest tunable frequency in units of 62.5 kHz,
111 or if the ``capability`` flag ``V4L2_TUNER_CAP_LOW`` is set, in
112 units of 62.5 Hz, or if the ``capability`` flag
113 ``V4L2_TUNER_CAP_1HZ`` is set, in units of 1 Hz. If multiple
114 frequency bands are supported, then ``rangehigh`` is the highest
115 frequency of all the frequency bands.
116 * - __u32
117 - ``rxsubchans``
118 - :cspan:`1`
119
120 Some tuners or audio decoders can determine the received audio
121 subprograms by analyzing audio carriers, pilot tones or other
122 indicators. To pass this information drivers set flags defined in
123 :ref:`tuner-rxsubchans` in this field. For example:
124 * -
125 -
126 - ``V4L2_TUNER_SUB_MONO``
127 - receiving mono audio
128 * -
129 -
130 - ``STEREO | SAP``
131 - receiving stereo audio and a secondary audio program
132 * -
133 -
134 - ``MONO | STEREO``
135 - receiving mono or stereo audio, the hardware cannot distinguish
136 * -
137 -
138 - ``LANG1 | LANG2``
139 - receiving bilingual audio
140 * -
141 -
142 - ``MONO | STEREO | LANG1 | LANG2``
143 - receiving mono, stereo or bilingual audio
144 * -
145 -
146 - :cspan:`1`
147
148 When the ``V4L2_TUNER_CAP_STEREO``, ``_LANG1``, ``_LANG2`` or
149 ``_SAP`` flag is cleared in the ``capability`` field, the
150 corresponding ``V4L2_TUNER_SUB_`` flag must not be set here.
151
152 This field is valid only if this is the tuner of the current video
153 input, or when the structure refers to a radio tuner.
154 * - __u32
155 - ``audmode``
156 - :cspan:`1`
157
158 The selected audio mode, see :ref:`tuner-audmode` for valid
159 values. The audio mode does not affect audio subprogram detection,
160 and like a :ref:`control` it does not automatically
161 change unless the requested mode is invalid or unsupported. See
162 :ref:`tuner-matrix` for possible results when the selected and
163 received audio programs do not match.
164
165 Currently this is the only field of struct
166 struct :c:type:`v4l2_tuner` applications can change.
167 * - __u32
168 - ``signal``
169 - :cspan:`1` The signal strength if known.
170
171 Ranging from 0 to 65535. Higher values indicate a better signal.
172 * - __s32
173 - ``afc``
174 - :cspan:`1` Automatic frequency control.
175
176 When the ``afc`` value is negative, the frequency is too
177 low, when positive too high.
178 * - __u32
179 - ``reserved``\ [4]
180 - :cspan:`1` Reserved for future extensions.
181
182 Drivers and applications must set the array to zero.
183
184
185 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
186
187 .. c:type:: v4l2_tuner_type
188
189 .. flat-table:: enum v4l2_tuner_type
190 :header-rows: 0
191 :stub-columns: 0
192 :widths: 3 1 6
193
194 * - ``V4L2_TUNER_RADIO``
195 - 1
196 - Tuner supports radio
197 * - ``V4L2_TUNER_ANALOG_TV``
198 - 2
199 - Tuner supports analog TV
200 * - ``V4L2_TUNER_SDR``
201 - 4
202 - Tuner controls the A/D and/or D/A block of a
203 Software Digital Radio (SDR)
204 * - ``V4L2_TUNER_RF``
205 - 5
206 - Tuner controls the RF part of a Software Digital Radio (SDR)
207
208 .. tabularcolumns:: |p{7.0cm}|p{2.2cm}|p{8.1cm}|
209
210 .. _tuner-capability:
211
212 .. cssclass:: longtable
213
214 .. flat-table:: Tuner and Modulator Capability Flags
215 :header-rows: 0
216 :stub-columns: 0
217 :widths: 3 1 4
218
219 * - ``V4L2_TUNER_CAP_LOW``
220 - 0x0001
221 - When set, tuning frequencies are expressed in units of 62.5 Hz
222 instead of 62.5 kHz.
223 * - ``V4L2_TUNER_CAP_NORM``
224 - 0x0002
225 - This is a multi-standard tuner; the video standard can or must be
226 switched. (B/G PAL tuners for example are typically not considered
227 multi-standard because the video standard is automatically
228 determined from the frequency band.) The set of supported video
229 standards is available from the struct
230 :c:type:`v4l2_input` pointing to this tuner, see the
231 description of ioctl :ref:`VIDIOC_ENUMINPUT`
232 for details. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this
233 capability.
234 * - ``V4L2_TUNER_CAP_HWSEEK_BOUNDED``
235 - 0x0004
236 - If set, then this tuner supports the hardware seek functionality
237 where the seek stops when it reaches the end of the frequency
238 range.
239 * - ``V4L2_TUNER_CAP_HWSEEK_WRAP``
240 - 0x0008
241 - If set, then this tuner supports the hardware seek functionality
242 where the seek wraps around when it reaches the end of the
243 frequency range.
244 * - ``V4L2_TUNER_CAP_STEREO``
245 - 0x0010
246 - Stereo audio reception is supported.
247 * - ``V4L2_TUNER_CAP_LANG1``
248 - 0x0040
249 - Reception of the primary language of a bilingual audio program is
250 supported. Bilingual audio is a feature of two-channel systems,
251 transmitting the primary language monaural on the main audio
252 carrier and a secondary language monaural on a second carrier.
253 Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.
254 * - ``V4L2_TUNER_CAP_LANG2``
255 - 0x0020
256 - Reception of the secondary language of a bilingual audio program
257 is supported. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this
258 capability.
259 * - ``V4L2_TUNER_CAP_SAP``
260 - 0x0020
261 - Reception of a secondary audio program is supported. This is a
262 feature of the BTSC system which accompanies the NTSC video
263 standard. Two audio carriers are available for mono or stereo
264 transmissions of a primary language, and an independent third
265 carrier for a monaural secondary language. Only
266 ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.
267
268 .. note::
269
270 The ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP``
271 flags are synonyms. ``V4L2_TUNER_CAP_SAP`` applies when the tuner
272 supports the ``V4L2_STD_NTSC_M`` video standard.
273 * - ``V4L2_TUNER_CAP_RDS``
274 - 0x0080
275 - RDS capture is supported. This capability is only valid for radio
276 tuners.
277 * - ``V4L2_TUNER_CAP_RDS_BLOCK_IO``
278 - 0x0100
279 - The RDS data is passed as unparsed RDS blocks.
280 * - ``V4L2_TUNER_CAP_RDS_CONTROLS``
281 - 0x0200
282 - The RDS data is parsed by the hardware and set via controls.
283 * - ``V4L2_TUNER_CAP_FREQ_BANDS``
284 - 0x0400
285 - The :ref:`VIDIOC_ENUM_FREQ_BANDS`
286 ioctl can be used to enumerate the available frequency bands.
287 * - ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM``
288 - 0x0800
289 - The range to search when using the hardware seek functionality is
290 programmable, see
291 :ref:`VIDIOC_S_HW_FREQ_SEEK` for
292 details.
293 * - ``V4L2_TUNER_CAP_1HZ``
294 - 0x1000
295 - When set, tuning frequencies are expressed in units of 1 Hz
296 instead of 62.5 kHz.
297
298
299 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
300
301 .. _tuner-rxsubchans:
302
303 .. flat-table:: Tuner Audio Reception Flags
304 :header-rows: 0
305 :stub-columns: 0
306 :widths: 3 1 4
307
308 * - ``V4L2_TUNER_SUB_MONO``
309 - 0x0001
310 - The tuner receives a mono audio signal.
311 * - ``V4L2_TUNER_SUB_STEREO``
312 - 0x0002
313 - The tuner receives a stereo audio signal.
314 * - ``V4L2_TUNER_SUB_LANG1``
315 - 0x0008
316 - The tuner receives the primary language of a bilingual audio
317 signal. Drivers must clear this flag when the current video
318 standard is ``V4L2_STD_NTSC_M``.
319 * - ``V4L2_TUNER_SUB_LANG2``
320 - 0x0004
321 - The tuner receives the secondary language of a bilingual audio
322 signal (or a second audio program).
323 * - ``V4L2_TUNER_SUB_SAP``
324 - 0x0004
325 - The tuner receives a Second Audio Program.
326
327 .. note::
328
329 The ``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP``
330 flags are synonyms. The ``V4L2_TUNER_SUB_SAP`` flag applies
331 when the current video standard is ``V4L2_STD_NTSC_M``.
332 * - ``V4L2_TUNER_SUB_RDS``
333 - 0x0010
334 - The tuner receives an RDS channel.
335
336
337 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.5cm}|
338
339 .. _tuner-audmode:
340
341 .. flat-table:: Tuner Audio Modes
342 :header-rows: 0
343 :stub-columns: 0
344 :widths: 3 1 4
345
346 * - ``V4L2_TUNER_MODE_MONO``
347 - 0
348 - Play mono audio. When the tuner receives a stereo signal this a
349 down-mix of the left and right channel. When the tuner receives a
350 bilingual or SAP signal this mode selects the primary language.
351 * - ``V4L2_TUNER_MODE_STEREO``
352 - 1
353 - Play stereo audio. When the tuner receives bilingual audio it may
354 play different languages on the left and right channel or the
355 primary language is played on both channels.
356
357 Playing different languages in this mode is deprecated. New
358 drivers should do this only in ``MODE_LANG1_LANG2``.
359
360 When the tuner receives no stereo signal or does not support
361 stereo reception the driver shall fall back to ``MODE_MONO``.
362 * - ``V4L2_TUNER_MODE_LANG1``
363 - 3
364 - Play the primary language, mono or stereo. Only
365 ``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
366 * - ``V4L2_TUNER_MODE_LANG2``
367 - 2
368 - Play the secondary language, mono. When the tuner receives no
369 bilingual audio or SAP, or their reception is not supported the
370 driver shall fall back to mono or stereo mode. Only
371 ``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
372 * - ``V4L2_TUNER_MODE_SAP``
373 - 2
374 - Play the Second Audio Program. When the tuner receives no
375 bilingual audio or SAP, or their reception is not supported the
376 driver shall fall back to mono or stereo mode. Only
377 ``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
378
379 .. note:: The ``V4L2_TUNER_MODE_LANG2`` and ``V4L2_TUNER_MODE_SAP``
380 are synonyms.
381 * - ``V4L2_TUNER_MODE_LANG1_LANG2``
382 - 4
383 - Play the primary language on the left channel, the secondary
384 language on the right channel. When the tuner receives no
385 bilingual audio or SAP, it shall fall back to ``MODE_LANG1`` or
386 ``MODE_MONO``. Only ``V4L2_TUNER_ANALOG_TV`` tuners support this
387 mode.
388
389 .. raw:: latex
390
391 \scriptsize
392
393 .. tabularcolumns:: |p{1.5cm}|p{1.5cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}|p{2.9cm}|
394
395 .. _tuner-matrix:
396
397 .. flat-table:: Tuner Audio Matrix
398 :header-rows: 2
399 :stub-columns: 0
400 :widths: 7 7 14 14 14 14
401
402 * -
403 - :cspan:`4` Selected ``V4L2_TUNER_MODE_``
404 * - Received ``V4L2_TUNER_SUB_``
405 - ``MONO``
406 - ``STEREO``
407 - ``LANG1``
408 - ``LANG2 = SAP``
409 - ``LANG1_LANG2``\ [#f1]_
410 * - ``MONO``
411 - Mono
412 - Mono/Mono
413 - Mono
414 - Mono
415 - Mono/Mono
416 * - ``MONO | SAP``
417 - Mono
418 - Mono/Mono
419 - Mono
420 - SAP
421 - Mono/SAP (preferred) or Mono/Mono
422 * - ``STEREO``
423 - L+R
424 - L/R
425 - Stereo L/R (preferred) or Mono L+R
426 - Stereo L/R (preferred) or Mono L+R
427 - L/R (preferred) or L+R/L+R
428 * - ``STEREO | SAP``
429 - L+R
430 - L/R
431 - Stereo L/R (preferred) or Mono L+R
432 - SAP
433 - L+R/SAP (preferred) or L/R or L+R/L+R
434 * - ``LANG1 | LANG2``
435 - Language 1
436 - Lang1/Lang2 (deprecated\ [#f2]_) or Lang1/Lang1
437 - Language 1
438 - Language 2
439 - Lang1/Lang2 (preferred) or Lang1/Lang1
440
441 .. raw:: latex
442
443 \normalsize
444
445 Return Value
446 ============
447
448 On success 0 is returned, on error -1 and the ``errno`` variable is set
449 appropriately. The generic error codes are described at the
450 :ref:`Generic Error Codes <gen-errors>` chapter.
451
452 EINVAL
453 The struct :c:type:`v4l2_tuner` ``index`` is out of
454 bounds.
455
456 .. [#f1]
457 This mode has been added in Linux 2.6.17 and may not be supported by
458 older drivers.
459
460 .. [#f2]
461 Playback of both languages in ``MODE_STEREO`` is deprecated. In the
462 future drivers should produce only the primary language in this mode.
463 Applications should request ``MODE_LANG1_LANG2`` to record both
464 languages or a stereo signal.
465

3. 한국어 전문 번역

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

목적, 호출 형식과 인자

1-34

`VIDIOC_G_TUNER`는 tuner 속성을 조회하고 `VIDIOC_S_TUNER`는 쓰기 가능한 tuner 속성 가운데 오디오 모드를 설정합니다. 두 명령 모두 `struct v4l2_tuner` 포인터를 사용합니다.

ioctl 인터페이스
명령인자역할
`VIDIOC_G_TUNER``struct v4l2_tuner *argp`지정한 tuner의 속성 조회
`VIDIOC_S_TUNER``const struct v4l2_tuner *argp`지정한 tuner의 오디오 모드 요청
`fd`파일 디스크립터`open()`이 반환한 장치 핸들

조회와 설정의 인자 방향을 구분합니다.

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

.. _VIDIOC_G_TUNER:

************************************
ioctl VIDIOC_G_TUNER, VIDIOC_S_TUNER
************************************

Name
====

VIDIOC_G_TUNER - VIDIOC_S_TUNER - Get or set tuner attributes

Synopsis
========

.. c:macro:: VIDIOC_G_TUNER

``int ioctl(int fd, VIDIOC_G_TUNER, struct v4l2_tuner *argp)``

.. c:macro:: VIDIOC_S_TUNER

``int ioctl(int fd, VIDIOC_S_TUNER, const struct v4l2_tuner *argp)``

Arguments
=========

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

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

조회·열거·설정 절차

35-63

조회할 때 애플리케이션은 `index`를 지정하고 `reserved[4]`를 모두 0으로 만든 뒤 `VIDIOC_G_TUNER`를 호출합니다. 드라이버는 나머지 필드를 채우며 범위를 벗어난 index에는 `EINVAL`을 반환합니다.

모든 tuner 열거
1. `index = 0`에서 시작2. `reserved[4]`를 0으로 초기화하고 조회3. 성공하면 index를 1 증가4. `EINVAL`이 반환되면 열거 종료

연속 index 규칙과 종료 조건입니다.

Tuner의 쓰기 가능한 속성은 오디오 모드와 무선 주파수입니다. 오디오 모드는 `index`, `audmode`, `reserved`를 준비해 `VIDIOC_S_TUNER`로 바꾸고, 주파수는 `VIDIOC_S_FREQUENCY`로 바꿉니다.

`VIDIOC_S_TUNER`는 현재 tuner를 바꾸지 않습니다. 현재 tuner는 현재 영상 입력이 결정합니다. 요청한 오디오 모드가 잘못되었거나 지원되지 않으면 드라이버가 다른 모드를 선택할 수 있으며, 쓰기 전용 ioctl이므로 실제 선택값을 반환하지 않습니다.

SDR 전용 tuner type은 `V4L2_TUNER_SDR`과 `V4L2_TUNER_RF`입니다. SDR 장치에서는 `audmode`를 0으로 초기화해야 하며, 이 문맥에서 tuner는 SDR receiver를 뜻합니다.

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

To query the attributes of a tuner applications initialize the ``index``
field and zero out the ``reserved`` array of a struct
:c:type:`v4l2_tuner` and call the ``VIDIOC_G_TUNER`` ioctl
with a pointer to this structure. Drivers fill the rest of the structure
or return an ``EINVAL`` error code when the index is out of bounds. To
enumerate all tuners applications shall begin at index zero,
incrementing by one until the driver returns ``EINVAL``.

Tuners have two writable properties, the audio mode and the radio
frequency. To change the audio mode, applications initialize the
``index``, ``audmode`` and ``reserved`` fields and call the
``VIDIOC_S_TUNER`` ioctl. This will *not* change the current tuner,
which is determined by the current video input. Drivers may choose a
different audio mode if the requested mode is invalid or unsupported.
Since this is a write-only ioctl, it does not return the actually
selected audio mode.

:ref:`SDR <sdr>` specific tuner types are ``V4L2_TUNER_SDR`` and
``V4L2_TUNER_RF``. For SDR devices ``audmode`` field must be initialized
to zero. The term 'tuner' means SDR receiver in this context.

To change the radio frequency the
:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available.

 .. tabularcolumns:: |p{1.3cm}|p{3.0cm}|p{7.0cm}|p{5.8cm}|

struct v4l2_tuner 필드

64-186
v4l2_tuner 기본 필드
형식필드의미
`__u32``index`애플리케이션이 지정하는 tuner 식별자
`__u8[32]``name[32]`사용자 표시용 NUL 종료 ASCII 이름
`__u32``type``enum v4l2_tuner_type` 값
`__u32``capability`고정된 tuner 기능 플래그. 여러 band가 있으면 각 `v4l2_frequency_band.capability`의 합집합
`__u32``rangelow`모든 주파수 band 가운데 가장 낮은 조정 가능 주파수
`__u32``rangehigh`모든 주파수 band 가운데 가장 높은 조정 가능 주파수
`__u32``rxsubchans`현재 수신 중인 오디오 subprogram 플래그
`__u32``audmode`선택된 오디오 모드. 현재 애플리케이션이 이 구조체에서 변경할 수 있는 유일한 필드
`__u32``signal`알 수 있을 때의 신호 세기 0-65535. 클수록 양호
`__s32``afc`자동 주파수 제어 오차. 음수면 주파수가 너무 낮고 양수면 너무 높음
`__u32[4]``reserved[4]`향후 확장용. 드라이버와 애플리케이션이 모두 0으로 설정

애플리케이션 입력, 드라이버 출력, 조건부 유효 필드를 함께 정리합니다.

주파수 필드의 단위
조건단위
`V4L2_TUNER_CAP_1HZ` 설정1 Hz
그 외에 `V4L2_TUNER_CAP_LOW` 설정62.5 Hz
두 플래그 모두 없음62.5 kHz

capability에 따라 `rangelow`와 `rangehigh`를 해석합니다.

오디오 capability 플래그는 audio subprogram을 디코드할 능력을 나타내며 현재 영상 표준에 따라 바뀌지 않습니다. 라디오 tuner에서는 `V4L2_TUNER_CAP_LANG1`, `V4L2_TUNER_CAP_LANG2`, `V4L2_TUNER_CAP_NORM`을 사용할 수 없습니다.

rxsubchans 조합 예
플래그
`V4L2_TUNER_SUB_MONO`mono 수신
`STEREO | SAP`stereo와 secondary audio program 수신
`MONO | STEREO`mono 또는 stereo이나 하드웨어가 구분하지 못함
`LANG1 | LANG2`이중 언어 오디오 수신
`MONO | STEREO | LANG1 | LANG2`mono, stereo 또는 이중 언어이나 구분하지 못함

하드웨어가 carrier·pilot tone 등을 분석해 판별한 수신 상태입니다.

`capability`에서 `STEREO`, `LANG1`, `LANG2`, `SAP` 기능이 꺼져 있으면 대응하는 `V4L2_TUNER_SUB_*` 수신 플래그도 설정할 수 없습니다. `rxsubchans`는 현재 영상 입력의 tuner이거나 라디오 tuner일 때만 유효합니다.

`audmode`는 audio subprogram 검출 자체에 영향을 주지 않습니다. 제어값처럼 요청 모드가 유효하고 지원되는 한 자동으로 바뀌지 않으며, 선택 모드와 실제 수신 프로그램이 다를 때의 결과는 뒤의 audio matrix를 따릅니다.

.. c:type:: v4l2_tuner

.. cssclass:: longtable

.. flat-table:: struct v4l2_tuner
    :header-rows:  0
    :stub-columns: 0

    * - __u32
      - ``index``
      - :cspan:`1` Identifies the tuner, set by the application.
    * - __u8
      - ``name``\ [32]
      - :cspan:`1`

	Name of the tuner, a NUL-terminated ASCII string.

	This information is intended for the user.
    * - __u32
      - ``type``
      - :cspan:`1` Type of the tuner, see :c:type:`v4l2_tuner_type`.
    * - __u32
      - ``capability``
      - :cspan:`1`

	Tuner capability flags, see :ref:`tuner-capability`. Audio flags
	indicate the ability to decode audio subprograms. They will *not*
	change, for example with the current video standard.

	When the structure refers to a radio tuner the
	``V4L2_TUNER_CAP_LANG1``, ``V4L2_TUNER_CAP_LANG2`` and
	``V4L2_TUNER_CAP_NORM`` flags can't be used.

	If multiple frequency bands are supported, then ``capability`` is
	the union of all ``capability`` fields of each struct
	:c:type:`v4l2_frequency_band`.
    * - __u32
      - ``rangelow``
      - :cspan:`1` 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, or if the ``capability`` flag ``V4L2_TUNER_CAP_1HZ``
	is set, in units of 1 Hz. If multiple frequency bands are
	supported, then ``rangelow`` is the lowest frequency of all the
	frequency bands.
    * - __u32
      - ``rangehigh``
      - :cspan:`1` 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, or if the ``capability`` flag
	``V4L2_TUNER_CAP_1HZ`` is set, in units of 1 Hz. If multiple
	frequency bands are supported, then ``rangehigh`` is the highest
	frequency of all the frequency bands.
    * - __u32
      - ``rxsubchans``
      - :cspan:`1`

	Some tuners or audio decoders can determine the received audio
	subprograms by analyzing audio carriers, pilot tones or other
	indicators. To pass this information drivers set flags defined in
	:ref:`tuner-rxsubchans` in this field. For example:
    * -
      -
      - ``V4L2_TUNER_SUB_MONO``
      - receiving mono audio
    * -
      -
      - ``STEREO | SAP``
      - receiving stereo audio and a secondary audio program
    * -
      -
      - ``MONO | STEREO``
      - receiving mono or stereo audio, the hardware cannot distinguish
    * -
      -
      - ``LANG1 | LANG2``
      - receiving bilingual audio
    * -
      -
      - ``MONO | STEREO | LANG1 | LANG2``
      - receiving mono, stereo or bilingual audio
    * -
      -
      - :cspan:`1`

	When the ``V4L2_TUNER_CAP_STEREO``, ``_LANG1``, ``_LANG2`` or
	``_SAP`` flag is cleared in the ``capability`` field, the
	corresponding ``V4L2_TUNER_SUB_`` flag must not be set here.

	This field is valid only if this is the tuner of the current video
	input, or when the structure refers to a radio tuner.
    * - __u32
      - ``audmode``
      - :cspan:`1`

	The selected audio mode, see :ref:`tuner-audmode` for valid
	values. The audio mode does not affect audio subprogram detection,
	and like a :ref:`control` it does not automatically
	change unless the requested mode is invalid or unsupported. See
	:ref:`tuner-matrix` for possible results when the selected and
	received audio programs do not match.

	Currently this is the only field of struct
	struct :c:type:`v4l2_tuner` applications can change.
    * - __u32
      - ``signal``
      - :cspan:`1` The signal strength if known.

	Ranging from 0 to 65535. Higher values indicate a better signal.
    * - __s32
      - ``afc``
      - :cspan:`1` Automatic frequency control.

	When the ``afc`` value is negative, the frequency is too
	low, when positive too high.
    * - __u32
      - ``reserved``\ [4]
      - :cspan:`1` Reserved for future extensions.

	Drivers and applications must set the array to zero.


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

enum v4l2_tuner_type

187-209
Tuner 형식
상수의미
`V4L2_TUNER_RADIO`1라디오 tuner
`V4L2_TUNER_ANALOG_TV`2아날로그 TV tuner
`V4L2_TUNER_SDR`4Software Digital Radio의 A/D 또는 D/A 블록 제어
`V4L2_TUNER_RF`5Software Digital Radio의 RF 부분 제어

각 값이 제어하는 장치 영역입니다.

.. c:type:: v4l2_tuner_type

.. flat-table:: enum v4l2_tuner_type
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 6

    * - ``V4L2_TUNER_RADIO``
      - 1
      - Tuner supports radio
    * - ``V4L2_TUNER_ANALOG_TV``
      - 2
      - Tuner supports analog TV
    * - ``V4L2_TUNER_SDR``
      - 4
      - Tuner controls the A/D and/or D/A block of a
	Software Digital Radio (SDR)
    * - ``V4L2_TUNER_RF``
      - 5
      - Tuner controls the RF part of a Software Digital Radio (SDR)

.. tabularcolumns:: |p{7.0cm}|p{2.2cm}|p{8.1cm}|

Tuner와 modulator 기능 플래그

210-300
주파수·탐색 기능
상수의미
`V4L2_TUNER_CAP_LOW``0x0001`주파수 단위가 62.5 kHz 대신 62.5 Hz
`V4L2_TUNER_CAP_NORM``0x0002`전환 가능한 multi-standard tuner. 아날로그 TV만 가능하며 지원 표준은 `v4l2_input`과 `VIDIOC_ENUMINPUT`에서 확인
`V4L2_TUNER_CAP_HWSEEK_BOUNDED``0x0004`범위 끝에서 멈추는 hardware seek
`V4L2_TUNER_CAP_HWSEEK_WRAP``0x0008`범위 끝에서 반대편으로 순환하는 hardware seek
`V4L2_TUNER_CAP_FREQ_BANDS``0x0400``VIDIOC_ENUM_FREQ_BANDS`로 사용 가능한 band 열거 가능
`V4L2_TUNER_CAP_HWSEEK_PROG_LIM``0x0800``VIDIOC_S_HW_FREQ_SEEK`에서 탐색 범위를 프로그래밍 가능
`V4L2_TUNER_CAP_1HZ``0x1000`주파수 단위가 62.5 kHz 대신 1 Hz

주파수 표현과 hardware seek 동작을 정하는 capability입니다.

오디오·RDS 기능
상수의미
`V4L2_TUNER_CAP_STEREO``0x0010`stereo 오디오 수신
`V4L2_TUNER_CAP_LANG1``0x0040`이중 언어 프로그램의 주 언어 수신. 아날로그 TV만 가능
`V4L2_TUNER_CAP_LANG2``0x0020`이중 언어 프로그램의 보조 언어 수신. 아날로그 TV만 가능
`V4L2_TUNER_CAP_SAP``0x0020`NTSC의 BTSC secondary audio program 수신. 아날로그 TV만 가능
`V4L2_TUNER_CAP_RDS``0x0080`라디오 tuner에서 RDS 캡처
`V4L2_TUNER_CAP_RDS_BLOCK_IO``0x0100`파싱하지 않은 RDS block으로 전달
`V4L2_TUNER_CAP_RDS_CONTROLS``0x0200`하드웨어가 RDS를 파싱해 control로 제공

디코딩 가능한 오디오 subprogram과 RDS 전달 방식을 나타냅니다.

`V4L2_TUNER_CAP_LANG2`와 `V4L2_TUNER_CAP_SAP`는 같은 값의 동의어입니다. Tuner가 `V4L2_STD_NTSC_M`을 지원하는 경우에는 SAP 이름을 사용합니다.

`V4L2_TUNER_CAP_NORM`은 주파수 band만으로 표준이 자동 결정되는 일반 B/G PAL tuner를 뜻하지 않습니다. 영상 표준을 바꿀 수 있거나 바꿔야 하는 진정한 multi-standard tuner를 나타냅니다.

.. _tuner-capability:

.. cssclass:: longtable

.. flat-table:: Tuner and Modulator Capability Flags
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 4

    * - ``V4L2_TUNER_CAP_LOW``
      - 0x0001
      - When set, tuning frequencies are expressed in units of 62.5 Hz
	instead of 62.5 kHz.
    * - ``V4L2_TUNER_CAP_NORM``
      - 0x0002
      - This is a multi-standard tuner; the video standard can or must be
	switched. (B/G PAL tuners for example are typically not considered
	multi-standard because the video standard is automatically
	determined from the frequency band.) The set of supported video
	standards is available from the struct
	:c:type:`v4l2_input` pointing to this tuner, see the
	description of ioctl :ref:`VIDIOC_ENUMINPUT`
	for details. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this
	capability.
    * - ``V4L2_TUNER_CAP_HWSEEK_BOUNDED``
      - 0x0004
      - If set, then this tuner supports the hardware seek functionality
	where the seek stops when it reaches the end of the frequency
	range.
    * - ``V4L2_TUNER_CAP_HWSEEK_WRAP``
      - 0x0008
      - If set, then this tuner supports the hardware seek functionality
	where the seek wraps around when it reaches the end of the
	frequency range.
    * - ``V4L2_TUNER_CAP_STEREO``
      - 0x0010
      - Stereo audio reception is supported.
    * - ``V4L2_TUNER_CAP_LANG1``
      - 0x0040
      - Reception of the primary language of a bilingual audio program is
	supported. Bilingual audio is a feature of two-channel systems,
	transmitting the primary language monaural on the main audio
	carrier and a secondary language monaural on a second carrier.
	Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.
    * - ``V4L2_TUNER_CAP_LANG2``
      - 0x0020
      - Reception of the secondary language of a bilingual audio program
	is supported. Only ``V4L2_TUNER_ANALOG_TV`` tuners can have this
	capability.
    * - ``V4L2_TUNER_CAP_SAP``
      - 0x0020
      - Reception of a secondary audio program is supported. This is a
	feature of the BTSC system which accompanies the NTSC video
	standard. Two audio carriers are available for mono or stereo
	transmissions of a primary language, and an independent third
	carrier for a monaural secondary language. Only
	``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.

	.. note::

	   The ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP``
	   flags are synonyms. ``V4L2_TUNER_CAP_SAP`` applies when the tuner
	   supports the ``V4L2_STD_NTSC_M`` video standard.
    * - ``V4L2_TUNER_CAP_RDS``
      - 0x0080
      - RDS capture is supported. This capability is only valid for radio
	tuners.
    * - ``V4L2_TUNER_CAP_RDS_BLOCK_IO``
      - 0x0100
      - The RDS data is passed as unparsed RDS blocks.
    * - ``V4L2_TUNER_CAP_RDS_CONTROLS``
      - 0x0200
      - The RDS data is parsed by the hardware and set via controls.
    * - ``V4L2_TUNER_CAP_FREQ_BANDS``
      - 0x0400
      - The :ref:`VIDIOC_ENUM_FREQ_BANDS`
	ioctl can be used to enumerate the available frequency bands.
    * - ``V4L2_TUNER_CAP_HWSEEK_PROG_LIM``
      - 0x0800
      - The range to search when using the hardware seek functionality is
	programmable, see
	:ref:`VIDIOC_S_HW_FREQ_SEEK` for
	details.
    * - ``V4L2_TUNER_CAP_1HZ``
      - 0x1000
      - When set, tuning frequencies are expressed in units of 1 Hz
	instead of 62.5 kHz.


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

Tuner 오디오 수신 플래그

301-338
수신 오디오 상태
상수의미
`V4L2_TUNER_SUB_MONO``0x0001`mono 오디오 수신
`V4L2_TUNER_SUB_STEREO``0x0002`stereo 오디오 수신
`V4L2_TUNER_SUB_LANG1``0x0008`이중 언어의 주 언어 수신. 현재 표준이 `V4L2_STD_NTSC_M`이면 드라이버가 이 플래그를 지워야 함
`V4L2_TUNER_SUB_LANG2``0x0004`이중 언어의 보조 언어 또는 두 번째 오디오 프로그램 수신
`V4L2_TUNER_SUB_SAP``0x0004`Secondary Audio Program 수신
`V4L2_TUNER_SUB_RDS``0x0010`RDS 채널 수신

`rxsubchans`에 보고되는 현재 수신 채널입니다.

`V4L2_TUNER_SUB_LANG2`와 `V4L2_TUNER_SUB_SAP`는 동의어입니다. 현재 영상 표준이 `V4L2_STD_NTSC_M`일 때 SAP 이름을 적용합니다.

.. _tuner-rxsubchans:

.. flat-table:: Tuner Audio Reception Flags
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 4

    * - ``V4L2_TUNER_SUB_MONO``
      - 0x0001
      - The tuner receives a mono audio signal.
    * - ``V4L2_TUNER_SUB_STEREO``
      - 0x0002
      - The tuner receives a stereo audio signal.
    * - ``V4L2_TUNER_SUB_LANG1``
      - 0x0008
      - The tuner receives the primary language of a bilingual audio
	signal. Drivers must clear this flag when the current video
	standard is ``V4L2_STD_NTSC_M``.
    * - ``V4L2_TUNER_SUB_LANG2``
      - 0x0004
      - The tuner receives the secondary language of a bilingual audio
	signal (or a second audio program).
    * - ``V4L2_TUNER_SUB_SAP``
      - 0x0004
      - The tuner receives a Second Audio Program.

	.. note::

	   The ``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP``
	   flags are synonyms. The ``V4L2_TUNER_SUB_SAP`` flag applies
	   when the current video standard is ``V4L2_STD_NTSC_M``.
    * - ``V4L2_TUNER_SUB_RDS``
      - 0x0010
      - The tuner receives an RDS channel.


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

Tuner 오디오 모드

339-394
선택 가능한 오디오 모드
상수재생 동작
`V4L2_TUNER_MODE_MONO`0mono 재생. stereo는 좌우 down-mix, bilingual 또는 SAP는 주 언어 선택
`V4L2_TUNER_MODE_STEREO`1stereo 재생. bilingual은 주 언어를 양쪽에 재생하거나 언어별 좌우 재생. stereo 미수신·미지원이면 `MODE_MONO`로 fallback
`V4L2_TUNER_MODE_LANG1`3주 언어를 mono 또는 stereo로 재생. 아날로그 TV만 지원
`V4L2_TUNER_MODE_LANG2`2보조 언어를 mono로 재생. bilingual/SAP 미수신·미지원이면 mono 또는 stereo로 fallback
`V4L2_TUNER_MODE_SAP`2SAP 재생. 미수신·미지원이면 mono 또는 stereo로 fallback
`V4L2_TUNER_MODE_LANG1_LANG2`4왼쪽에 주 언어, 오른쪽에 보조 언어. bilingual/SAP가 없으면 `MODE_LANG1` 또는 `MODE_MONO`로 fallback

수신 신호가 요청 모드를 만족하지 못할 때의 fallback까지 포함합니다.

`V4L2_TUNER_MODE_LANG2`와 `V4L2_TUNER_MODE_SAP`는 동의어이며 아날로그 TV tuner에서만 지원됩니다. `LANG1`과 `LANG1_LANG2`도 아날로그 TV 전용입니다.

`MODE_STEREO`에서 서로 다른 언어를 좌우 채널로 재생하는 동작은 폐기 예정입니다. 새 드라이버는 이 동작을 `MODE_LANG1_LANG2`에서만 제공해야 합니다.

원문의 LaTeX 지시문은 이어지는 audio matrix의 조판 크기만 바꾸며 API 동작에는 영향을 주지 않습니다.

.. _tuner-audmode:

.. flat-table:: Tuner Audio Modes
    :header-rows:  0
    :stub-columns: 0
    :widths:       3 1 4

    * - ``V4L2_TUNER_MODE_MONO``
      - 0
      - Play mono audio. When the tuner receives a stereo signal this a
	down-mix of the left and right channel. When the tuner receives a
	bilingual or SAP signal this mode selects the primary language.
    * - ``V4L2_TUNER_MODE_STEREO``
      - 1
      - Play stereo audio. When the tuner receives bilingual audio it may
	play different languages on the left and right channel or the
	primary language is played on both channels.

	Playing different languages in this mode is deprecated. New
	drivers should do this only in ``MODE_LANG1_LANG2``.

	When the tuner receives no stereo signal or does not support
	stereo reception the driver shall fall back to ``MODE_MONO``.
    * - ``V4L2_TUNER_MODE_LANG1``
      - 3
      - Play the primary language, mono or stereo. Only
	``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
    * - ``V4L2_TUNER_MODE_LANG2``
      - 2
      - Play the secondary language, mono. When the tuner receives no
	bilingual audio or SAP, or their reception is not supported the
	driver shall fall back to mono or stereo mode. Only
	``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
    * - ``V4L2_TUNER_MODE_SAP``
      - 2
      - Play the Second Audio Program. When the tuner receives no
	bilingual audio or SAP, or their reception is not supported the
	driver shall fall back to mono or stereo mode. Only
	``V4L2_TUNER_ANALOG_TV`` tuners support this mode.

	.. note:: The ``V4L2_TUNER_MODE_LANG2`` and ``V4L2_TUNER_MODE_SAP``
	   are synonyms.
    * - ``V4L2_TUNER_MODE_LANG1_LANG2``
      - 4
      - Play the primary language on the left channel, the secondary
	language on the right channel. When the tuner receives no
	bilingual audio or SAP, it shall fall back to ``MODE_LANG1`` or
	``MODE_MONO``. Only ``V4L2_TUNER_ANALOG_TV`` tuners support this
	mode.

.. raw:: latex

    \scriptsize

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

선택 모드와 수신 프로그램의 결과 행렬

395-444
Tuner Audio Matrix
수신 상태MONOSTEREOLANG1LANG2/SAPLANG1_LANG2
`MONO`MonoMono/MonoMonoMonoMono/Mono
`MONO | SAP`MonoMono/MonoMonoSAPMono/SAP 우선, 아니면 Mono/Mono
`STEREO`L+RL/RStereo L/R 우선, 아니면 Mono L+RStereo L/R 우선, 아니면 Mono L+RL/R 우선, 아니면 L+R/L+R
`STEREO | SAP`L+RL/RStereo L/R 우선, 아니면 Mono L+RSAPL+R/SAP 우선, 아니면 L/R 또는 L+R/L+R
`LANG1 | LANG2`Language 1Lang1/Lang2(폐기 예정) 또는 Lang1/Lang1Language 1Language 2Lang1/Lang2 우선, 아니면 Lang1/Lang1

행은 수신 상태, 열은 선택한 `V4L2_TUNER_MODE_*`입니다. `/`는 좌우 채널, `L+R`은 down-mix를 뜻합니다.

`LANG1_LANG2` 모드는 Linux 2.6.17에서 추가되었으므로 오래된 드라이버는 지원하지 않을 수 있습니다.

.. _tuner-matrix:

.. flat-table:: Tuner Audio Matrix
    :header-rows:  2
    :stub-columns: 0
    :widths: 7 7 14 14 14 14

    * -
      - :cspan:`4` Selected ``V4L2_TUNER_MODE_``
    * - Received ``V4L2_TUNER_SUB_``
      - ``MONO``
      - ``STEREO``
      - ``LANG1``
      - ``LANG2 = SAP``
      - ``LANG1_LANG2``\ [#f1]_
    * - ``MONO``
      - Mono
      - Mono/Mono
      - Mono
      - Mono
      - Mono/Mono
    * - ``MONO | SAP``
      - Mono
      - Mono/Mono
      - Mono
      - SAP
      - Mono/SAP (preferred) or Mono/Mono
    * - ``STEREO``
      - L+R
      - L/R
      - Stereo L/R (preferred) or Mono L+R
      - Stereo L/R (preferred) or Mono L+R
      - L/R (preferred) or L+R/L+R
    * - ``STEREO | SAP``
      - L+R
      - L/R
      - Stereo L/R (preferred) or Mono L+R
      - SAP
      - L+R/SAP (preferred) or L/R or L+R/L+R
    * - ``LANG1 | LANG2``
      - Language 1
      - Lang1/Lang2 (deprecated\ [#f2]_) or Lang1/Lang1
      - Language 1
      - Language 2
      - Lang1/Lang2 (preferred) or Lang1/Lang1

.. raw:: latex

    \normalsize

반환값, 오류와 호환성 각주

445-464

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

전용 오류
errno조건
`EINVAL``struct v4l2_tuner.index`가 범위를 벗어남

Tuner 열거의 종료 조건이기도 합니다.

`MODE_STEREO`에서 두 언어를 동시에 재생하는 동작은 폐기 예정입니다. 향후 드라이버는 이 모드에서 주 언어만 내보내야 하며, 두 언어나 stereo 신호를 기록하려는 애플리케이션은 `MODE_LANG1_LANG2`를 요청해야 합니다.

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 struct :c:type:`v4l2_tuner` ``index`` is out of
    bounds.

.. [#f1]
   This mode has been added in Linux 2.6.17 and may not be supported by
   older drivers.

.. [#f2]
   Playback of both languages in ``MODE_STEREO`` is deprecated. In the
   future drivers should produce only the primary language in this mode.
   Applications should request ``MODE_LANG1_LANG2`` to record both
   languages or a stereo signal.