Installation

First install LIRC with pacman:

# pacman -S lirc

This will also install the lirc-utils package as a dependency.

Serial receivers

Now there might be a problem: the module lirc_serial is build to use ttyS0 (COM1), if your device is not connected to ttyS0, you will have to either change the module-options or rebuild the LIRC module. If your device is connected to ttyS0, you can skip this step

To change the options for the lirc_serial module, you edit Template:Filename and add this line:

options lirc_serial io=0x2f8 irq=3

You should change the values after io and irq to reflect you serial port settings, the values above may work for you if you are using ttyS1 (COM2) to connect your IR-device. But you will find the correct values by checking dmesg:

Loading

Now try to load the serial module:

# modprobe lirc_serial

If this produces an error which says your serial port is not ready, you have the problem that your serial port support is build into the kernel and not as a module (in the default arch kernel it is build into the kernel)

If it is built into the kernel you will have to do the following (remember that it is built into the kernel, you will need to make some changes later too)

You will have to release the serial port:

# setserial /dev/ttySx uart none

(Replace x with your port number)

Load the module again:

# modprobe lirc_serial

Now it should not show any errors, and the modules lirc_serial should be listed in lsmod

USB receivers including most onboard devices

This outlines the general procedure, the mceusb module which is used by many devices is used as an example.

# modprobe mceusb

Start the LIRC daemon:

$ /etc/rc.d/lircd start

Test it with irw, it will output the commands received by the IR receiver that match your Template:Filename file. So start irw, point your remote and start pressing buttons.

The above procedure however has been simplified and may not work that easily. One of the reasons the lircd daemon may not be working is because it expects to be run at startup and needs root permissions because it will create device nodes in Template:Filename. Try "man lircd" for more information.

Setup a HID device with LIRC

Some remotes are supported in the kernel where they are treated as a keyboard and mouse. Every button on the device is recognized as keyboard or mouse events which can be used even without LIRC. LIRC can still be used with these devices to gain greater control over the events raised and integrate with programs that expect a LIRC remote rather than a keyboard. As drivers are migrated to the kernel, devices which use to only be useable through LIRC with their own Template:Filename files become standard HID devices.

Some HID remotes actually simulate a USB infrared keyboard and mouse. These remotes show up as two devices so you need to add two LIRC devices to Template:Filename.

Making a configuration file

You need a configuration file for your remote control copied or symlinked to Template:Filename. A number of devices have already been included with the lirc package, they can be found in Template:Filename. If your specific device is not included, the LIRC site offers configuration files for a large number of extra devices.

If your device does not already have a config file, you can create it yourself with the command:

# irrecord -d /dev/lirc0 /tmp/my_remote

Just follow the instructions. The resulting file, Template:Filename, should then be copied to Template:Filename. If you want to use several remotes, you repeat the irrecord step with each remote and different filenames, and then concatenate all the resulting files into Template:Filename:

Now load the daemons: add "start_lirc" and "lircd" to the daemons list in Template:Filename

Program specific configuration

Generate your own lircrc with Mythbuntu's lircrc-generator

mythbuntu-lircrc-generator is intended to be started from a system with LIRC installed. It requires that you choose a remote via the LIRC package or have a Template:Filename handy prior to running. It will then produce a sane Template:Filename for the current user.

Enable LIRC support in xine

Now LIRC works, but you have no program that can communicate with LIRC. This section will explain how to make xine work, but you can use xmms and mplayer (and probably a lot of other programs too) to work with LIRC.

Configure xine to use LIRC

Now, in order to have a functioning xine+lirc, edit the Template:Filename file to your preferences.

However, you may choose to configure LIRC to control more than just xine. If this is the case, you will need to manually edit the Template:Filename file, and add elements.

Xine-ui
Mplayer
Totem
Vlc
Rhythmbox

All work with LIRC, but you must enable LIRC support in the program in some cases, such as VLC. Simply copy the vlc packagebuild and edit it so that "--enable-lirc" is one of the compile options for VLC not FFMPEG!

Configure Amarok2 to use LIRC

Depending on your controller model, the following configuration works with Amarok2-svn. This configuration file will work with the MCEUSB controller.

Troubleshooting

Buttons processed several times when pressed

If you use an MCEUSB remote this bug could also cause most presses to be registered twice. Confirm with:

echo none +lirc > /sys/class/rc/rc0/protocols

This fix, however, is wiped at boot. Fix this by either adding the line to an /etc/rc.d/ script (I use lircd) or write another one that is called at boot time.

Note that any changes to an existing /etc/rc.d init script might be overwritten when the packages providing them are updated or removed.

After upgrading or installing Arch, an existing configuration stopped working

Kernel module change

As of kernel 2.6.36, LIRC modules have been included in the kernel. Arch's lirc package has included the older kernel modules, which work with lircd without any additional configuration. However, a recent update removed those older modules, which results in the stock kernel modules being used. Unfortunately, these kernel modules treat the remote as a keyboard by default, which is incompatible for lircd. To correct this, put the following line to Template:Filename:
Template:File
You may also run that command as root to enable LIRC for your current session.

Note: It is also a good idea to remove the old LIRC kernel module from your MODULES array in Template:Filename, as it is no longer present.