I took the plunge and upgraded my TV box to Ubuntu 12.04 from 10.04. I opted to do a complete re-install rather than upgrade. I do realise 12.10 is now out, but this post has been sat around needing a tidy up for a while 😉

Getting the remote working last time wasn't entirely straightforward and hasn't really improved. I didn't take any notes last time around either, so I've kept notes this time and hope they are of use to someone else. I think half the problem is due to being a cheapskate and getting a generic mce remote rather than the official one!

The Remote

I'm using this one from Maplin.

The USB IR receiver that came with the remote is reported as being a Formosa21 eHome Infrared Transceiver with Device ID 147a:e03e:

Bus 005 Device 002: ID 147a:e03e Formosa Industrial Computing, Inc. Infrared Receiver [IR605A/Q]

Initial Results

With the 12.04 kernel and standard version of lirc the remote is successfully identified and when running irw it spits out button codes for most of the buttons on the remote. Some of the buttons are not recognised, but more disappointingly out of the box XBMC doesn't respond to the remote at all.

So there are two problems that we need to deal with here:

  1. Updating the lirc config file for the additional buttons
  2. Getting XBMX to recognise the remote

lirc config

I generated a new lirc config file for the remote using irrecord, which ended up being very similar to the vista_mce config that ships with lirc.

I simply updated /usr/share/lirc/remotes/mceusb/lircd.conf.mceusb and edited the final vista_mce entry to appear as follows:

begin remote

  name            vista_mce
  bits            13
  flags           RC6
  eps             30
  aeps            100

  header          2700   880
  one             490   410
  zero            490   410
  pre_data_bits   24
  pre_data        0x1BFF83
  gap             104254
  toggle_bit_mask 0x8000
  rc6_mask        0x100000000

     begin codes
          Power                    0x0BF3
          Pictures                 0x0BB6
          Radio                    0x0BAF
          Videos                   0x0BB5
          Music                    0x0BB8
          Rec                      0x0BE8
          Pause                    0x0BE7
          Stop                     0x0BE6
          SkipPrevious             0x0BE4
          Play                     0x0BE9
          SkipNext                 0x0BE5
          Rewind                   0x0BEA
          FastForward              0x0BEB
          Start                    0x0BF2
          Back                     0x0BDC
          More                     0x0BF0
          Start                    0x0BF2
          VolUp                    0x0BEF
          VolDown                  0x0BEE
          ChanUp                   0x0BED
          ChanDown                 0x0BEC
          Up                       0x0BE1
          Down                     0x0BE0
          Left                     0x0BDF
          Right                    0x0BDE
          OK                       0x0BDD
          Mute                     0x0BF1
          Record                   0x0BB7
          Guide                    0x0BD9
          TV                       0x0BDA
          DVD                      0x0BDB
          One                      0x0BFE
          Two                      0x0BFD
          Three                    0x0BFC
          Four                     0x0BFB
          Five                     0x0BFA
          Six                      0x0BF9
          Seven                    0x0BF8
          Eight                    0x0BF7
          Nine                     0x0BF6
          Star                     0x0BE2
          Zero                     0x0BFF
          Hash                     0x0BE3
          Clear                    0x0BF5
          Teletext                 0x0BA5
          Enter                    0x0BF4
          Red                      0x0BA4
          Green                    0x0BA3
          Yellow                   0x0BA2
          Blue                     0x0BA1
      end codes

end remote

XBMC

The final step is that XBMC is not setup to look for a remote called vista_mce, the nearest is mceusb which I presume is the name for the official remotes.

XBMC makes use of a file called Lircmap.xml to map remote control buttons to internal button names.

This lirc button names above match the mceusb configuration as closely as possible in order to make setting up the Lircmap.xml nice and easy. The default configuration is available in /usr/share/xbmc/system/Lircmap.xml and I simply copied this locally to ~/.xbmc/userdata and added the section below to the top of the file.

My Lircmap.xml:

<lircmap>
        <remote device="vista_mce">
                <start>Start</start>
                <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>DVD</menu>
                <title>Guide</title>
                <info>More</info>
                <skipplus>SkipForward</skipplus>
                <skipminus>SkipPrevious</skipminus>
                <display>Aspect</display>
                <start>Home</start>
                <record>Record</record>
                <volumeplus>VolUp</volumeplus>
                <volumeminus>VolDown</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>
                <star>Star</star>
                <hash>Hash</hash>
                <clear>Clear</clear>
                <enter>Enter</enter>
                <red>Red</red>
                <green>Green</green>
                <yellow>Yellow</yellow>
                <blue>Blue</blue>
                <teletext>Teletext</teletext>
        </remote>

        ...

Mind the Gap

The gap value computed when using irrecord was initially 74254. Unfortunately with this value I was occasionally getting spurious double buttons presses, which are pretty annoying. No amount of playing with the min_repeat settings in the lirc.conf file would stop it.

Pushing the gap value up above 100000 fixes the problem, but at the expense of not being able to hold down the button and have it be repeatedly triggered.

Leave a reply

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

required