From ArchWiki
Revision as of 14:27, 9 November 2005 by Mouse256 (Talk | contribs) (first unfinished version)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:LIRC#)


This howto is for using lirc with a serial infrared device


LIRC stands for Linux InfraRed Control, a program to use infrared devices (like your remote control from your TV) with linux.


first install lirc with pacman:

pacman -S lirc

Now there might be a problem: the module lirc_serial is build to use ttyS0, if your device isn't connected to ttySo, you'll have to do the following. If your device is connected to ttyS0, you can skip this step

Building the lirc_serial module for another ttySx

grab the lirc source from the lirc homepage untar the source.



lirc will ask which serial port to use, select the correct one. goto the lirc_serial folder

cd drivers/lirc_serial

make the module


and install the new module

make install

Now you have build and installed the correct module. Remember when pacman ever updates lirc, this module will be overwritten.


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's build into the kernel you'll have to do the following (remember that it is build into the kernel, you will need to make some changes later too)

You'll 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 shouldn't show any errors, and the modules lirc_serial should be listed in lsmod

Making configuration file

You'll need a configuration file for your remote control. The easiest way is to look on the lirc site and hope your device has already a config file: list of remotes on the lirc site

If so, download your file and save it as /etc/lircd.conf

If your device doesn't have already a config file, you'll have to create the file yourself:

(I don't know how you'll have to do this. I created my configfile using winlirc on windows. Please feel free too add this)


First start the lircd deamon:

as root

/etc/rc.d/lircd start

A good way to see if lirc is running is to run irw.


When you press a button, you should get something like this:

0000000000000001 00 play sony2
0000000000000001 01 play sony2
0000000000000001 02 play sony2
0000000000000001 03 play sony2

In this case my remote is called sony2, the button is called play, and lirc has seen it 4 times.

Run lirc at bootup

Remeber if you had to execute the setserial command while [[lirc#loading] the module?

If so, lirc#Your serial port support is compiled into the kernel

Your serial port support is compiled as a module in the kernel

This is rather easy: you'll just have to add lirc_serial to the modules list and lircd to the deamons list in /etc/rc.conf

Your serial port support is compiled into the kernel

This is more complicated, you can't just add the lirc_serial to the modules list in /etc/rc.conf, as the serial port should be released first.

So I created a custom startup script to fix this problem


Compiling Xine with lirc support