Dependencies


To use LIRC's setup.sh script you need the dialog package. It already should be installed on most systems. The setup.sh script makes configuration of LIRC much easier but using it is not obligatory.

If you want to compile and use all tools, you also need an installed svgalib (used by smode2) and the X Windows header files (needed by irxevent and xmode2). You can get svgalib from ftp://sunsite.unc.edu/pub/Linux/libs/graphics/. The configure script will notify you if some necessary files are missing and the according tools won't be compiled.

Irman: To use your Irman with LIRC you need the latest libirman library. At the time this has been written the current libirman version was 0.4.2. Former versions won't work. Please also read Updating from lirc-0.5.4.

Kernel modules: All devices that require a kernel module will need the properly configured kernel sources being available somewhere in /usr/src/. During the build process of this package the kernel Makefile and the current kernel configuration will be used to work around some other problems that would arise if we used our own Makefile. That means that you will have to build your own kernel which is a good idea anyway. Please refer to the documentation of your distribution or read the README file in the kernel source directory to get more information on how to compile and set up an own kernel. More documentation is available at the Linux Documentation Project.

If you want to use a home-brew receiver, an Anir Multimedia Magic or a Packard Bell receiver you will have to compile the Linux serial port driver as a module and you must make sure that the lirc_serial module is loaded before the Linux serial port module. If you don't do this it will work anyway but this approach is begging for hard to trace problems. The same holds if you want to use the SIR IrDA driver except that it will refuse to work if the port is already used by the serial driver.


Supported Hardware


Generally speaking everything that can receive or send infrared signals can be supported by LIRC. The project began with support for home-brew receivers and transmitters for the serial port and later support for analogous hardware for the parallel port was added. At that time the focus of the project was to provide an infrared solution that is both very cheap and easy to assemble. The following links point to instructions how to build your own receiver/transmitter.

Current versions of LIRC now support many more commercially available solutions. Examples are the Irman, built-in IrDA ports or TV cards. Drivers for even more hardware are likely to appear in the future. If you are a programmer who wants to maintain such a driver you are welcome to join the project.


Compiling


Before compiling the binaries you have to choose which driver to use. This can easily be done with the setup.sh script. Just type ./setup.sh from the shell prompt. After selecting your driver you can exit the setup with "Save configuration & run configure".

If you don't have dialog installed you will have to do it the hard way and give the correct parameters to the configure script manually. See ./configure --help for a detailed description of the possible parameters. You will have to at least choose a driver with the --with-driver=X option.

After having configured the package just type make and lean back.

Note: You won't find a configure script in the CVS version of LIRC. You will have to generate it first by executing ./autogen.sh. You need at least libtool-1.3.3, automake-1.4 and autoconf-2.13 to do this properly.


Installation


Installing the compiled programs is really easy, just type make install. All binaries and modules should be installed at the usual places. The necessary devices should be generated in the /dev/ directory and all configuration files should be copied to its proper destination if you happen to use some hardware where configuration files are already available.

The core program of LIRC is lircd, the LIRC system daemon that does all of the decoding of infrared signals. LIRC comes with a second daemon program: lircmd. lircmd depends on lircd and translates remote control activity to mouse movements. Just like all other daemons both lircd and lircmd should be started at system boot time and do their work in background. If you want to start them automatically at boot time you will have to add an init script for them to your system. Unfortunately the syntax and location of this init script is highly dependent on the distribution you use so you will have to figure it out yourself how this works on your system. Good news is that there already are some init scripts available in the contrib/ directory of the LIRC package.

Warning: Never compile daemons with "Disable daemonize" turned on and place them in some init script unless you have a rescue disc nearby...

Now you should adjust the file permissions of /dev/lircd (this is the Unix domain socket that clients use to connect to lircd) so others than root can connect to lircd. You can also create a special group for this purpose.

If your hardware requires a kernel module you should make sure that the kernel will find the correct module if a program tries to access /dev/lirc. This can be done by inserting the following line to your /etc/conf.modules:

	alias char-major-61  lirc_driver
Note that here driver is a placeholder for the actual driver you are using (serial, parallel, etc.).

If your driver requires some special parameters to work you can specify them at the same place. For example you can set the IRQ and port the serial port drivers shall use by adding the following line to /etc/conf.modules:

	options lirc_serial irq=4 port=0x3e8
This will override the default values you have selected during setup.


Testing your hardware & configuration


If you have build the infrared hardware yourself you are probably eager to find out if it really works.

Type su to get root privileges and start mode2. This should load the kernel module into the kernel and display the infrared signals. Hold your remote control to your infrared receiver and press some buttons. You should see an output like this (the values of your remote will probably be different) :

	pulse 93
	space 4965
	pulse 108
	space 4969
	pulse 93
	space 7496
	pulse 93
	space 7489
	pulse 93
	space 47915
	pulse 138
	space 7475
	pulse 93
	space 7494
	pulse 93

If you don't see anything, try to find out: (a) if you selected the correct driver with the correct settings (port, IRQ), (b) if you use a remote which works and (c) if your hardware works. The voltage input of the infrared receiver should be 5V +/- 0.5V, the output pin of the receiver should be about 0.5V less than the input voltage.

From time to time there should be long spaces (>30000). If you can see very long pulses this usually means that sense auto detection of your serial port IR receiver circuit has failed. You can override sense auto detection by loading the device driver with the following option:
insmod lirc_serial sense=0 if your receiver circuit is active high or
insmod lirc_serial sense=1 if your receiver circuit is active low.

Well, the driver seems to work, now let's test if lircd also does its job. This only works, if lircd uses a config file which fits to your remote control. Use irrecord in the case the LIRC distribution doesn't provide a config file suitable for your remote and it still is not available at the LIRC homepage. A more detailed discussion of creating new config files is available in the section about, you guess it: Adding new remote controls.

Then start the decoder daemon with (make sure it is in your path): lircd [config file]

The following program dumps the decoded key codes from lircd to stdout: irw

This looks like this (depending on your remote):

	0000000000f40bf0 00 1_DOWN ANIMAX
	0000000000f40bf0 01 1_DOWN ANIMAX
	0000000000f40bf0 02 1_DOWN ANIMAX
	0000000000f40bf0 03 1_DOWN ANIMAX
	0000000000f40bf0 04 1_DOWN ANIMAX
	0000000000f40bf0 05 1_DOWN ANIMAX
	0000000000748bf0 00 1_UP ANIMAX
	0000000000748bf0 01 1_UP ANIMAX
	0000000000748bf0 02 1_UP ANIMAX
	0000000000718ef0 00 RED_BUTTON_UP ANIMAX

If the driver test worked, but you now see nothing, then check /var/log/lircd. If you still see nothing suspicious compile lircd in DEBUG mode and look at the log file again. In debug mode lircd has an additional command line option that lets you choose the detail level of debug information.


Uninstall


  • Remove the installed binaries, and device nodes:

    make uninstall

  • Remove the config files, if you don't need them anymore:

    rm /usr/local/etc/lircd.conf /usr/local/etc/lircmd.conf ~/.lircrc


Updating from lirc-0.5.4


This section only describes changes that break compatibility with older versions. Please read the NEWS file to learn about all new features of this release.

The config files of lircd and lircmd are now located in /usr/local/etc/ instead of /etc/ per default. Most people prefer to make /usr/local/etc/ a link to /etc/.

The modules no longer are uniformly installed as lirc.o but are called lirc_driver.o depending on the driver you are using. Therefore you might have to edit your /etc/conf.modules and change the line

alias char-major-61 lirc
to whatever you need.

LIRC now supports the Irman directly. lirmand is no longer necessary. Before installing this version you should call rm /dev/lirc to remove the FIFO that was used in lirc-0.5.4. /dev/lirc now should be a link to the device the Irman is connected to (e.g. /dev/ttyS1).



[LIRC homepage]
The LIRC Manual, last update: 1-Apr-2000