Linux, LIRC, Imon, and Antec Veris

February 13, 2009

Update If you are looking to get the Antec Veris working under 9.10 (Karmic Koala) Click Here

This is as much for me as for anyone else looking for info.

In my earlier post where I fixed my TV, I mentioned that I use a Linux box for a media center. So this job has been done on the cheap, spare parts and existing setup were being modified to work. No buying an Apple TV or a special set top system.

So i have been bouncing back and forth between Boxee, MythTv and XBMC. All of them have their own merits, but I have been leaning towards XBMC and Boxee. MythTV really doesn’t meet my particular needs, though it is a great system.

But the ultimate suck of my setup was the lack of a remote.

So last week I had to meet up with my boss to pick up a Mac Mini for work ( I’ll be posting my thoughts on that later), I had to run over to Best Buy and get a keyboard. While I was there I saw an Antec Veris Basic remote for relatively cheap. 30 bucks later and I had myself a remote for my XBMC use.

Well my initial browsing showed that the Antec was compatible with LIRC so I figured I was good to go. Fuck was I ever wrong. First off, Soundmon which makes these devices and then repackages them with other companies names is known to work differently than most standard remotes, the particular version I bought has only recently been added to the LIRC builds, and it wasn’t available in the APT repository for my Ubuntu distro. So my first thought was to go back to my favorite distro Debian, but after finding out that neither Boxee nor XBMC will build worth a damn in Debian and their LIRC modules were out of date even using the Unstable files I gave up. Better to build from source on one item and not on three.

So here is what I had to do to get it to work.

First thing first, this thing is taken over by usbhid. That means it tries to treat my shit like it’s a mouse or keyboard. Well that won’t work. So in Debian and Ubuntu you need to do acouple of things to find out what driver it is using and also what the the hardware is.

So in Ubuntu and Debian you need to take these two steps…

mount -t usbfs none /proc/bus/usb

then

cat /proc/bus/usb/devices

This took me some googling to find out about the usbhid issue.

This next part come from here1) Edit /etc/modprobe.d/usbhid (create it if it doesn't exist) and add the following line. The first hex code is the vendor ID, the second is the product ID, and the 0x0004 means ignore this device.

options usbhid quirks=0x15c2:0x0038:0x0004

2) Run the command: depmod -ae3) You need to rebuild your initrd. If you are running a typical installation, you can do this by running:

update-initramfs -u

Mine has a different set of codes, so usbhid number was 0x15c2:0x0043

So I made the appropriate edits. And then I followed the rest of the steps from the site.

From here it was time to build my modules. Since I wasn’t lucky enough that my stuff was handled in the version easily available to me, I had to go and build from source. The CVS actually.

So I had to add CVS to my Ubuntu build and then I created a folder in my home directory called source. Mainly fearing that this will not be the last time I have to do something like this.

From here I had to do this from the terminal…sudo cvs -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc loginthensudo cvs -z8 -d:pserver:anonymous@lirc.cvs.sourceforge.net:/cvsroot/lirc co lircOnce the files were downloaded I cd'd into the new directory and did..../autogen.shThen./setup.sh

Selecting the correct options for me, in this case the imon IR driver.

Once this was done I rebooted me system since it created some crap in my /dev directory.

After that I went back into the terminal and did a sudo ls /dev/lir* This gave me lirc0 lirc1 lircdWoohoo!!!! Just what I wanted to see. Now onto testing out my install. sudo mode2 -d /dev/lirc0 --raw and sudo mode2 -d /dev/lirc1 --rawrespectively.

The aggravating thing about the imon systems is that the buttons don’t go through a single lirc like other remotes, instead it goes through two. So there is a few tweaks to get it to work, neither were what I needed. And the new CVS has a section for my RM100 remote, but the codes were wrong. I am wondering if they changed them recently. So I had to build an lircd.conf file for both lirc0 and lirc1 using irrecord.

I then created a folder in /etc named lirc. In there I placed my two lircd files named rm100_0.conf and rm100_1.conf respectively.

Once I did this I had to get the lircd daemon running. Since I need two of them and also needed them to link up together I had to run these commands.

This linked up both of the daemon processes and then pointed them to their respective config files.

Now I was able to run irw to test out my config. Well this stupid fucking remote does a double signal. One for press and the other when you let go. Now the shitty part is that there are ways to delay and make the config files ignore double presses, but these are not double key presses. Nope two seperate events, so that mean that I had to figure out a way to get my lirc to ignore the second event. Some more googling garnered me a post somewhere that showed how a person changed the toggle_bit_mask in the config files to basically fuck up the remote codes. Crappy breaking code hack, but fuck it, it worked.

So in one remote I had

0x28so I changed it to0x140000

The other had 0x4000So I changed it to0x0

Sufficiently broken. So now when I click a button it only showed one event.

Now that it was finally working, I needed to get this stuff to autostart when I botted up. So onto making a shell script with the commands to kick in the two daemons and placing it into /etc/init.d/ . I named my script lirc and then added it as a startup item. Google it, this one is not hard to find.

From here I created my Lircmap.xml for XBMC and got all the keys to do what I wanted.

T was looking over my shoulder while I was writing this up and said “Are you still working on that post?”

And I have to agree with her. this was one shitty, nasty, painful install. I should learn to just get easily supported crap for my Linux boxes, but really I am not that smart. So instead I am writing a blog post so I can remember what I did.

If you made it this far I commend you. Because fi you are coming from the motorcycle sites, you probably didn’t really give a fuck about this, and if you bought one of these Soundmon things, you have probably spent a fucking week trying to get it to run. Just. Like. Me.