Multiple IR Remotes
#1
Hello all,

I just thought of sharing my (brief) experience with the xbmc linux port, in this case regarding setting up multiple IR remotes.

The system i'm running xbmc in is a Debian Sid, and i have an Hauppauge PVR-250 card with one IR remote. The case holding the system is an Antec Fusion which has a VFD, aka LCD, and a volume knob. That knob is seen by the system as an IR remote itself.

1st i started to configure lircd to understand both remotes (you can use irrecord to build your own lircd.conf file in case you don't find a suitable one for your remote).

my /etc/lircd/lircd.conf file looks like this:

Code:
--- snip ---

begin remote
  name            Hauppauge_A415
  bits            13  
  flags           RC5|CONST_LENGTH  
  eps             30  
  aeps            100  
  one             969   811  
  zero            969   811  
  gap             114605  
  toggle_bit      2  
  plead           1097

  begin codes
       Go              0x17BB
       Power           0x17BD
       TV              0x179C
       Videos          0x1798
       Music           0x1799
       Pictures        0x179A
       Guide           0x179B
       Radio           0x178C
       Up              0x1794
       Left            0x1796
       Right           0x1797
       Down            0x1795
       OK              0x17A5
       Back/Exit       0x179F
       Menu/i          0x178D
       Vol+            0x1790
       Vol-            0x1791
       Prev.Ch         0x1792
       Mute            0x178F
       Ch+             0x17A0
       Ch-             0x17A1
       Record          0x17B7
       Stop            0x17B6
       Rewind          0x17B2
       Play            0x17B5
       Forward         0x17B4
       Replay/SkipBackward 0x17A4
       Pause           0x17B0
       SkipForward     0x179E
       1               0x1781
       2               0x1782
       3               0x1783
       4               0x1784
       5               0x1785
       6               0x1786
       7               0x1787
       8               0x1788
       9               0x1789
       Asterix         0x178A
       0               0x1780
       #               0x178E
       Red             0x178B
       Green           0x17AE
       Yellow          0x17B8
       Blue            0x17A9

  end codes

end remote

begin remote
  name  ClickWheel
  bits           24
  eps            30
  aeps          100

  one             0     0
  zero            0     0
  post_data_bits  8
  post_data      0xFF
  gap          131993
  toggle_bit      0

  begin codes
       WheelCC                  0x010000
       WheelCW                  0x000100
       WheelClick               0x000008
  end codes
end remote

--- snip ---


As you can see, there are two remotes defined. Hauppauge_A415 is the remote for the ivtv card and ClickWheel is the volume knob in the case.

Then i had to hack the lircd startup script, since it would only launch one instance of lircd. Since i have two lirc devices, /dev/lirc0 and /dev/lirc1, i replaced the LIRCD_ARGS variable in the /etc/lirc/hardware.conf file with two entries

LIRCD0_ARGS="-d /dev/lirc1 -P /var/run/lircd.hauppauge -l -o /dev/lircd"
LIRCD1_ARGS="-d /dev/lirc0 -P /var/run/lircd.soundgraph -c localhost -o /dev/lircd"

Note the -l (for listen) in the first line and the -c localhost (connect to localhost) in the second line. The 1st instance acts as lirc server and the second acts a client. This happens because applications, like xbmc, use the socket /dev/lircd to read information from. Only one lirc instance as write permission on that socket (write lock).

Then i changed the /etc/init.d/lirc file. In the start clause, i replaced

start-stop-daemon --start --quiet --exec /usr/sbin/lircd -- $LIRCD_ARGS \
< /dev/null

with

/usr/sbin/lircd $LIRCD0_ARGS
/usr/sbin/lircd $LIRCD1_ARGS

Probably the substitution could have been made in a more fashionable way, but i was in a hurry, and it works as good Wink

Then i was able to test both inputs issuing irw.

After this, is just a matter to edit the xbmc Lircmap.xml file and define the actions for both the remotes.

Mine looks like this:

Code:
<!-- This file contains the mapping of LIRC keys to XBMC keys used in Keymap.xml  -->

<lircmap>
        <remote device="Hauppauge_A415">
                <play>Play</play>
                <pause>Pause</pause>
                <stop>Stop</stop>
                <forward>Forward</forward>
                <reverse>Rewind</reverse>
                <left>Left</left>
                <right>Right</right>
                <up>Up</up>
                <down>Down</down>
                <select>OK</select>
                <pageplus>ChanUp</pageplus>
                <pageminus>ChanDown</pageminus>
                <back>Back</back>
                <menu>Back/Exit</menu>
                <title>Guide</title>
                <info>Menu/i</info>
                <skipplus>SkipForward</skipplus>
                <skipminus>Replay/SkipBackward</skipminus>
                <display>Text</display>
                <start>Go</start>
                <record>Record</record>
                <volumeplus>Vol+</volumeplus>
                <volumeminus>Vol-</volumeminus>
                <mute>Mute</mute>
                <power>Power</power>
                <myvideo>Videos</myvideo>
                <mymusic>Music</mymusic>
                <mypictures>Pictures</mypictures>
                <mytv>TV</mytv>
                <one>One</one>
                <two>Two</two>
                <three>Three</three>
                <four>Four</four>
                <five>Five</five>
                <six>Six</six>
                <seven>Seven</seven>
                <eight>Eight</eight>
                <nine>Nine</nine>
                <zero>Zero</zero>
                <mytv>Red</mytv>
                <mymusic>Green</mymusic>
                <mypictures>Yellow</mypictures>
                <myvideo>Blue</myvideo>
        </remote>

        <remote device="ClickWheel">
                <volumeplus>WheelCW</volumeplus>
                <volumeminus>WheelCC</volumeminus>
        </remote>

</lircmap>


Hope it's helpfull for anyone.

Cheers,

Hugo Monteiro.
Reply
#2
Nice thing Smile

How does the knob connects to the motherboard?
So it I understand it correctly, also this one's knob and buttons could be used? http://photos03.allegro.pl/photos/orygin.../281147150
I'm also wondering how about it's LCD support http://seth.nazwa.pl/_allegro/rmaju/Avc-...-S1_04.jpg
Reply
#3
embrion Wrote:Nice thing Smile

How does the knob connects to the motherboard?

My systems case is an Antec fusion, which is shipped with a 2x16 VFD (aka LCD) and a Knob. This is connected to the mobo through one internal USB connector. The driver module i use to make the system see those devices is the lirc_imon (since it's an imon LCD+knob bundle).

Quote:So it I understand it correctly, also this one's knob and buttons could be used?

That will depend on your hardware. It's a matter of researching and finding out if it's supported under linux or not. Google for the manufacturer + linux + lirc and/or manufacturer + linux + lcdproc.

Quote:http://photos03.allegro.pl/photos/orygin.../281147150
I'm also wondering how about it's LCD support http://seth.nazwa.pl/_allegro/rmaju/Avc-...-S1_04.jpg

LCD support, in XBMC is not working (yet?). Although i believe that folks will get that working in no time. It's pretty easy to use the LCDproc linux interface.

Regards,

Hugo Monteiro.
Reply
#4
Thanks, I'll check it out
Reply

Logout Mark Read Team Forum Stats Members Help
Multiple IR Remotes0