요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
The ivtv driver
===============
Author: Hans Verkuil <hverkuil@kernel.org>
This is a v4l2 device driver for the Conexant cx23415/6 MPEG encoder/decoder.
The cx23415 can do both encoding and decoding, the cx23416 can only do MPEG
encoding. Currently the only card featuring full decoding support is the
Hauppauge PVR-350.
.. note::
#) This driver requires the latest encoder firmware (version 2.06.039, size
376836 bytes). Get the firmware from here:
https://linuxtv.org/downloads/firmware/#conexant
#) 'normal' TV applications do not work with this driver, you need
an application that can handle MPEG input such as mplayer, xine, MythTV,
etc.
The primary goal of the IVTV project is to provide a "clean room" Linux
Open Source driver implementation for video capture cards based on the
iCompression iTVC15 or Conexant CX23415/CX23416 MPEG Codec.
Features
--------
* Hardware mpeg2 capture of broadcast video (and sound) via the tuner or
S-Video/Composite and audio line-in.
* Hardware mpeg2 capture of FM radio where hardware support exists
* Supports NTSC, PAL, SECAM with stereo sound
* Supports SAP and bilingual transmissions.
* Supports raw VBI (closed captions and teletext).
* Supports sliced VBI (closed captions and teletext) and is able to insert
this into the captured MPEG stream.
* Supports raw YUV and PCM input.
Additional features for the PVR-350 (CX23415 based)
---------------------------------------------------
* Provides hardware mpeg2 playback
* Provides comprehensive OSD (On Screen Display: ie. graphics overlaying the
video signal)
* Provides a framebuffer (allowing X applications to appear on the video
device)
* Supports raw YUV output.
IMPORTANT: In case of problems first read this page:
https://help.ubuntu.com/community/Install_IVTV_Troubleshooting
See also
--------
https://linuxtv.org
IRC
---
irc://irc.freenode.net/#v4l
----------------------------------------------------------
Devices
-------
A maximum of 12 ivtv boards are allowed at the moment.
Cards that don't have a video output capability (i.e. non PVR350 cards)
lack the vbi8, vbi16, video16 and video48 devices. They also do not
support the framebuffer device /dev/fbx for OSD.
The radio0 device may or may not be present, depending on whether the
card has a radio tuner or not.
Here is a list of the base v4l devices:
.. code-block:: none
crw-rw---- 1 root video 81, 0 Jun 19 22:22 /dev/video0
crw-rw---- 1 root video 81, 16 Jun 19 22:22 /dev/video16
crw-rw---- 1 root video 81, 24 Jun 19 22:22 /dev/video24
crw-rw---- 1 root video 81, 32 Jun 19 22:22 /dev/video32
crw-rw---- 1 root video 81, 48 Jun 19 22:22 /dev/video48
crw-rw---- 1 root video 81, 64 Jun 19 22:22 /dev/radio0
crw-rw---- 1 root video 81, 224 Jun 19 22:22 /dev/vbi0
crw-rw---- 1 root video 81, 228 Jun 19 22:22 /dev/vbi8
crw-rw---- 1 root video 81, 232 Jun 19 22:22 /dev/vbi16
Base devices
------------
For every extra card you have the numbers increased by one. For example,
/dev/video0 is listed as the 'base' encoding capture device so we have:
- /dev/video0 is the encoding capture device for the first card (card 0)
- /dev/video1 is the encoding capture device for the second card (card 1)
- /dev/video2 is the encoding capture device for the third card (card 2)
Note that if the first card doesn't have a feature (eg no decoder, so no
video16, the second card will still use video17. The simple rule is 'add
the card number to the base device number'. If you have other capture
cards (e.g. WinTV PCI) that are detected first, then you have to tell
the ivtv module about it so that it will start counting at 1 (or 2, or
whatever). Otherwise the device numbers can get confusing. The ivtv
'ivtv_first_minor' module option can be used for that.
- /dev/video0
The encoding capture device(s).
Read-only.
Reading from this device gets you the MPEG1/2 program stream.
Example:
.. code-block:: none
cat /dev/video0 > my.mpg (you need to hit ctrl-c to exit)
- /dev/video16
The decoder output device(s)
Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
An mpeg2 stream sent to this device will appear on the selected video
display, audio will appear on the line-out/audio out. It is only
available for cards that support video out. Example:
.. code-block:: none
cat my.mpg >/dev/video16
- /dev/video24
The raw audio capture device(s).
Read-only
The raw audio PCM stereo stream from the currently selected
tuner or audio line-in. Reading from this device results in a raw
(signed 16 bit Little Endian, 48000 Hz, stereo pcm) capture.
This device only captures audio. This should be replaced by an ALSA
device in the future.
Note that there is no corresponding raw audio output device, this is
not supported in the decoder firmware.
- /dev/video32
The raw video capture device(s)
Read-only
The raw YUV video output from the current video input. The YUV format
is a 16x16 linear tiled NV12 format (V4L2_PIX_FMT_NV12_16L16)
Note that the YUV and PCM streams are not synchronized, so they are of
limited use.
- /dev/video48
The raw video display device(s)
Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
Writes a YUV stream to the decoder of the card.
- /dev/radio0
The radio tuner device(s)
Cannot be read or written.
Used to enable the radio tuner and tune to a frequency. You cannot
read or write audio streams with this device. Once you use this
device to tune the radio, use /dev/video24 to read the raw pcm stream
or /dev/video0 to get an mpeg2 stream with black video.
- /dev/vbi0
The 'vertical blank interval' (Teletext, CC, WSS etc) capture device(s)
Read-only
Captures the raw (or sliced) video data sent during the Vertical Blank
Interval. This data is used to encode teletext, closed captions, VPS,
widescreen signalling, electronic program guide information, and other
services.
- /dev/vbi8
Processed vbi feedback device(s)
Read-only. Only present if the MPEG decoder (i.e. CX23415) exists.
The sliced VBI data embedded in an MPEG stream is reproduced on this
device. So while playing back a recording on /dev/video16, you can
read the embedded VBI data from /dev/vbi8.
- /dev/vbi16
The vbi 'display' device(s)
Write-only. Only present if the MPEG decoder (i.e. CX23415) exists.
Can be used to send sliced VBI data to the video-out connector.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
ivtv 드라이버
1-11이 문서는 GPL-2.0 라이선스를 따르며, 저자는 Hans Verkuil <hverkuil@kernel.org>입니다.
`ivtv`는 Conexant `cx23415/6` MPEG encoder/decoder를 위한 V4L2 장치 드라이버입니다. `cx23415`는 encoding과 decoding을 모두 수행할 수 있지만 `cx23416`은 MPEG encoding만 지원합니다. 현재 완전한 decoding 지원을 제공하는 카드는 Hauppauge PVR-350뿐입니다.
Firmware와 응용 프로그램 요구 사항
12-27이 드라이버에는 최신 encoder firmware, 즉 version `2.06.039`, 크기 `376836 bytes`인 파일이 필요합니다. Firmware는 https://linuxtv.org/downloads/firmware/#conexant 에서 받을 수 있습니다.
일반적인 TV 응용 프로그램은 이 드라이버와 함께 동작하지 않습니다. `mplayer`, `xine`, `MythTV`처럼 MPEG 입력을 처리할 수 있는 응용 프로그램이 필요합니다.
IVTV 프로젝트의 주된 목표는 iCompression `iTVC15` 또는 Conexant `CX23415/CX23416` MPEG Codec 기반 video capture card를 위한 깨끗한 방인식(clean-room) Linux Open Source 드라이버 구현을 제공하는 것입니다.
기능
28-40- Tuner 또는 S-Video/Composite와 audio line-in을 통한 broadcast video 및 sound의 hardware MPEG-2 capture
- Hardware가 지원하는 경우 FM radio의 hardware MPEG-2 capture
- Stereo sound를 포함한 NTSC, PAL, SECAM 지원
- SAP와 bilingual transmission 지원
- Closed caption과 teletext를 위한 raw VBI 지원
- Closed caption과 teletext를 위한 sliced VBI 지원 및 capture된 MPEG stream 안으로 삽입하는 기능
- Raw YUV와 PCM input 지원
PVR-350의 추가 기능
41-53CX23415 기반 PVR-350은 다음과 같은 추가 기능을 제공합니다.
- Hardware MPEG-2 playback
- Video signal 위에 graphics를 겹치는 포괄적인 OSD(On Screen Display)
- X application이 video device에 나타날 수 있게 하는 framebuffer
- Raw YUV output
문제가 생기면 먼저 https://help.ubuntu.com/community/Install_IVTV_Troubleshooting 페이지를 읽으십시오.
관련 자료와 IRC
54-64장치
65-91현재 허용되는 `ivtv` board 수는 최대 12개입니다.
Video output 기능이 없는 카드, 즉 PVR-350이 아닌 카드는 `vbi8`, `vbi16`, `video16`, `video48` 장치가 없습니다. 또한 OSD용 framebuffer 장치 `/dev/fbx`도 지원하지 않습니다.
`radio0` 장치는 카드에 radio tuner가 있는지에 따라 존재할 수도 있고 없을 수도 있습니다.
기본 V4L 장치 목록은 다음과 같습니다.
crw-rw---- 1 root video 81, 0 Jun 19 22:22 /dev/video0
crw-rw---- 1 root video 81, 16 Jun 19 22:22 /dev/video16
crw-rw---- 1 root video 81, 24 Jun 19 22:22 /dev/video24
crw-rw---- 1 root video 81, 32 Jun 19 22:22 /dev/video32
crw-rw---- 1 root video 81, 48 Jun 19 22:22 /dev/video48
crw-rw---- 1 root video 81, 64 Jun 19 22:22 /dev/radio0
crw-rw---- 1 root video 81, 224 Jun 19 22:22 /dev/vbi0
crw-rw---- 1 root video 81, 228 Jun 19 22:22 /dev/vbi8
crw-rw---- 1 root video 81, 232 Jun 19 22:22 /dev/vbi16
| 기본 장치 | 방향 | 주요 역할 | 조건 |
|---|---|---|---|
| /dev/video0 | 읽기 | MPEG-1/2 encoding capture | 항상 |
| /dev/video16 | 쓰기 | MPEG-2 decoder output | CX23415 |
| /dev/video24 | 읽기 | Raw PCM audio capture | 항상 |
| /dev/video32 | 읽기 | Raw YUV video capture | 항상 |
| /dev/video48 | 쓰기 | Raw YUV display | CX23415 |
| /dev/radio0 | 제어 | Radio tuner | Radio tuner 장착 시 |
| /dev/vbi0 | 읽기 | Raw 또는 sliced VBI capture | 항상 |
| /dev/vbi8 | 읽기 | Decoded MPEG의 VBI feedback | CX23415 |
| /dev/vbi16 | 쓰기 | Sliced VBI display | CX23415 |
CX23415/16은 입력을 MPEG stream으로 encoding하며, CX23415 카드만 MPEG 또는 YUV를 video/audio output으로 decoding할 수 있습니다.
기본 장치 번호
92-110카드를 하나 추가할 때마다 기본 장치 번호에 1을 더합니다. 예를 들어 `/dev/video0`이 기본 encoding capture 장치이므로 첫 번째 카드(card 0)는 `/dev/video0`, 두 번째 카드(card 1)는 `/dev/video1`, 세 번째 카드(card 2)는 `/dev/video2`를 사용합니다.
첫 번째 카드에 어떤 기능이 없더라도 번호 규칙은 바뀌지 않습니다. 예를 들어 첫 번째 카드에 decoder가 없어 `video16`이 없더라도 두 번째 카드는 여전히 `video17`을 사용합니다. 간단한 규칙은 '기본 장치 번호에 card 번호를 더한다'입니다.
WinTV PCI 같은 다른 capture card가 먼저 감지되었다면 `ivtv` module이 1, 2 또는 필요한 값부터 세도록 알려야 합니다. 그렇지 않으면 장치 번호가 혼란스러워질 수 있으며, 이때 `ivtv_first_minor` module option을 사용할 수 있습니다.
모든 장치 계열은 고정된 base minor에 card index를 더해 해당 card의 node를 정합니다.
/dev/video0: encoding capture
111-124`/dev/video0` 계열은 encoding capture 장치이며 read-only입니다. 이 장치에서 읽으면 MPEG-1/2 program stream을 얻습니다.
다음 예제는 stream을 `my.mpg`에 저장하며, 종료하려면 Ctrl-C를 누릅니다.
cat /dev/video0 > my.mpg (you need to hit ctrl-c to exit)
/dev/video16: decoder output
125-139`/dev/video16` 계열은 decoder output 장치이며 write-only입니다. MPEG decoder, 즉 `CX23415`가 있을 때만 존재합니다.
이 장치에 보낸 MPEG-2 stream은 선택한 video display에 나타나고 audio는 line-out/audio out으로 출력됩니다. 따라서 video out을 지원하는 카드에서만 사용할 수 있습니다.
cat my.mpg >/dev/video16
/dev/video24: raw audio capture
140-153`/dev/video24` 계열은 raw audio capture 장치이며 read-only입니다. 현재 선택된 tuner 또는 audio line-in에서 raw audio PCM stereo stream을 읽습니다.
읽기 결과는 signed 16-bit Little Endian, 48000 Hz, stereo PCM 형식의 raw capture입니다. 이 장치는 audio만 capture하며 향후 ALSA 장치로 대체되어야 합니다.
이에 대응하는 raw audio output 장치는 없습니다. Decoder firmware가 이 기능을 지원하지 않기 때문입니다.
/dev/video32: raw video capture
154-166`/dev/video32` 계열은 raw video capture 장치이며 read-only입니다. 현재 video input에서 raw YUV video output을 제공합니다.
YUV format은 16x16 linear tiled NV12 형식인 `V4L2_PIX_FMT_NV12_16L16`입니다.
YUV stream과 PCM stream은 동기화되지 않으므로 활용 범위가 제한됩니다.
/dev/video48: raw video display
167-176`/dev/video48` 계열은 raw video display 장치이며 write-only입니다. MPEG decoder, 즉 `CX23415`가 있을 때만 존재하며, 기록한 YUV stream을 카드의 decoder로 보냅니다.
/dev/radio0: radio tuner
177-188`/dev/radio0` 계열은 radio tuner 장치이며 data stream을 읽거나 쓸 수 없습니다. Radio tuner를 활성화하고 주파수를 맞추는 데 사용합니다.
이 장치 자체로 audio stream을 읽거나 쓸 수는 없습니다. Radio를 맞춘 뒤 raw PCM stream은 `/dev/video24`에서 읽고, 검은 video가 포함된 MPEG-2 stream은 `/dev/video0`에서 얻습니다.
/dev/vbi0: VBI capture
189-200`/dev/vbi0` 계열은 vertical blank interval, 즉 teletext, closed caption(CC), WSS 등을 capture하는 read-only 장치입니다.
Vertical Blank Interval 동안 전송되는 raw 또는 sliced video data를 capture합니다. 이 data는 teletext, closed caption, VPS, widescreen signalling, electronic program guide 정보와 그 밖의 service를 encoding하는 데 사용됩니다.
/dev/vbi8: processed VBI feedback
201-211`/dev/vbi8` 계열은 처리된 VBI feedback 장치이며 read-only입니다. MPEG decoder, 즉 `CX23415`가 있을 때만 존재합니다.
MPEG stream에 포함된 sliced VBI data가 이 장치에 재현됩니다. 따라서 `/dev/video16`에서 recording을 재생하는 동안 `/dev/vbi8`에서 내장 VBI data를 읽을 수 있습니다.
/dev/vbi16: VBI display
212-218`/dev/vbi16` 계열은 VBI display 장치이며 write-only입니다. MPEG decoder, 즉 `CX23415`가 있을 때만 존재하며, sliced VBI data를 video-out connector로 보내는 데 사용할 수 있습니다.
ivtv 장치 구조
ivtv.rst:1-218`ivtv`는 CX23415/16 기반 capture card에서 hardware MPEG-2 encoding을 제공하고, CX23415 기반 PVR-350에서는 decoding과 OSD·framebuffer도 제공합니다. 장치 번호는 base minor에 card index를 더하며 각 node의 읽기·쓰기 방향이 고정되어 있습니다.
Encoding, raw capture, decoder playback, VBI 처리는 서로 다른 V4L device node로 노출됩니다.