Thursday, October 9, 2008

LIRC - Linux Infrared Remote Control, Debian, and the remote wonder

I have installed my Ati Remote Wonder four different times now (twice on my media server, once on Ubuntu, and once just now on Debian), and each time it proves most problematic every single time. I think the problem arises from the driver setup for the remote itself. I found a few resources that managed to walk me through the process in setting up my remote again.

First I installed lirc via apt-get:
sudo apt-get install lirc lirc-modules-source
*note: I actually installed lirc-modules-source later, based on the steps at http://www.mythtv.org/wiki/index.php/LIRC_on_Debian_Etch

This installs lirc, which will then try to run automatically. It will fail. Next I extracted the source I just downloaded
cd /usr/src
tar -xvzf lirc-modules.tar.gz
Then I followed the commands from the aforementioned link: (*note, you need the package module-assistant to continue)
apt-get install kernel-package
m-a update,prepare
dpkg-reconfigure lirc-modules-source
m-a a-i lirc
dpkg -i /usr/src/lirc-modules-*.deb
modprobe lirc_i2c
If you look at the instructions from the link, it explains in more detail what these commands do, but basically this is making the module that lirc needs to set up the device in /dev. If you are following along on the instructions, it then asks you to start lirc, but it is not going to pick up the remote wonder just yet.

The second set of instructions are from http://www.mythtv.org/wiki/index.php/ATI_Remote_Wonder. There is no Debian-specific instructions, so I had to wing it. I first had to blacklist the ati_remote module that is installed with lirc. Simply add "blacklist ati_remote" (without the quotes) to the bottom of /etc/modprobe.d/blacklist. After blacklisting ati_remote, you should be able to see the correct module lirc_atiusb by typing:
lsmod | grep ati
It was then possible for me to run irrecord to record the buttons on my remote. Alternatively, the second link provides an lircd.conf file for the remote wonder. Though if you download their file, they say to put it in /etc/lircd.conf, but it won't run unless you put it into /etc/lirc/lircd.conf. Finally, lirc is ready to run.
sudo /etc/init.d/lirc start
(If it still doesn't start, you may have to edit the /etc/lirc/hardware.conf file, change DEVICE="" to DEVICE="/dev/lirc0" and that should fix it.)

Running the command irw will let you test the remote. Type "irw" and then hit buttons on the remote, and you should see them register in the terminal. If the remote is set up correctly, you are then free to edit your ~/.lircrc file to make it function in whichever program you want. Personally, I use it with my favorite music player, Amarok, to play/pause or skip songs, and amixer to change my system volume.

3 comments:

Politux said...

I was googling for info on setting up my debian box to accept input from a remote control so that I wouldn't have to use the keyboard and mouse with my home theater pc. This how-to makes me think it isn't worth the effort, for someone with my limited skills. Thank you.

Swinky said...

Politux, I'd hate to discourage you from setting up your remote with LIRC! Things might sound a little complicated but they aren't too bad.

What kind of remote are you using? Most of my problems came from using the ATI Remote Wonder, which support was not stellar for when I set this up. If you are using a homebrew or puchased infrared receiver with an infrared remote, you'll find that in a lot of distributions' packages for LIRC, they can set up a lot of that for you.

Anonymous said...

Interesting story you got here. It would be great to read more concerning that topic. The only thing I would like to see here is some photos of such gadgets as gps jammer.