Black God

How to get LIRC (Infrared Remote Control) working in Debian 6.0 (Squeeze)

Recently I was trying to install LIRC (Linux Infrared Remote Control) software in my Debian 6.0 (Squeeze) Stable release.  But it didn’t do well with my remote’s kernel module. The module called lirc_mceusb (for my Remote control hardware designed for Windows Media Center Edition) threw some kernel errors and was in pathetic state.

I tried to install lirc and lirc-modules-source packages. Then compiled remote control drivers in the linux-modules-source using module-assistant tool. Managed to build and install, but it threw serious kernel error messages and the functionality was found to be void. Here is the error message thrown.

Apr 19 00:24:07 debian kernel: [ 1089.951374] lirc_dev: IR Remote Control driver registered, major 61
Apr 19 00:24:13 debian kernel: [ 1095.055710]
Apr 19 00:24:13 debian kernel: [ 1095.057283] lirc_mceusb2: Philips eHome USB IR Transceiver and Microsoft MCE 2005 Remote Control driver for LIRC $Revision: 1.44 $
Apr 19 00:24:13 debian kernel: [ 1095.069099] lirc_mceusb2: Daniel Melander <lirc@rajidae.se>, Martin Blatter <martin_a_blatter@yahoo.com>
Apr 19 00:24:13 debian kernel: [ 1095.166522] usb 1-1.2: reset full speed USB device using orion-ehci and address 3
Apr 19 00:24:13 debian kernel: [ 1095.277714] lirc_dev: lirc_register_plugin: sample_rate: 0
Apr 19 00:24:13 debian kernel: [ 1095.287953] lirc_mceusb2[3]: Topseed Technology Corp. eHome Infrared Transceiver on usb1:3
Apr 19 00:24:13 debian kernel: [ 1095.333062] Modules linked in: lirc_mceusb2(+) lirc_dev ipv6 nfsd lockd nfs_acl auth_rpcgss sunrpc exportfs ext4 jbd2 ext2 udlfb(C) fb fb_sys_fops sysimgblt sysfillrect syscopyarea loop ehci_hcd usbcore hmac mv643xx_eth sha1_generic evdev nls_base libphy mv_cesa rtc_s35390a rtc_mv inet_lro gpio_keys aes_generic ext3 jbd mbcache sd_mod crc_t10dif sata_mv libata scsi_mod
Apr 19 00:24:13 debian kernel: [ 1095.366248] CPU: 0 Tainted: G C (2.6.32-blackgod #2)
Apr 19 00:24:13 debian kernel: [ 1095.372302] PC is at __bug+0x18/0x24
Apr 19 00:24:13 debian kernel: [ 1095.375900] LR is at __bug+0x14/0x24
Apr 19 00:24:13 debian kernel: [ 1095.379494] pc : [<c0029714>] lr : [<c0029710>] psr: 20000013
Apr 19 00:24:13 debian kernel: [ 1095.379503] sp : c0f67d08 ip : 00000002 fp : cfb0e400
Apr 19 00:24:13 debian kernel: [ 1095.391043] r10: 00000000 r9 : 00000060 r8 : 00000020
Apr 19 00:24:13 debian kernel: [ 1095.396294] r7 : 00000020 r6 : 3fc49040 r5 : cfb04400 r4 : ffc49040
Apr 19 00:24:13 debian kernel: [ 1095.402861] r3 : 00000000 r2 : c0f67cfc r1 : c032c289 r0 : 00000042
Apr 19 00:24:13 debian kernel: [ 1095.409428] Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Apr 19 00:24:13 debian kernel: [ 1095.416604] Control: 0005397f Table: 00fb4000 DAC: 00000015
Apr 19 00:24:13 debian kernel: [ 1095.630383] [<c0029714>] (__bug+0x18/0x24) from [<c002c264>] (dma_cache_maint+0x74/0xe4)
Apr 19 00:24:13 debian kernel: [ 1095.638618] [<c002c264>] (dma_cache_maint+0x74/0xe4) from [<bf1334e8>] (usb_hcd_submit_urb+0x15c/0x7cc [usbcore])
Apr 19 00:24:13 debian kernel: [ 1095.649028] [<bf1334e8>] (usb_hcd_submit_urb+0x15c/0x7cc [usbcore]) from [<bf352518>] (request_packet_async+0x164/0x1bc [lirc_mceusb2])
Apr 19 00:24:13 debian kernel: [ 1095.661304] [<bf352518>] (request_packet_async+0x164/0x1bc [lirc_mceusb2]) from [<bf352c54>] (usb_remote_probe+0x6e4/0x7d8 [lirc_mceusb2])
Apr 19 00:24:13 debian kernel: [ 1095.673876] [<bf352c54>] (usb_remote_probe+0x6e4/0x7d8 [lirc_mceusb2]) from [<bf137900>] (usb_probe_interface+0x134/0x194 [usbcore])
Apr 19 00:24:13 debian kernel: [ 1095.685922] [<bf137900>] (usb_probe_interface+0x134/0x194 [usbcore]) from [<c01e714c>] (driver_probe_device+0xcc/0x188)
Apr 19 00:24:13 debian kernel: [ 1095.696771] [<c01e714c>] (driver_probe_device+0xcc/0x188) from [<c01e7268>] (__driver_attach+0x60/0x84)
Apr 19 00:24:13 debian kernel: [ 1095.706222] [<c01e7268>] (__driver_attach+0x60/0x84) from [<c01e6948>] (bus_for_each_dev+0x48/0x84)
Apr 19 00:24:13 debian kernel: [ 1095.715324] [<c01e6948>] (bus_for_each_dev+0x48/0x84) from [<c01e6280>] (bus_add_driver+0xf0/0x27c)
Apr 19 00:24:13 debian kernel: [ 1095.724430] [<c01e6280>] (bus_add_driver+0xf0/0x27c) from [<c01e7560>] (driver_register+0xac/0x13c)
Apr 19 00:24:13 debian kernel: [ 1095.733584] [<c01e7560>] (driver_register+0xac/0x13c) from [<bf137644>] (usb_register_driver+0x64/0xe4 [usbcore])
Apr 19 00:24:13 debian kernel: [ 1095.743972] [<bf137644>] (usb_register_driver+0x64/0xe4 [usbcore]) from [<bf357050>] (usb_remote_init+0x50/0x98 [lirc_mceusb2])
Apr 19 00:24:13 debian kernel: [ 1095.755535] [<bf357050>] (usb_remote_init+0x50/0x98 [lirc_mceusb2]) from [<c0025344>] (do_one_initcall+0x6c/0x1e4)
Apr 19 00:24:13 debian kernel: [ 1095.765954] [<c0025344>] (do_one_initcall+0x6c/0x1e4) from [<c00700fc>] (sys_init_module+0xb8/0x1e0)
Apr 19 00:24:13 debian kernel: [ 1095.775146] [<c00700fc>] (sys_init_module+0xb8/0x1e0) from [<c0025e20>] (ret_fast_syscall+0x0/0x28)
Apr 19 00:24:13 debian kernel: [ 1095.792257] —[ end trace 7594cf81b02ee0c7 ]—

So I decided to go ahead with installation from source, which yielded perfect result. Here is how it can be done. It took some for me to figure out the dependent modules to build. So documented the same.

Downloading the dependent packages and lirc

Install the dependencies to build the lirc kernel modules and tools.

# apt-get install build-essential dialog automake libtool help2man

Download the lirc source code lirc.tar.gz from official LIRC source page.

Building the package

# tar zxvf lirc.tar.gz

# ./autogen.sh

# ./setup.sh

In this menu driven tool run all options from 1 to 4 to configure for your infrared remote.

# make

Installing the package

# make install

Copy the configuration file of your remote in /etc/lirc as lircd.conf. In my case it is lircd.conf.mceusb.

# cp remotes/mceusb/lircd.conf.mceusb /etc/lirc/lircd.conf

Reboot the machine to load the lirc_dev module and remote specific module. In my case remote specific module is lirc_mceusb (If you don’t want to reboot, you can use modprobe command to load these modules).

Testing the lirc

It is time to start LIRC daemon. In the following command I don’t run the daemon in background mode for testing (-n option). In my case the device is /dev/lirc0. Once tested you can automate this command by adding “/usr/local/sbin/lircd –device=/dev/lirc0
” in /etc/rc.local script.

# lircd -n –device=/dev/lirc0

Now let’s test.

# irw

Run the above command and press any key in your remote. It should be displayed on screen.

Congrats, you got the lirc base setup done.

 

4 comments for “How to get LIRC (Infrared Remote Control) working in Debian 6.0 (Squeeze)

  1. July 26, 2012 at 12:48 pm
  2. Guest
    April 23, 2012 at 9:23 pm

    I’ll have to try this! I also spotted this project to use LIRC with http://sourceforge.net/projects/rclauncher/

    • Black God
      April 23, 2012 at 9:29 pm

      Wow.. thanks a ton for introducing rclauncher. I was looking for such a light weight project for my photo frame attachment with home NAS server.

Leave a Reply

Your email address will not be published. Required fields are marked *