This page is part of the Ubuntu's LIRC Distribution Installation pages. If you are looking for LIRC support on a different release, choose from these pages:

What is LIRC ?

The LIRC application suite allows for control of your computer using your remote control.

You can send X events to applications, start programs and much more by decoding and sending infra-red signals of many commonly used remote controls. Universal remote controls with learning modes are also supported.

As installed, the default LIRC init scripts are properly setup to handle one receiver and possibly one transmitter. They can be adapted for additional receivers or transmitters, but the setup gets more complicated when doing this.

Installation

8.04 (Hardy Heron) 9.04 (Jaunty Jackalope) 9.10 (Karmic Koala) 10.04 (Lucid Lynx) 10.10 (Maverick Meerkat)

Install Packages

On a system with a desktop environment the Synaptic Package Manager can be used to install the lirc package and its dependencies.

For terminal and command line only:

$ sudo apt-get install lirc

Choose Remote/Transmitter

lircRemoteSelect.png

Testing

To test if your remote is setup properly test it using this command:

$ irw

The terminal should 'appear' to hang, (not return a command prompt). Press buttons on your remote, you should see key presses then come up on the terminal. When you're done, testing press <crtl> + 'c' to quit.

Back to top

Configuration

Create a configuration file in the users home directory named .lircrc

The .lircrc file is responsible for mapping the buttons to applications. Instructions on formatting for this file can be found here.

LIRC Components

For a list and descriptions of the available components of LIRC see here.

irexec

The irexec component can be used to control applications such as Rhythmbox and Xine. Set irexec to start at login by adding the entry irexec -d to the relevant Startup/Sessions dialog. For more information see the irexec manual page.

  • Ubuntu 9.10, 10.04, 10.10 - System / Preferences / Startup Applications

  • Ubuntu 8.04.x, 8.10, 9.04 - System / Preferences / Sessions

  • Xubuntu - Applications /Settings / Session and Startup

  • Kubuntu - System Settings Dialog.

startupDialog.png

Back to top

Re-configuring LIRC

To reconfigure LIRC for another remote or incorrect settings, the following command can be issued at any time in a terminal

sudo dpkg-reconfigure lirc

Back to top

Unlisted Remotes

If your remote isn't listed in the lirc installation, you should file a bug on Launchpad.

  • For other remotes, a good place to start looking is the Lirc Website Remotes list.

  • The online remote configuration tool LIRC Config also maintains a customizable database of lircd.conf's.

Replace /etc/lirc/lircd.conf with this lircd.conf that you have found or add an include line for it:

$ sudo cp <name of downloaded.conf> /etc/lirc

If you have found a remote, skip the next section.

Otherwise, continue, and you will record a remote using irrecord.

Recording a Remote

Insert the module that you intend to record from.

Example:

$ sudo modprobe lirc_mceusb2
  • Record the remote using irrecord

$ sudo irrecord -d /dev/lirc0 lircd.conf
  • Once you have completed your configuration, move this lircd.conf to /etc/lirc/lircd.conf

$ sudo mv lircd.conf /etc/lirc
  • Add the modules for the remote to /etc/lirc/hardware.conf under MODULES

Adding support for more remotes

If you run into a situation where you think your remote "should" be working, but no /dev/lirc0 is being created, you may have to add the USB id to the LIRC source file. Follow these directions:

1. Start out by looking at lsusb output.

lsusb
  • Take note of the Vendor:Product IDs.

2. For the sake of this example, these are the IDs of the receiver we are trying:

0471:060d Philips

3. Install lirc-modules-source.

sudo apt-get install lirc-modules-source

4. Switch into the /usr/src/lirc-* and backup your driver.

cd /usr/src/lirc-*/lirc_mceusb2
cp lirc_mceusb2.c lirc_mceusb2.c.old

5. Edit the lirc_mceusb2.c file and add in your particulars. Scroll down to where the remotes are listed. If your vendor is not listed than you'll have to add that in. (eg define VENDOR_PHILIPS 0x0471) NB. Philips is already listed as above.

Now add in the particulars for your remote. In this case;

        /* Philips SRM5100 */
        { USB_DEVICE(VENDOR_PHILIPS, 0x060d) },

NB. Note from the code you noted down that the first bit is the vendor code (0471) and the second the remote id. (060d)

6. Now it's time to rebuild the modules. We'll start by clearing out the old one.

sudo dkms remove -m lirc -v 0.8.3~pre1 --all

7. Now it's time to build your new one.

sudo dkms add -m lirc -v 0.8.3~pre1
sudo dkms -m lirc -v 0.8.3~pre1 build
sudo dkms -m lirc -v 0.8.3~pre1 install

8. Update the modules and reinstall LIRC

sudo rmmod lirc_mceusb2
sudo modprobe lirc_mceusb2
sudo /etc/init.d/lirc restart

9. Make sure that you send a patch upstream to LIRC so that it can get into the next LIRC release. If you would like to also see it show up in the next Ubuntu release (in the case that LIRC upstream does very infrequent releases), then submit a bug to launchpad referencing the LIRC CVS commit.

Back to top

See Also

Back to top


LIRC (last edited 2011-02-23 08:27:59 by beehock)