2018-08-30 22:20:04 +08:00
|
|
|
.. SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
2020-04-18 17:59:24 +08:00
|
|
|
======================================================
|
2016-07-18 09:34:51 +08:00
|
|
|
Infrared remote control support in video4linux drivers
|
2005-04-17 06:20:36 +08:00
|
|
|
======================================================
|
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
Authors: Gerd Hoffmann, Mauro Carvalho Chehab
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:11:47 +08:00
|
|
|
Basics
|
2020-04-18 17:59:24 +08:00
|
|
|
======
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
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").
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
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.
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
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:
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
- 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;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
- 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.
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:11:47 +08:00
|
|
|
How it works
|
2020-04-18 17:59:24 +08:00
|
|
|
============
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
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.
|
2016-07-18 09:34:51 +08:00
|
|
|
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.
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
The ir-keytable tool is nice for trouble shooting, i.e. to check
|
2005-04-17 06:20:36 +08:00
|
|
|
whenever the input device is really present, which of the devices it
|
|
|
|
is, check whenever pressing keys on the remote actually generates
|
2016-07-18 09:34:51 +08:00
|
|
|
events and the like. You can also use any other input utility that changes
|
|
|
|
the keymaps, like the input kbd utility.
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
|
2016-07-18 09:11:47 +08:00
|
|
|
Using with lircd
|
2020-04-18 17:59:24 +08:00
|
|
|
----------------
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
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.
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
|
2016-07-18 09:11:47 +08:00
|
|
|
Using without lircd
|
2020-04-18 17:59:24 +08:00
|
|
|
-------------------
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
Xorg recognizes several IR keycodes that have its numerical value lower
|
|
|
|
than 247. With the advent of Wayland, the input driver got updated too,
|
Documentation: fix multiple typos found in the admin-guide subdirectory
Fix thirty five typos in dm-integrity.rst, dm-raid.rst, dm-zoned.rst,
verity.rst, writecache.rst, tsx_async_abort.rst, md.rst, bttv.rst,
dvb_references.rst, frontend-cardlist.rst, gspca-cardlist.rst, ipu3.rst,
remote-controller.rst, mm/index.rst, numaperf.rst, userfaultfd.rst,
module-signing.rst, imx-ddr.rst, intel-speed-select.rst,
intel_pstate.rst, ramoops.rst, abi.rst, kernel.rst, vm.rst
Signed-off-by: Andrew Klychkov <andrew.a.klychkov@gmail.com>
Link: https://lore.kernel.org/r/20201204072848.GA49895@spblnx124.lan
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2020-12-04 15:28:48 +08:00
|
|
|
and should now accept all keycodes. Yet, you may want to just reassign
|
2016-07-18 09:34:51 +08:00
|
|
|
the keycodes to something that your favorite media application likes.
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2016-07-18 09:34:51 +08:00
|
|
|
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.
|