LIRC on Ubuntu Edgy Eft

From MythTV

Jump to: navigation, search

The LIRC on Ubuntu Edgy Eft HOWTO is a step-by-step guide for installing the Linux Infrared Remote Control CVS drivers on Ubuntu Linux 6.10.

See Ubuntu Installation Guides for installing on other Ubuntu versions.

The purpose is for those remotes that require the CVS version of lirc; for example, the remote included with a Hauppauge WinTV PVR-150. It borrows heavily from the Lirc on Ubuntu Dapper. This document assumes you already have MythTV and ivtv installed and configured. You should also install lirc, though it must not be working (which is why you are reading this document :-)

Contents

Supported Hardware

  • Hauppauge WinPVR 150/250/350/500 (non-MCE edition) capture cards.

Confirmed Working Remotes

  • Grey/Black (A415-HPG) Hauppauge remote with the 4 color buttons at the bottom. If you have this remote, the lirc that ships with Edgy will not work. You must compile the CVS version of lirc.
  • Also works with Grey/Black Hauppauge remote with 4 color buttons in the middle (from PVR-250).

Note: Please add your remote to the list above if this HOWTO works for you.

Install LIRC driver

Setup build environment

 apt-get install ncurses-dev lirc

Now download and install the driver. As of the latest update to this page, the latest version is lirc-0.8.1. See the LIRC homepage or the project's Sourceforge download page

 wget http://easynews.dl.sourceforge.net/sourceforge/lirc/lirc-0.8.1.tar.bz2
 tar -xjvf lirc-0.8.1.tar.bz2 -C /usr/src
 cd /usr/src/lirc-0.8.1

Compile driver module

Before we can compile, we'll need to tell LIRC which type of IR receiver/blaster we have. Do a

 ./configure

and select 1: Driver Configuration -> 5: TV Card -> g: Hauppauge TV card. Scroll down to 3: Save configuration & run configure and wait for configure to finish building the makefiles. Once that's done, do

 make
 sudo make install

Assuming there were no errors, do a

 depmod -a

then look for the following files:

 ls /lib/modules/`uname -r`/misc
 lirc_dev.ko  lirc_i2c.ko

If either file is missing, read through the make output and look for any errors that might explain the problem.

Testing LIRC

Load the driver module into the kernel and make sure it sees your IR hardware.

 sudo modprobe lirc_i2c
 dmesg | tail

On a Hauppauge 150, the output looks like this:

 lirc_i2c: chip found @ 0x71 (Hauppauge IR (PVR150))
 ivtv0: i2c attach to card #0 ok [client=Hauppauge IR (PVR150), addr=71]
 lirc_dev: lirc_register_plugin: sample_rate: 10

Next, we'll check if LIRC can see the raw pulses from your remote. Run the driver test app with

 mode2 -d /dev/lirc0

and push a few buttons on the remote. Don't worry if you get 2 different codes for the same button, the second one means that that button is still down. If everything is working, you should see something like:

 code: 0x17a5
 code: 0x17a5
 code: 0x1fa5
 code: 0x1fa5

Hit CTRL-C to stop mode2.

If mode2 does not work, you may have the wrong device specified. You can look with:

 ls /dev/lirc*

On a Hauppage 350, I had to use /dev/lirc0, so my mode2 line was:

 mode2 -d /dev/lirc0

Loading LIRC at boot

Now it's time to tell the system to load LIRC when it boots. Add lirc after ivtv in your /etc/modules file.

 echo "lirc_i2c" | sudo tee -a /etc/modules

Edit /modprobe/aliases

 sudo nano -w /etc/modprobe.d/aliases

Scroll down to the char-major section until you find where char-major-61 would go (it's not there yet) and add the line

 alias char-major-61 lirc_i2c

Save and exit.

Unless you want to add the mythtv user to the root group (bad idea), we'll need to modify the UDEV rule that comes with the LIRC source

 nano -w /usr/src/lirc-0.8.1/contrib/lirc.rules

Add the text , MODE="0666" to make the file look like this.

 KERNEL="lirc[0-9]*",    NAME="lirc/%n", MODE="0666"

Move the config files to the correct locations

 sudo mv /usr/src/lirc-0.8.1/contrib/lirc.rules /etc/udev/rules.d/90-lirc.rules
 sudo mv /etc/lircmd.conf /etc/lirc/
 sudo mv /etc/lircd.conf /etc/lirc/

And reboot. When the system comes back up, check to make sure that lircd was started:

 ps ax | grep lirc

You should see something like:

 3177 ?        S      0:00 [lirc_dev]
 6113 ?        Ss     0:00 /usr/sbin/lircd --device=/dev/lirc/0
 6115 ?        Ss     0:00 /usr/sbin/lircmd
 6119 pts/0    R+     0:00 grep lirc

If you don't see lircd, then try loading it manually:

 sudo /etc/init.d/lirc start

If you get an error like:

#####################################################
## I couldn't load the required kernel modules     ##
## You should install lirc-modules-source to build ##
## kernel support for your hardware.               ##
#####################################################
## If this message is not appropriate you may set  ##
## LOAD_MODULES=false in /etc/lirc/hardware.conf   ##
#####################################################

then,

sudo nano /etc/lirc/hardware.conf

and set LOAD_MODULES=false

Now, login and run the remote-decoder app:

 irw

and push a few buttons on the remote. Don't worry if you get several copies of the same button, this is normal. If everything is working, you should see something like:

0000000000001f95 00 DOWN grayHauppauge
0000000000001f95 01 DOWN grayHauppauge
0000000000001f95 02 DOWN grayHauppauge
0000000000001f95 00 DOWN grayHauppauge

Hit CTRL-C to stop irw.

Configure Remote

Now that we have Myth installed and running, it's time to tell it what buttons do what. Getting this exactly right is a matter of personal preference. A good starting point is the lircrc file provided by Jarod Wilson:

 wget http://wilsonet.com/mythtv/lircrc-haupgrey-g3.txt
 cp lircrc-haupgrey-g3.txt ~mythtv/.mythtv/lircrc
 chown mythtv:mythtv ~mythtv/.mythtv/lircrc

This will allow the direction, volume, channel, and number buttons to work. You'll have to read through the file to see how the other functions are mapped.

--Jason James 02:39, 31 October 2006 (UTC)

Personal tools