remote-controller.rst 2.9 KB

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