Dependencies


First, lirc is packaged for all major linux distributions. If you just want to use lirc, you should be able to install it like any other package. This way, you don't have to look at the dependencies, build and installation description found here. However, here is also some testing notes which applies if you have built your own device.

Mandatory dependencies
  • Several scripts need the python3 PyYaml package at http://pyyaml.org/wiki/PyYAML.
  • Overall, python3 is.required for the build
  • The build also needs man2html.
  • The configuration script needs python3-gi and thus also the Gtk libs. It's not required for the build, though.
  • .

If you want to compile and use all tools, you also need an installed version of the X Windows header files (needed by irxevent and xmode2) The configure script will notify you if some necessary files are missing and the according tools won't be compiled.

Irman (=UIR) : 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.3. To build, the irman library must exist as a dynamic .so module. At the time of writing this is true for the Fedora package, but not for Debian.

As of 0.9.1+, lirc uses the kernel modules from the official kernel. Some of these are formerly lirc modules which are now part of the kernel. Thus, building lirc does not involve building kernel modules (as it used to be).

Some of the former lirc modules are part of the official kernel and should be available on any reasonably updated system. However, some are in the staging area; if they are part of your kernel depends on the distro you use (unless of course if you compile your own kernel).

If you want to use a home-brew receiver, an Anir Multimedia Magic, a Packard Bell receiver, the IRdeo or if you want to use the SIR IrDA driver, I suggest that you use the lirc_serial or lirc_sir module. Usually the serial port driver grabs all ports it auto-detects as soon as it is loaded and the LIRC modules won't be able to use any of them.

There are two solutions for this problem. Either you load the LIRC module before the kernel serial port driver is loaded (that's why you have to compile it as a module) or you call setserial /dev/ttySx uart none to release the according port. setserial usually is already called during boot-up in some init script whose location depends on the distribution you use. If you tell setserial to configure a port that is already claimed by a LIRC module, the kernel serial driver will steal the port from the LIRC module and LIRC will stop working. So check your setserial configuration to only configure available ports. Debian users should adjust their /etc/serial.conf.

TV cards: To use any remote control receivers connected directly to a bttv based TV card you will need a working bttv setup in your kernel. For most TV cards we rely on bttv autodetection. That way you don't have to give any parameters to the module as they are selected internally depending on the information the bttv module gives us. This means that you should pay attention that your TV card is detected correctly by bttv.


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.

You should locate your device in this list of supported devices and see if there is additional information available regarding the setup of your device.


Compile and Install


Since 0.9.1+ , lirc loads drivers dynamically. This means that that the build system is redesigned to always build all drivers. The former setup.sh script is dropped in favor of a standard ./configure, make, make install sequence.

When running the configure script, please pay attention at its output. After having configured the package just type make and lean back.

Note: You won't find a configure script in the source repo version of LIRC. You will have to generate it first by executing ./autogen.sh.

Installing the compiled programs is really easy, just type make install. All binaries and configuration files should be copied to its proper destination


Installation


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.

Formerly, lirc was configured during build where the setup.sh script was used to select driver, configuration file. Also, there was was little support for starting and running the services from boot. From 0.9.1+ the configuration is instead done after the build. The configuration steps for the main lircd program involves:

  • Selecting the driver and device.
  • Selecting configuration file.
  • In some cases e. g., serial devices setting up kernel module options in /etc/modprobe.d.
  • Configuring and using systemd to run the services.
This is described in the configuration guide.

When you are using devfs or sysfs with your kernel, the /dev/lirc device node will disappear again once you reboot your machine. In that case the LIRC kernel module will generate the required entry every time it is loaded. But the device node won't be visible as /dev/lirc, but might be located in a different location like e.g. /dev/lirc0. Please be aware of this when starting programs that access the device node like mode2 or lircd. You will have to use the --device command line option of these programs to point them to the correct location.

Now you should adjust the file permissions of /var/run/lirc/lircd (this is the Unix domain socket that clients use to connect to lircd) so others than root can connect to lircd. Either edit lirc_options.conf or use the --permissions command line option e. g.,

        lircd --permission 666  
    

should do. You can also create a special group for this purpose.

Finally you might want to add /usr/local/lib to /etc/ld.so.conf so the lirc_client library is found by the run-time linker. Don't forget to call ldconfig afterwards for the change to take effect.


Testing your hardware & configuration


If you have build the infrared hardware yourself you are probably eager to find out if it really works. If you have not build the hardware yourself you can skip the first test. For most receivers it even won't work because it makes no sense.

Type su to get root privileges and start mode2 (Warning: don't confuse mode2 with mode3: mode3 will set your video card to a vesa mode using the vesa bios calls...). 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 (I/O base address, 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:

modprobe lirc_serial sense=0 if your receiver circuit is active high or
modprobe 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 did work, but you now see nothing, then check /var/log/lircd. If you still see nothing suspicious add a --debug=10 option and look at the log file again.


Sending infrared signals


The LIRC package contains the irsend tool for sending infrared signals to e.g. your TV or CD player. For reliable transmission a good config file is even more important than for receiving. A discussion of all the infrared protocols is way beyond the scope of this manual but when creating a config file at least read the hints at the end of this manual. You can find exact timing specifications for most common inside the remotes/generic/ directory of the LIRC package.

If you want a graphical interface for controlling your devices using LIRC, you might have a look at xrc. You can download the xrc package from the LIRC homepage. xrc is a Qt based program. Setting up xrc and Qt is a bit tricky so if you don't manage to compile it you can still use irsend. It has the full functionality you need.


Uninstall


  • Remove the installed binaries, and device nodes:

    make uninstall

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

    rm /etc/lirc/lircd.conf /etc/lirc/lircmd.conf /etc/lirc/lircrc ~/config/lircrc


Updating from older versions


Each new release contains a NEWS file which describes the changes since last version. Normally, upgrading from a previous version should not be too painful. However, if you have to update a really old version it's probably better to make a fresh install.



[LIRC homepage]
The LIRC Manual, last update: 10-June-2014