← Documents Documentation/userspace-api/media/v4l/dv-timings.rst GitHub 원문 ↗

Linux 6.18.37 · Userspace API / Media / V4L

Digital Video(DV) Timing

HDMI·VGA·DVI timing 열거와 source-change event 이후 format·buffer 재협상 절차를 설명합니다.

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

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

1. 요약·해설

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

요약·해설

dv-timings.rst:1-59

DV timing API는 설정된 timing과 receiver가 실제 탐지한 timing을 분리합니다. QUERY_DV_TIMINGS는 상태를 바꾸지 않으며, source-change event를 받은 application이 명시적으로 새 timing과 format을 적용해야 합니다.

Signal 변경 뒤에는 streaming 중지, buffer 해제, timing 탐지·설정, G_FMT, 새 buffer 할당, streaming 재시작 순서를 지켜야 합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2
3 .. _dv-timings:
4
5 **************************
6 Digital Video (DV) Timings
7 **************************
8
9 The video standards discussed so far have been dealing with Analog TV
10 and the corresponding video timings. Today there are many more different
11 hardware interfaces such as High Definition TV interfaces (HDMI), VGA,
12 DVI connectors etc., that carry video signals and there is a need to
13 extend the API to select the video timings for these interfaces. Since
14 it is not possible to extend the :ref:`v4l2_std_id <v4l2-std-id>`
15 due to the limited bits available, a new set of ioctls was added to
16 set/get video timings at the input and output.
17
18 These ioctls deal with the detailed digital video timings that define
19 each video format. This includes parameters such as the active video
20 width and height, signal polarities, frontporches, backporches, sync
21 widths etc. The ``linux/v4l2-dv-timings.h`` header can be used to get
22 the timings of the formats in the :ref:`cea861` and :ref:`vesadmt`
23 standards.
24
25 To enumerate and query the attributes of the DV timings supported by a
26 device applications use the
27 :ref:`VIDIOC_ENUM_DV_TIMINGS` and
28 :ref:`VIDIOC_DV_TIMINGS_CAP` ioctls. To set
29 DV timings for the device applications use the
30 :ref:`VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl and to get
31 current DV timings they use the
32 :ref:`VIDIOC_G_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl. To detect
33 the DV timings as seen by the video receiver applications use the
34 :ref:`VIDIOC_QUERY_DV_TIMINGS` ioctl.
35
36 When the hardware detects a video source change (e.g. the video
37 signal appears or disappears, or the video resolution changes), then
38 it will issue a `V4L2_EVENT_SOURCE_CHANGE` event. Use the
39 :ref:`ioctl VIDIOC_SUBSCRIBE_EVENT <VIDIOC_SUBSCRIBE_EVENT>` and the
40 :ref:`VIDIOC_DQEVENT` to check if this event was reported.
41
42 If the video signal changed, then the application has to stop
43 streaming, free all buffers, and call the :ref:`VIDIOC_QUERY_DV_TIMINGS`
44 to obtain the new video timings, and if they are valid, it can set
45 those by calling the :ref:`ioctl VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>`.
46 This will also update the format, so use the :ref:`ioctl VIDIOC_G_FMT <VIDIOC_G_FMT>`
47 to obtain the new format. Now the application can allocate new buffers
48 and start streaming again.
49
50 The :ref:`VIDIOC_QUERY_DV_TIMINGS` will just report what the
51 hardware detects, it will never change the configuration. If the
52 currently set timings and the actually detected timings differ, then
53 typically this will mean that you will not be able to capture any
54 video. The correct approach is to rely on the `V4L2_EVENT_SOURCE_CHANGE`
55 event so you know when something changed.
56
57 Applications can make use of the :ref:`input-capabilities` and
58 :ref:`output-capabilities` flags to determine whether the digital
59 video ioctls can be used with the given input or output.
60

3. 한국어 전문 번역

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

Digital interface timing 모델

1-24

기존 video standard는 Analog TV와 그 timing을 다뤘습니다. 오늘날에는 HDMI, VGA, DVI connector처럼 video signal을 전달하는 hardware interface가 훨씬 다양하므로 이 interface들의 video timing을 선택하도록 API를 확장해야 합니다.

사용 가능한 bit가 제한된 `v4l2_std_id`를 확장할 수 없기 때문에 input과 output의 video timing을 설정·조회하는 새 ioctl 집합이 추가됐습니다.

DV timing은 active video width·height, signal polarity, front porch, back porch, sync width 등 각 digital video format의 세부 timing parameter를 정의합니다.

`linux/v4l2-dv-timings.h` header에서 `CEA-861`과 `VESA DMT` standard format의 timing을 얻을 수 있습니다.

DV timing 구성요소
항목설명
Active areaVideo width와 height
SignalHorizontal/vertical polarity
BlankingFront porch와 back porch
SynchronizationSync width
Standard tablesCEA-861, VESA DMT

Digital video format을 식별하는 주요 parameter입니다.

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

.. _dv-timings:

**************************
Digital Video (DV) Timings
**************************

The video standards discussed so far have been dealing with Analog TV
and the corresponding video timings. Today there are many more different
hardware interfaces such as High Definition TV interfaces (HDMI), VGA,
DVI connectors etc., that carry video signals and there is a need to
extend the API to select the video timings for these interfaces. Since
it is not possible to extend the :ref:`v4l2_std_id <v4l2-std-id>`
due to the limited bits available, a new set of ioctls was added to
set/get video timings at the input and output.

These ioctls deal with the detailed digital video timings that define
each video format. This includes parameters such as the active video
width and height, signal polarities, frontporches, backporches, sync
widths etc. The ``linux/v4l2-dv-timings.h`` header can be used to get
the timings of the formats in the :ref:`cea861` and :ref:`vesadmt`
standards.

DV timing 열거·설정·탐지

25-35

장치가 지원하는 DV timing과 attribute는 `VIDIOC_ENUM_DV_TIMINGS`, `VIDIOC_DV_TIMINGS_CAP`으로 열거·조회합니다.

장치 timing 설정은 `VIDIOC_S_DV_TIMINGS`, 현재 설정 조회는 `VIDIOC_G_DV_TIMINGS`, video receiver가 실제로 보고 있는 timing 탐지는 `VIDIOC_QUERY_DV_TIMINGS`를 사용합니다.

DV timing ioctl
항목설명
VIDIOC_ENUM_DV_TIMINGS지원 DV timing 열거
VIDIOC_DV_TIMINGS_CAP지원 timing attribute/capability 조회
VIDIOC_S_DV_TIMINGS장치 DV timing 설정
VIDIOC_G_DV_TIMINGS현재 설정된 DV timing 조회
VIDIOC_QUERY_DV_TIMINGSReceiver가 실제 탐지한 DV timing 조회

지원 범위, 설정 상태와 실제 signal 탐지를 구분합니다.

To enumerate and query the attributes of the DV timings supported by a
device applications use the
:ref:`VIDIOC_ENUM_DV_TIMINGS` and
:ref:`VIDIOC_DV_TIMINGS_CAP` ioctls. To set
DV timings for the device applications use the
:ref:`VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl and to get
current DV timings they use the
:ref:`VIDIOC_G_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>` ioctl. To detect
the DV timings as seen by the video receiver applications use the
:ref:`VIDIOC_QUERY_DV_TIMINGS` ioctl.

Source-change event와 재협상

36-59

Hardware가 video signal의 출현·소멸 또는 resolution 변경 같은 source change를 탐지하면 `V4L2_EVENT_SOURCE_CHANGE` event를 발행합니다. `VIDIOC_SUBSCRIBE_EVENT`로 구독하고 `VIDIOC_DQEVENT`로 보고 여부를 확인합니다.

Video signal이 바뀌면 application은 streaming을 중지하고 모든 buffer를 해제한 뒤 `VIDIOC_QUERY_DV_TIMINGS`로 새 timing을 얻습니다. Timing이 valid하면 `VIDIOC_S_DV_TIMINGS`로 적용합니다.

S_DV_TIMINGS는 format도 갱신하므로 `VIDIOC_G_FMT`로 새 format을 얻어야 합니다. 그 다음 새 buffer를 할당하고 streaming을 다시 시작할 수 있습니다.

`VIDIOC_QUERY_DV_TIMINGS`는 hardware가 탐지한 내용을 보고만 하며 configuration을 절대 변경하지 않습니다. 현재 설정 timing과 실제 탐지 timing이 다르면 보통 video capture가 불가능합니다. 따라서 change detection은 `V4L2_EVENT_SOURCE_CHANGE`에 의존해야 합니다.

Application은 `input-capabilities`와 `output-capabilities` flag로 선택한 input 또는 output에서 digital video ioctl을 사용할 수 있는지 판단합니다.

DV source-change 복구
V4L2_EVENT_SOURCE_CHANGE 수신Streaming 중지모든 기존 buffer 해제VIDIOC_QUERY_DV_TIMINGS로 실제 timing 탐지Timing validity 확인VIDIOC_S_DV_TIMINGS로 적용VIDIOC_G_FMT로 갱신된 format 조회새 format에 맞춰 buffer 할당Streaming 재시작

Signal timing이 바뀐 뒤 format과 buffer를 안전하게 다시 구성합니다.

설정 timing과 탐지 timing
항목설명
G_DV_TIMINGS현재 device configuration
QUERY_DV_TIMINGSReceiver가 실제 signal에서 탐지한 timing; read-only
두 값 불일치일반적으로 video capture 불가
변경 통지V4L2_EVENT_SOURCE_CHANGE

두 상태의 역할을 혼동하면 capture가 실패할 수 있습니다.

When the hardware detects a video source change (e.g. the video
signal appears or disappears, or the video resolution changes), then
it will issue a `V4L2_EVENT_SOURCE_CHANGE` event. Use the
:ref:`ioctl VIDIOC_SUBSCRIBE_EVENT <VIDIOC_SUBSCRIBE_EVENT>` and the
:ref:`VIDIOC_DQEVENT` to check if this event was reported.

If the video signal changed, then the application has to stop
streaming, free all buffers, and call the :ref:`VIDIOC_QUERY_DV_TIMINGS`
to obtain the new video timings, and if they are valid, it can set
those by calling the :ref:`ioctl VIDIOC_S_DV_TIMINGS <VIDIOC_G_DV_TIMINGS>`.
This will also update the format, so use the :ref:`ioctl VIDIOC_G_FMT <VIDIOC_G_FMT>`
to obtain the new format. Now the application can allocate new buffers
and start streaming again.

The :ref:`VIDIOC_QUERY_DV_TIMINGS` will just report what the
hardware detects, it will never change the configuration. If the
currently set timings and the actually detected timings differ, then
typically this will mean that you will not be able to capture any
video. The correct approach is to rely on the `V4L2_EVENT_SOURCE_CHANGE`
event so you know when something changed.

Applications can make use of the :ref:`input-capabilities` and
:ref:`output-capabilities` flags to determine whether the digital
video ioctls can be used with the given input or output.