From VDR Wiki
Revision as of 19:29, 28 December 2022 by Dr-m (talk | contribs) (Move some content to the new page Raspberry Pi)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


LIRC (Linux Infrared Remote Control) is a software to control ones computer through nearly every (unused) remote control. Therefore a small electronic device is necessary. You can buy one for ca. 15 Euro, or you can build your own. It consists of only a few components and schematics are on the LIRC homepage.


Kernel driver /dev/lirc* and ir-keytable

LIRC was initially developed as a user-space driver based on various bit-banging interfaces, such as some flow control lines of RS-232 interfaces. The Linux kernel also includes drivers on its own that can directly interface with various types of hardware. The Linux kernel driver includes both an input event driver (similar to a keyboard) and a lower-level /dev/lirc* driver. The driver can be configured by installing the package ir-keytable and editing the file /etc/rc_maps.cfg.

The sophisticated LIRC_MODE_SCANCODE mode that was introduced in Linux 4.16 includes both timing information, raw scancodes and decoded keycodes. It is supported by VDR since version 2.6.2: vdr --no-kbd --lirc=/dev/lirc0. The earliest Linux kernel version where it was confirmed to work is 5.10. On Linux 5.4 on a 32-bit ARM system (Raspberry Pi), the interface would not deliver any data in this mode.

For example, to use the remote control unit of an old Hauppauge tuner, you can add the following line to /etc/rc_maps.cfg:

* * hauppauge.toml

You can test it with the following command:

ir-keytable -t

Cable length

The length of the cable between receiver and computer can be up to 25m.

Parallel operation of two LIRC receiver

It is possible to operate LIRC with two infrared receiver devices at one COM port. But not independently from one another, only in parallel.

                 o +12V 
                | | 10k
                | |
Output 1         |   Input
Output 2         |

Ground               Ground


[1] LIRC project homepage
[2] Detailed construction manual with source for a complete infrared receiver
[3] Commercial infrared receiver (~ 14 Euro)