요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
======================================================
Infrared remote control support in video4linux drivers
======================================================
Authors: Gerd Hoffmann, Mauro Carvalho Chehab
Basics
======
Most analog and digital TV boards support remote controllers. Several of
them have a microprocessor that receives the IR carriers, convert into
pulse/space sequences and then to scan codes, returning such codes to
userspace ("scancode mode"). Other boards return just the pulse/space
sequences ("raw mode").
The support for remote controller in scancode mode is provided by the
standard Linux input layer. The support for raw mode is provided via LIRC.
In order to check the support and test it, it is suggested to download
the `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_. It provides
two tools to handle remote controllers:
- ir-keytable: provides a way to query the remote controller, list the
protocols it supports, enable in-kernel support for IR decoder or
switch the protocol and to test the reception of scan codes;
- ir-ctl: provide tools to handle remote controllers that support raw mode
via LIRC interface.
Usually, the remote controller module is auto-loaded when the TV card is
detected. However, for a few devices, you need to manually load the
ir-kbd-i2c module.
How it works
============
The modules register the remote as keyboard within the linux input
layer, i.e. you'll see the keys of the remote as normal key strokes
(if CONFIG_INPUT_KEYBOARD is enabled).
Using the event devices (CONFIG_INPUT_EVDEV) it is possible for
applications to access the remote via /dev/input/event<n> devices.
The udev/systemd will automatically create the devices. If you install
the `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_, it may also
automatically load a different keytable than the default one. Please see
`v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ ir-keytable.1
man page for details.
The ir-keytable tool is nice for trouble shooting, i.e. to check
whenever the input device is really present, which of the devices it
is, check whenever pressing keys on the remote actually generates
events and the like. You can also use any other input utility that changes
the keymaps, like the input kbd utility.
Using with lircd
----------------
The latest versions of the lircd daemon supports reading events from the
linux input layer (via event device). It also supports receiving IR codes
in lirc mode.
Using without lircd
-------------------
Xorg recognizes several IR keycodes that have its numerical value lower
than 247. With the advent of Wayland, the input driver got updated too,
and should now accept all keycodes. Yet, you may want to just reassign
the keycodes to something that your favorite media application likes.
This can be done by setting
`v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ to load your own
keytable in runtime. Please read ir-keytable.1 man page for details.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
Video4Linux IR remote 지원
1-8이 문서는 GPL-2.0 라이선스를 따르며 Video4Linux driver의 infrared remote control 지원을 설명합니다. 저자는 Gerd Hoffmann과 Mauro Carvalho Chehab입니다.
기본 동작
9-20대부분의 analog/digital TV board는 remote controller를 지원합니다. 일부 board의 microprocessor는 IR carrier를 받아 pulse/space sequence로 변환한 뒤 scan code로 바꾸어 userspace에 반환합니다. 이를 `scancode mode`라고 합니다. 다른 board는 pulse/space sequence만 반환하며, 이를 `raw mode`라고 합니다.
| Mode | Board가 반환하는 정보 | Kernel interface |
|---|---|---|
| Scancode mode | Board microprocessor가 IR carrier를 pulse/space sequence와 scan code로 변환 | Standard Linux input layer |
| Raw mode | Board가 pulse/space sequence만 반환 | LIRC interface |
Scancode mode의 remote controller 지원은 standard Linux input layer가 제공하고, raw mode 지원은 LIRC를 통해 제공됩니다.
지원 확인 도구와 module loading
21-35지원 여부를 확인하고 시험하려면 v4l-utils(https://git.linuxtv.org/v4l-utils.git/)를 내려받는 것이 좋습니다. 이 package는 remote controller용 도구 두 개를 제공합니다.
- `ir-keytable`: remote controller를 query하고, 지원 protocol을 나열하며, in-kernel IR decoder 지원을 enable하거나 protocol을 전환하고, scan code 수신을 시험합니다.
- `ir-ctl`: LIRC interface를 통해 raw mode를 지원하는 remote controller를 다룹니다.
보통 remote controller module은 TV card를 감지할 때 자동으로 load됩니다. 그러나 일부 device에서는 `ir-kbd-i2c` module을 수동으로 load해야 합니다.
Linux input layer에서의 동작
36-55Module은 remote를 Linux input layer의 keyboard로 등록합니다. 따라서 `CONFIG_INPUT_KEYBOARD`가 enable되어 있으면 remote key가 일반 key stroke로 나타납니다.
`CONFIG_INPUT_EVDEV`의 event device를 사용하면 application은 `/dev/input/event<n>` device를 통해 remote에 접근할 수 있습니다. udev/systemd가 이 device를 자동으로 생성합니다.
v4l-utils(https://git.linuxtv.org/v4l-utils.git/)를 설치하면 default keytable과 다른 keytable을 자동으로 load할 수도 있습니다. 자세한 내용은 v4l-utils의 `ir-keytable.1` man page를 참고하십시오.
`ir-keytable`은 input device가 실제로 존재하는지, 여러 device 중 어느 것인지, remote key를 눌렀을 때 event가 생성되는지 등을 확인하는 troubleshooting에 유용합니다. `input kbd` utility처럼 keymap을 변경하는 다른 input utility도 사용할 수 있습니다.
lircd와 함께 사용
56-64최신 `lircd` daemon은 event device를 통해 Linux input layer의 event를 읽을 수 있으며, lirc mode의 IR code 수신도 지원합니다.
lircd 없이 사용
65-76Xorg는 numerical value가 247보다 작은 여러 IR keycode를 인식합니다. Wayland의 등장과 함께 input driver도 갱신되어 이제 모든 keycode를 받아야 합니다. 그래도 선호하는 media application에 맞도록 keycode를 다시 할당할 수 있습니다.
Runtime에 자체 keytable을 load하도록 v4l-utils(https://git.linuxtv.org/v4l-utils.git/)를 설정하면 됩니다. 자세한 내용은 `ir-keytable.1` man page를 참고하십시오.
IR event 경로
remote-controller.rst:1-76Board가 scan code까지 decode하면 Linux input layer가 keyboard/event device로 전달하고, pulse/space sequence만 제공하면 LIRC가 raw mode를 처리합니다. `ir-keytable`은 protocol과 keymap을, `ir-ctl`은 raw LIRC device를 다룹니다.