Archive for January 7th, 2007

Ubuntu LIRC

January 7th, 2007

UPDATE:

Ubuntu now has a helpful wiki page, and with Gutsy, installation is much easier. See https://help.ubuntu.com/community/Install_Lirc_Gutsy

So what’s the hardest thing I’ve ever done in Ubuntu? Compile a custom driver for a LIRC remote. I bought a Streamzap PC remote at Fry’s in Dallas a couple weeks ago and finally sat down to get it running in Linux. Sheesh… never before has one simple task given me so much trouble. In gentoo I could have rebuilt everything for mythtv in the time it took me to just get one simple module built for Ubuntu. Every tutorial on the net wants to teach you how to make installable .deb files to replace the distributed packages – this is completely unnecessary in my opinion.

Here’s how I got it to work, in case you’re in my shoes:

sudo apt-get install linux-source build-essential automake libtool
cd /usr/src/
sudo bunzip2 linux*
sudo tar -xvf linux*.tar
sudo ln -s /usr/src/linux-source-2.6.17 /usr/src/linux
sudo cp /boot/config-`uname -r` /usr/src/linux/.config
cd /usr/src/linux
sudo make
cd ~/
cvs -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc login
cvs -z8 -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc co lirc
cd ~/lirc
./autogen.sh
./setup.sh
sudo make
sudo make install

After that you should be able to plug in the usb module, run dmesg and see that it found the correct device, then sudo /etc/init.d/lirc restart, and use irw to see the correct codes.

Some notes: I just run make on /usr/src/linux to get the correct version info built into header files. If you don’t complete this step the LIRC module will be built and fail because of a version magic kernel string mis-match.
I had to use the CVS version of LIRC because the USB module syntax has changed with kernels > 2.6.13, specifically affecting the streamzap driver. Like I said, there are plenty of other guides out there which teach you how to build the entire kernel/modules and make a .deb package to install – all of these are a huge waste of time to just build one necessary module.