1.. SPDX-License-Identifier: GPL-2.0
2
3======================================================
4Infrared remote control support in video4linux drivers
5======================================================
6
7Authors: Gerd Hoffmann, Mauro Carvalho Chehab
8
9Basics
10======
11
12Most analog and digital TV boards support remote controllers. Several of
13them have a microprocessor that receives the IR carriers, convert into
14pulse/space sequences and then to scan codes, returning such codes to
15userspace ("scancode mode"). Other boards return just the pulse/space
16sequences ("raw mode").
17
18The support for remote controller in scancode mode is provided by the
19standard Linux input layer. The support for raw mode is provided via LIRC.
20
21In order to check the support and test it, it is suggested to download
22the `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_. It provides
23two tools to handle remote controllers:
24
25- ir-keytable: provides a way to query the remote controller, list the
26  protocols it supports, enable in-kernel support for IR decoder or
27  switch the protocol and to test the reception of scan codes;
28
29- ir-ctl: provide tools to handle remote controllers that support raw mode
30  via LIRC interface.
31
32Usually, the remote controller module is auto-loaded when the TV card is
33detected. However, for a few devices, you need to manually load the
34ir-kbd-i2c module.
35
36How it works
37============
38
39The modules register the remote as keyboard within the linux input
40layer, i.e. you'll see the keys of the remote as normal key strokes
41(if CONFIG_INPUT_KEYBOARD is enabled).
42
43Using the event devices (CONFIG_INPUT_EVDEV) it is possible for
44applications to access the remote via /dev/input/event<n> devices.
45The udev/systemd will automatically create the devices. If you install
46the `v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_, it may also
47automatically load a different keytable than the default one. Please see
48`v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ ir-keytable.1
49man page for details.
50
51The ir-keytable tool is nice for trouble shooting, i.e. to check
52whenever the input device is really present, which of the devices it
53is, check whenever pressing keys on the remote actually generates
54events and the like.  You can also use any other input utility that changes
55the keymaps, like the input kbd utility.
56
57
58Using with lircd
59----------------
60
61The latest versions of the lircd daemon supports reading events from the
62linux input layer (via event device). It also supports receiving IR codes
63in lirc mode.
64
65
66Using without lircd
67-------------------
68
69Xorg recognizes several IR keycodes that have its numerical value lower
70than 247. With the advent of Wayland, the input driver got updated too,
71and should now accept all keycodes. Yet, you may want to just reasign
72the keycodes to something that your favorite media application likes.
73
74This can be done by setting
75`v4l-utils <https://git.linuxtv.org/v4l-utils.git/>`_ to load your own
76keytable in runtime. Please read  ir-keytable.1 man page for details.
77