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