Distribution Guide
Device drivers
Linux Infrared Remote Control (LIRC) driver
|
|
Linux Infrared Remote Control (LIRC) driver
LIRC is a package that enables the receipt, decoding and transmission of the infrared (IR) signals used by common remote control devices.
The software consists of a number of parts:
- a kernel device driver for controlling the IR hardware,
- a kernel driver independent of the hardware devices which provides a consistent LIRC subsystem interface,
- an
lircd daemon which receives raw data from the kernel device driver and decodes it to indicate which remote control button was pressed, and also encodes a remote control command in a form suitable to be sent to the kernel driver for transmission,
- a user-level application which communicates with
lircd using a socket-level interface.
Detailed information on the LIRC project can be found at the official LIRC web site.
Driver model
Supported platforms
| Platform |
IRB-RX capability |
UHF-RX capability |
IRB-TX capability |
| STb7100-Mboard (mb411) |
Yes |
Yes |
Yes |
| STb7100/9-ref (mb442) |
Yes |
Yes CN9 8-10 fitted |
No |
| STx7200-Mboard (mb519+mb520) |
Yes J65 1-2 fitted J66 2-3 fitted |
Yes J65 1-2 fitted J66 1-2 fitted |
Yes J68 1-2 fitted |
| STx7111-Mboard (mb618) |
Yes |
No |
Yes |
Supported remote controls
The STMicroelectronics' LIRC driver passes received raw IR pulse/space data to the lircd daemon and transmits raw IR pulse/space data supplied by the lircd daemon. The protocols which are supported are determined by the daemon.
LIRC includes support for all the standard remote control (RC) protocols. These include Philips RC4/5/6, Sony, PECS80, and pulse width encoded. Remote control commands can also be supplied to LIRC using raw pulse/space timing information, so less common protocols, such as that used by the Futarque RC, can be supported easily.
A large number of lircd remote control description files can be found at www.lirc.org/remotes.
Installing LIRC
Configuring the kernel
The LIRC kernel driver is enabled to be built-in by default on all supported platforms for both the ST40 and ST231. Note that the default mode is IRB. The UHF driver support option can be selected using the kernel configuration menus:
-
Device Drivers ---> Character devices ---> Linux InfraRed Controller ---> STM Lirc support ---> UHF Receiver mode
If the LIRC transmit capability is supported by the hardware it is enabled by default.
The LIRC driver can also be built as a module. In this case the module parameter ir_uhf_switch=1 can be supplied to enable UHF mode. By default, the module uses IRB mode.
If required, the LIRC device node can be built manually. It is normally included automatically if the stlinuxX.X-...-makedev package is installed or if udev is being used. Create the lirc device in your target filesystem using:
target# mknod -m 666 /dev/lirc0 c 61 0
target# ln -s /dev/lirc0 /dev/lirc |
|
|
Installing the userspace components
Ensure that the LIRC user application package stlinuxX.X-...-lirc-apps-.rpm is installed. This package contains target versions of lircd and some configuration and test applications. It also installs a default remote control configuration file in /etc/lircd.conf for the Futarque remote control, and sets up an init script on the target that starts lircd during target boot time.
Online documentation on all the LIRC userspace components can be found on the LIRC website.
Testing LIRC
Testing LIRC Receive
The LIRC driver can be tested by using the mode2 application. When this is run on the target, every time a button is pressed on any type of remote control, raw IR pulse/space timings should be displayed on the command line.
The mode2 application does not use the lircd daemon, so it is a good test of the driver. It can also be used to generate raw mode RC configuration files by using the -m option.
Once the LIRC driver is known to be working, the irw application can be used to test lircd. This application uses lircd, and so the daemon must be running and a remote control configuration file must be installed in /etc/lircd.conf.
irw displays the decoded RC button name when a known RC is pointed at the IR receiver and a button is pressed. As well as testing lircd, the irw application provides a good method for testing RC configuration files.
If the /etc/lircd.conf file is changed, or the following error messages are displayed:
-
irw: could not connect to socket irw: Connection refused
then (re)start the lircd daemon using:
target# /etc/init.d/lircd restart |
|
|
Testing LIRC transmit
To test the LIRC transmit system, an IR receive device or appliance and a suitable RC configuration file must be available. The LIRC receive system should also be working as described above.
LIRC can then be used to transmit RC button codes using the irsend application. For example, the action of pressing button <button> on the RC for the test device should be imitated by typing:
target# irsend SEND_ONCE <button> |
|
|
<button> must be defined in the /etc/lircd.conf configuration file.
If the following error messages are displayed:
-
irsend: could not connect to socket irsend: Connection refused
then you must (re)start the lircd daemon as show above.
|