Solved Raspberry Pi and Lircmap.xml
#1
Hi, I'm a newbie regarding XBMC so sorry if my question is a bit trivial. However this is my setting: I have a sort of home made remote controller with some buttons and obviously a raspberry with Raspbmc as os. I attached a irda receiver to the raspberry and recorded the inputs from my remote to the lircd.conf in the home folder. I also configured XBMC to accept commands from the remote through the GPIO. Now the problem, in the lircd.conf file I have mapped all the buttons but only some of them work correctly. I mean the button mapped KEY_LEFT work correctly but for example a button named KEY_CONTEXT_MENU does not work at all. I know that KEY_CONTEXT_MENU doesn't have a map inside XBMC so I tried to create the Lircmap.xml file and put it into my .xbmc/userdata/ and also according to that I edited the keyboard.xml file to perform the correct mapping. I tried also to create a remote.xml file as explained somewhere on Internet it does not solve. Finally I have also tried to edit the Lircmap.xml file in the installation path (I know it is'n a good practice) but the problem persists.

It is if there is a default mapping between Lirc Names and XBMC action.

Have I forgot something?

This is my lircd.conf:
Code:
begin remote

  name  myremote
  bits            8
  flags SPACE_ENC
  eps            30
  aeps          100

  one           592  1625
  zero          592   565
  ptrail        590
  pre_data_bits   8
  pre_data       0xC5
  gap          16560
  min_repeat      2
#  suppress_repeat 2
#  uncomment to suppress unwanted repeats
  toggle_bit_mask 0x0

      begin codes
          KEY_POWER                0xA0
          KEY_VIDEO                0xA1
          KEY_AUDIO                0xA2
          KEY_PRESENTATION         0xA3
          KEY_FAVORITES            0xA4
          KEY_ESC                  0xAD
          KEY_CONTEXT_MENU         0xAC
          KEY_REWIND               0xA5
          KEY_PLAY                 0xA6
          KEY_FASTFORWARD          0xA7
          KEY_INFO                 0xAB
          KEY_NEXT                 0xA8
          KEY_STOP                 0xA9
          KEY_AGAIN                0xAA
          KEY_LEFT                 0xE8
          KEY_RIGHT                0xE4
          KEY_UP                   0xE5
          KEY_DOWN                 0xE6
          KEY_ENTER                0xE7
      end codes

end remote

This is my Lircmap.xml:
Code:
<lircmap>
        <remote device="myremote">
                <left>KEY_LEFT</left>
                <right>KEY_RIGHT</right>
                <up>KEY_UP</up>
                <down>KEY_DOWN</down>
                <back>KEY_ESC</back>
                <play>KEY_PLAY</play>
                <stop>KEY_STOP</stop>
                <forward>KEY_FORWARD</forward>
                <reverse>KEY_REWIND</reverse>
                <skipplus>KEY_NEXT</skipplus>
                <skipminus>KEY_AGAIN</skipminus>
                <power>KEY_POWER</power>
                <myvideo>KEY_VIDEO</myvideo>
                <mymusic>KEY_AUDIO</mymusic>
                <mypictures>KEY_PRESENTATION</mypictures>
                <browser_fovorites>KEY_FAVORITES</browser_favorites>
                <menu>KEY_CONTEXT_MENU</menu>
                <enter>KEY_ENTER</enter>
        </remote>
</lircmap>

And this is my keyboard.xml:
Code:
<keymap>
  <global>
    <remote>
      <play>Play</play>
      <pause>Pause</pause>
      <stop>Stop</stop>
      <forward>FastForward</forward>
      <reverse>Rewind</reverse>
      <left>Left</left>
      <right>Right</right>
      <up>Up</up>
      <down>Down</down>
      <enter>Select</enter>
      <back>Back</back>
      <menu>ContextMenu</menu>
      <info>Info</info>
      <power>XBMC.ActivateWindow(ShutdownMenu)</power>
      <myvideo>XBMC.ActivateWindow(MyVideos)</myvideo>
      <mymusic>XBMC.ActivateWindow(MyMusic)</mymusic>
      <mypictures>XBMC.ActivateWindow(MyPictures)</mypictures>
      <browser_favorites>XBMC.ActivateWindow(Favourites)</browser_favorites>
      <skipplus>BigStepForward</skipplus>
      <skipminus>BigStepBack</skipminus>
    </remote>
  </global>
</keymap>


Thanks in advance.

The solution in my case was:
1- create a lircd.conf with the Lirc_keynames as the one above.
2- create a remote.xml file with the desired mapping and put it into ~/.xbmc/userdata/keymaps/ as the one named keyboard.xml presented above.
3- create a Lircmap.xml file with the device name set to "devinput" and put it into ~/xbmc/userdata/

I don't really understand why in this way it works, however I suppose it is something regarding the Raspbmc configuration which maps the remote to the standard linux mapping but it is only a suspect. Someone probably could explain it better than me.
Reply
#2
I think I recently figured out the answer to your question: It appears that for whatever reason, Raspbian XBMC ignores the latter 2 files (i.e., your remote.xml and your Lircmap.xml).

I've tried a bunch of things and found that pretty much whatever mapping I put into the lircd.conf (i.e., the text-names) for the different IR codes/buttons determine the functionality.

E.g., I tried naming a key "KEY_UP" and then mapping it to down, play, etc. and no matter what I did in Lircmap.xml, it continued acting as if it were KEY_UP. Same thing for KEY_VOLUMEUP, KEY_VOLUMEDOWN. Then I got bored and gave up.

Best of luck and I hope this helps save someone some time... I wasted a ton. This article I found to be the most helpful for the Apple Remote version of this question:

http://wiki.xbmc.org/index.php?title=Apple_remote

Specifically--the key names in the lircd.conf (which I of course had to instead put in my home directory and set the setting in XBMC/Raspbian settings to use it).
Reply
#3
simply changing assigning the KEY_TITLE in lircd.conf works

I have no idea why this works, and KEY_CONTEXT_MENU doesn't but it does.
Reply

Logout Mark Read Team Forum Stats Members Help
Raspberry Pi and Lircmap.xml0