Using new imon devinput with lirc

I don’t know exacly untile when but the imon lcd support has been merged  into the linux kernel using devinput.

This means that if you want to use the lirc_imon driver you need to blacklist the imon driver shipped with the kernel. You just need to add the following lines in the /etc/modprobe.d/blacklist.conf file:

blacklist rc_imon_pad

blacklist imon

After this you can proceed followingone of the lirc guides related to imon you find on the web.

But if you want to use the new devinput module, which in fact make thinks easier, you just leave the modules as they are and just edit the Hardware.conf file (/etc/lirc/hardware.conf):

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE=”Linux input layer (/dev/input/eventX)”
REMOTE_MODULES=””
REMOTE_DRIVER=”devinput”
REMOTE_DEVICE=”/dev/input/by-id/usb-15c2_0038-event-if00″
REMOTE_SOCKET=””
REMOTE_LIRCD_CONF=”devinput/lircd.conf.devinput”
REMOTE_LIRCD_ARGS=””

#Enable lircd
START_LIRCD=”true”

And in the lirc configuration file /etc/lirc/lircd.conf you should put this line:

#Configuration for the Linux input layer (/dev/input/eventX) remote:
include “/usr/share/lirc/remotes/devinput/lircd.conf.devinput”

This work good on my ubutu 11.10, perhaps you need to adjust some paths if your distro is different.

PLS NOTE Done this way the knob on my antec fusion doesn’t work neigther the blue key on the remote. The kno generates events on a different device: /dev/input/by-id/usb-15c2_0038-event-mouse

So you have to chain two distinct lirc servers togethere:

/usr/sbin/lircd –pidfile=/var/run/lirc/lircd1.pid –output=/var/run/lirc/lircd1 –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-mouse –listen/usr/sbin/lircd –output=/var/run/lirc/lircd –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-if00 –connect=localhost 8765

This way you find events of both devices on the socket /var/run/lirc/lircd.

Due to a driver bug, which i will investigate, the knob gets temporarly disabled if you press some particular key. For example if you press the yellow tv button the kno will not work anymore, until you press a number button of the remote.

To make the two instances of lirc to startup at boot time i added an upstart script /etc/init/htpc-lirc.conf:

description    “HTPC lirc daemon”

start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]

script
mkdir /var/run/lirc -p
/usr/sbin/lircd –pidfile=/var/run/lirc/lircd1.pid –output=/var/run/lirc/lircd1 –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-mouse –listen
/usr/sbin/lircd –output=/var/run/lirc/lircd –driver=devinput –device=/dev/input/by-id/usb-15c2_0038-event-if00 –connect=localhost:8765
end script

Finally link it init.d

ln -s /lib/init/upstart-job /etc/init.d/htpc-lirc

 

 

 

2 risposte a “Using new imon devinput with lirc”

  1. Ho letto con interesse il tuo post perchè anch’io mi sono dilettato a far funzionare un htpc con Mythbuntu e mi trovo in difficoltà (dopo un upgrade da Ubuntu 8.x a 12.04) a far funzionare il telecomando con iMON Remote LCD (con chip 15c2_0038).
    Prima ero riuscito a far funzionare bene ii lircd con i moduli imon_dev e lirc_imon (con imon in blacklist).
    Ora la stessa configurazione non mi funziona più (intanto il lirc è passato a 0.9.0) e anche provando il tuo metodo alternativo con ‘devinput’, riabilito imon ed arrivo ad attivare il lircd ma appena un client si connette (irw) il lircd mi segnala un problema:

    guido@Maxwell:~$ sudo lircd –driver=devinput –device=”/dev/input/by-id/usb-15c2_0038-event-if00″ –nodaemon
    lircd-0.9.0[3284]: lircd(devinput) ready, using /var/run/lirc/lircd
    lircd-0.9.0[3284]: accepted new client on /var/run/lirc/lircd
    lircd-0.9.0[3284]: initializing ‘”/dev/input/by-id/usb-15c2_0038-event-if00″’
    lircd-0.9.0[3284]: unable to open ‘”/dev/input/by-id/usb-15c2_0038-event-if00″’
    lircd-0.9.0[3284]: Failed to initialize hardware
    lircd-0.9.0[3284]: removed client
    lircd-0.9.0[3284]: closing ‘”/dev/input/by-id/usb-15c2_0038-event-if00″’
    ^Clircd-0.9.0[3284]: caught signal

    Ho anche provato a risolvere il conflitto con Hal (che effettivamente c’era) descritto in
    http://www.lirc.org/html/devinput.html
    ma le cose non sono cambiate.
    Ho il sospetto ceh qualche altro componente o processo si succhi gli eventi di imon (perché qualche tasto del telecomando comunque funziona) ma non so identificare quali siano.

    Sei in grado di darmi qualche consiglio?
    Grazie

    1. Il mio consiglio è di abbandonare lirc. Con la nuova verisone di devinput e ir non ne hai bisogno, puoi mappare tutti i tasti del telecomando sui tasti della tastiera. Ad esempio puoi avere il tasto ‘Menu’ del telecomando che mappa il tasto ‘M’ della tastiera, o il tasto ‘Channels’ che mappa ‘S’.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.

WP to LinkedIn Auto Publish Powered By : XYZScripts.com