GPIO LIRC Button Mapping
#1
I am trying to customize my xbox 360 remote on GPIO receiver on the raspberry Pi running Raspbmc. I have successfully customized some buttons however some will not change!

My lircd.conf:

Code:
# Please make this file available to others
# by sending it to <[email protected]>
#
# this config file was automatically generated
# using lirc-0.9.0-pre1(default) on Sat Feb 23 12:47:57 2013
#
# contributed by DynaMight
#
# brand: Xbox 360 remote (White)          /home/pi/lircd.conf
# model no. of remote control:
# devices being controlled by this remote:
#

begin remote

  name  /home/pi/lircd.conf
  bits           13
  flags RC6|CONST_LENGTH
  eps            30
  aeps          100

  header       2685   886
  one           457   433
  zero          457   433
  pre_data_bits   24
  pre_data       0x1BFF80
  gap          107197
  toggle_bit_mask 0x8000
  rc6_mask    0x100000000
# gap 140000  
# min_repeat 1
suppress_repeat 5

      begin codes
          KEY_STOP                 0x0BE6
          KEY_PLAY                 0x0BE9
          KEY_VOLUMEDOWN           0x0BEE
          KEY_VOLUMEUP             0x0BEF
          KEY_MUTE                 0x0BF1
          KEY_0                    0x0BFF
          KEY_1                    0x0BFE
          KEY_2                    0x0BFD
          KEY_3                    0x0BFC
          KEY_4                    0x0BFB
          KEY_5                    0x0BFA
          KEY_6                    0x0BF9
          KEY_7                    0x0BF8
          KEY_8                    0x0BF7
          KEY_9                    0x0BF6
          KEY_MENU                 0x0BDB
          KEY_LANGUAGE             0x0BD9
          KEY_VOLUMEDOWN           0x0B97
          KEY_VOLUMEDOWN           0x0BEC
          KEY_VOLUMEUP             0x0B99
          KEY_VOLUMEUP             0x0BED
          KEY_MUTE                 0x0BDA
          KEY_REWIND               0x0BEA
          KEY_PLAYPAUSE            0x0BE9
          KEY_FASTFORWARD          0x0BEB
          KEY_BACK                 0x0BDC
          KEY_TITLE                 0x0BAE
          KEY_STOP                 0x0BE6
          KEY_INFO                0x0BF0
          KEY_UP                   0x0BE1
          KEY_DOWN                 0x0BE0
          KEY_LEFT                 0x0BDF
          KEY_RIGHT                0x0BDE
          KEY_OK                   0x0BDD
          KEY_POWER                0x0BF3
          KEY_PAGEUP               0x0B93
          KEY_PAGEDOWN             0x0B92
          KEY_ENTER                0x0BF4
          KEY_RECORD               0x0BE8
          KEY_CLEAR                0x0BF5
          KEY_NEXTSONG             0x0BE5
          KEY_PREVIOUSSONG         0x0BE4
          KEY_DISPLAYTOGGLE        0x0BB0
          KEY_PAUSE                0x0BE7
          KEY_HOME                 0x0B9B
          KEY_MEDIA                0x0BF2
          KEY_PAGEDOWN             0x0C
          KEY_PAGEUP               0x0D
      end codes

end remote


section of Lircmap.xml that I am editing (should this reference a common remote name as found in lircd.confHuh) existing lircmap.xml was copied to userdata folder.
Code:
<remote device="linux-input-layer">
    <altname>cx23885_remote</altname>
    <altname>devinput</altname>
        <left>KEY_LEFT</left>
        <right>KEY_RIGHT</right>
        <up>KEY_UP</up>
        <down>KEY_DOWN</down>
        <select>KEY_OK</select>
        <select>KEY_ENTER</select>
        <start>KEY_SELECT</start>
        <start>KEY_MEDIA</start>
        <back>KEY_ESC</back>
        <back>KEY_EXIT</back>
        <back>KEY_BACK</back>
        <back>KEY_CLOSE</back>
        <record>KEY_RECORD</record>
        <play>KEY_PLAY</play>
        <play>KEY_PLAYPAUSE</play>
        <pause>KEY_PAUSE</pause>
                <aspectratio>KEY_DISPLAYTOGGLE</aspectratio>
        <stop>KEY_STOP</stop>
        <stop>KEY_STOPCD</stop>
        <forward>KEY_FASTFORWARD</forward>
        <reverse>KEY_REWIND</reverse>
        <volumeplus>KEY_VOLUMEUP</volumeplus>
        <volumeminus>KEY_VOLUMEDOWN</volumeminus>
        <channelplus>KEY_CHANNELUP</channelplus>
        <channelminus>KEY_CHANNELDOWN</channelminus>
        <skipplus>KEY_NEXTSONG</skipplus>
        <skipminus>KEY_PREVIOUSSONG</skipminus>
        <title>KEY_INFO</title>
        <title>KEY_EPG</title>
        <subtitle>KEY_SUBTITLE</subtitle>
        <language>KEY_LANGUAGE</language>
        <mute>KEY_MUTE</mute>
        <power>KEY_POWER</power>
        <power>KEY_SLEEP</power>
        <myvideo>KEY_VIDEO</myvideo>
        <language>KEY_AUDIO</language>
        <mypictures>KEY_MHP</mypictures>
        <mytv>KEY_TV</mytv>
        <one>KEY_1</one>
        <two>KEY_2</two>
        <three>KEY_3</three>
        <four>KEY_4</four>
        <five>KEY_5</five>
        <six>KEY_6</six>
        <seven>KEY_7</seven>
        <eight>KEY_8</eight>
        <nine>KEY_9</nine>
        <zero>KEY_0</zero>
        <star>KEY_NUMERIC_STAR</star>
        <hash>KEY_NUMERIC_POUND</hash>
        <red>KEY_RED</red>
        <green>KEY_GREEN</green>
        <yellow>KEY_YELLOW</yellow>
        <blue>KEY_BLUE</blue>
        <menu>KEY_MENU</menu>
        <info>KEY_TITLE</info>
        <info>KEY_PROPS</info>
        <start>KEY_HOME</start>
        <display>KEY_ANGLE</display>
        <recordedtv>KEY_PVR</recordedtv>
        <teletext>KEY_TEXT</teletext>
    </remote>


The button in question is "KEY_DISPLAYTOGGLE" and I want this to change the "AspectRatio". Although I have successfully modified other keys this one will not change and I see the following in the xbmc log, which is also confusing because I see "KEY_DISPLAYTOGGLE_UP" which I have seen similarly appended names before, but as ffar as I can see it should be only "KEY_DISPLAYTOGGLE" (WITHOUT "UP")


Code:
21:53:20 T:3040866304   ERROR: Remote Translator: Can't find button aspectratio
21:53:20 T:3040866304   DEBUG: LIRC: Update - NEW at 312629:1af 0 KEY_DISPLAYTOGGLE devinput (KEY_DISPLAYTOGGLE)
21:53:20 T:2725217344    INFO: COMXAudio::ApplyVolume - Volume=0.06 (* 1.00 * 1.00)
21:53:21 T:3040866304    INFO: Previous line repeats 15 times.
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event0
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event1
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event2
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event3
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event4
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event5
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event6
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event7
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event8
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event9
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event10
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event11
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event12
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event13
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event14
21:53:21 T:3040866304   DEBUG: Checking device: /dev/input/event15
21:53:21 T:3040866304   ERROR: Remote Translator: Can't find button aspectratio
21:53:21 T:3040866304   ERROR: Previous line repeats 3 times.
21:53:21 T:3040866304   DEBUG: LIRC: Update - NEW at 313022:1af 0 KEY_DISPLAYTOGGLE_UP devinput (KEY_DISPLAYTOGGLE_UP)
Reply
#2
ERROR: Remote Translator: Can't find button aspectratio

I think you need to define aspectratio in remote.xml and/or keyboard.xml in order for it to work.
If I have been of help, please add to my reputation as a way of saying thanks, it's free.
Reply
#3
So you mean in remote.xml......

<aspectratio>aspectratio<aspectratio> ??

Since aspectratio is already defined in buttontranslator.cpp
https://github.com/xbmc/xbmc/blob/master...slator.cpp
{"aspectratio" , ACTION_ASPECT_RATIO},

this is making less sense when it should make more sense! I guess I am confused.

thanks, Will give it a shot next time I am on the Pi
Reply
#4
I haven't checked how these things are hooked up in XBMC, but I think Dilligaf is right. You're currently mapping your IR signal to a <aspectratio> button, but what this button is supposed to do is not yet defined in remote.xml, so yes, <aspectratio>aspectratio</aspectratio> is probably required in there
Reply
#5
Ok i tried that but since "aspectratio" is probably in the default xml file, I held little hope and sure enough it still does not work, even when in the in the remote.xml file! Other functions work and can be modified. I still see the following while playing a video and using the button that should correspond to "aspectratio"

xbmc.log
Code:
05:16:40 T:3040161792   ERROR: Remote Translator: Can't find button aspectratio
05:16:40 T:3040161792   DEBUG: LIRC: Update - NEW at 1242072:1af 0 KEY_DISPLAYTOGGLE devinput (KEY_DISPLAYTOGGLE)
05:16:40 T:2758775872    INFO: COMXAudio::ApplyVolume - Volume=0.03 (* 1.00 * 1.00)
05:16:40 T:3040161792    INFO: Previous line repeats 5 times.
05:16:40 T:3040161792   ERROR: Remote Translator: Can't find button aspectratio
05:16:40 T:2758775872    INFO: COMXAudio::ApplyVolume - Volume=0.03 (* 1.00 * 1.00)
05:16:40 T:3040161792    INFO: Previous line repeats 5 times.
05:16:40 T:3040161792   ERROR: Remote Translator: Can't find button aspectratio
05:16:40 T:3040161792   ERROR: Previous line repeats 3 times.
05:16:40 T:3040161792   DEBUG: LIRC: Update - NEW at 1242354:1af 0 KEY_DISPLAYTOGGLE_UP devinput (KEY_DISPLAYTOGGLE_UP)

The last line with "DISPLAY_TOGGLE_UP" perplexes me too as I see noting with that name


here is current lirc.conf
Code:
begin remote

  name Xbox360Remote
  bits           13
  flags RC6|CONST_LENGTH
  eps            30
  aeps          100

  header       2685   886
  one           457   433
  zero          457   433
  pre_data_bits   24
  pre_data       0x1BFF80
  gap          107197
  toggle_bit_mask 0x8000
  rc6_mask    0x100000000
# gap 140000  
# min_repeat 1
suppress_repeat 5

      begin codes
          KEY_STOP                 0x0BE6
          KEY_PLAY                 0x0BE9
          KEY_VOLUMEDOWN           0x0BEE
          KEY_VOLUMEUP             0x0BEF
          KEY_MUTE                 0x0BF1
          KEY_0                    0x0BFF
          KEY_1                    0x0BFE
          KEY_2                    0x0BFD
          KEY_3                    0x0BFC
          KEY_4                    0x0BFB
          KEY_5                    0x0BFA
          KEY_6                    0x0BF9
          KEY_7                    0x0BF8
          KEY_8                    0x0BF7
          KEY_9                    0x0BF6
          KEY_MENU                 0x0BDB
          KEY_LANGUAGE             0x0BD9
          KEY_VOLUMEDOWN           0x0B97
          KEY_VOLUMEDOWN           0x0BEC
          KEY_VOLUMEUP             0x0B99
          KEY_VOLUMEUP             0x0BED
          KEY_MUTE                 0x0BDA
          KEY_REWIND               0x0BEA
          KEY_PLAYPAUSE            0x0BE9
          KEY_FASTFORWARD          0x0BEB
          KEY_BACK                 0x0BDC
          KEY_TITLE                 0x0BAE
          KEY_STOP                 0x0BE6
          KEY_INFO                0x0BF0
          KEY_UP                   0x0BE1
          KEY_DOWN                 0x0BE0
          KEY_LEFT                 0x0BDF
          KEY_RIGHT                0x0BDE
          KEY_OK                   0x0BDD
          KEY_POWER                0x0BF3
          KEY_PAGEUP               0x0B93
          KEY_PAGEDOWN             0x0B92
          KEY_ENTER                0x0BF4
          KEY_RECORD               0x0BE8
          KEY_CLEAR                0x0BF5
          KEY_NEXTSONG             0x0BE5
          KEY_PREVIOUSSONG         0x0BE4
          KEY_DISPLAYTOGGLE        0x0BB0
          KEY_PAUSE                0x0BE7
          KEY_HOME                 0x0B9B
          KEY_MEDIA                0x0BF2
          KEY_PAGEDOWN             0x0C
          KEY_PAGEUP               0x0D
      end codes

end remote

Here is the current lircmap.xml
Code:
<!-- This file contains the mapping of LIRC keys to XBMC keys used in Keymap.xml  -->
<!--                                                                              -->
<!-- How to add remotes                                                           -->
<!-- <remote device="name_Lirc_calls_the_remote">                                 -->
<!--                                                                              -->
<!-- For the commands the layout following layout is used                         -->
<!-- <XBMC_COMMAND>LircButtonName</XBMC_COMMAND>                                  -->
<!--                                                                              -->
<!-- For a list of XBMC_COMMAND's check out the <remote> sections of keymap.xml   -->

<lircmap>
    <remote device="Xbox360Remote">
    <altname>cx23885_remote</altname>
    <altname>devinput</altname>
        <left>KEY_LEFT</left>
        <right>KEY_RIGHT</right>
        <up>KEY_UP</up>
        <down>KEY_DOWN</down>
        <select>KEY_OK</select>
        <select>KEY_ENTER</select>
        <start>KEY_SELECT</start>
        <start>KEY_MEDIA</start>
        <back>KEY_ESC</back>
        <back>KEY_EXIT</back>
        <back>KEY_BACK</back>
        <back>KEY_CLOSE</back>
        <record>KEY_RECORD</record>
        <play>KEY_PLAY</play>
        <play>KEY_PLAYPAUSE</play>
        <pause>KEY_PAUSE</pause>
                <aspectratio>KEY_DISPLAYTOGGLE</aspectratio>
                <aspectratio>KEY_DISPLAYTOGGLE_UP</aspectratio>
        <stop>KEY_STOP</stop>
        <stop>KEY_STOPCD</stop>
        <forward>KEY_FASTFORWARD</forward>
        <reverse>KEY_REWIND</reverse>
        <volumeplus>KEY_VOLUMEUP</volumeplus>
        <volumeminus>KEY_VOLUMEDOWN</volumeminus>
        <channelplus>KEY_CHANNELUP</channelplus>
        <channelminus>KEY_CHANNELDOWN</channelminus>
        <skipplus>KEY_NEXTSONG</skipplus>
        <skipminus>KEY_PREVIOUSSONG</skipminus>
        <title>KEY_INFO</title>
        <title>KEY_EPG</title>
        <subtitle>KEY_SUBTITLE</subtitle>
        <language>KEY_LANGUAGE</language>
        <mute>KEY_MUTE</mute>
        <power>KEY_POWER</power>
        <power>KEY_SLEEP</power>
        <myvideo>KEY_VIDEO</myvideo>
        <language>KEY_AUDIO</language>
        <mypictures>KEY_MHP</mypictures>
        <mytv>KEY_TV</mytv>
        <one>KEY_1</one>
        <two>KEY_2</two>
        <three>KEY_3</three>
        <four>KEY_4</four>
        <five>KEY_5</five>
        <six>KEY_6</six>
        <seven>KEY_7</seven>
        <eight>KEY_8</eight>
        <nine>KEY_9</nine>
        <zero>KEY_0</zero>
        <star>KEY_NUMERIC_STAR</star>
        <hash>KEY_NUMERIC_POUND</hash>
        <red>KEY_RED</red>
        <green>KEY_GREEN</green>
        <yellow>KEY_YELLOW</yellow>
        <blue>KEY_BLUE</blue>
        <menu>KEY_MENU</menu>
        <info>KEY_TITLE</info>
        <info>KEY_PROPS</info>
        <start>KEY_HOME</start>
        <display>KEY_ANGLE</display>
        <recordedtv>KEY_PVR</recordedtv>
        <teletext>KEY_TEXT</teletext>
    </remote>
</lircmap>

and the current remote.xml
Code:
<keymap>
  <fullscreenvideo>>
    <remote>
      <KEY_BACK_UP>Stop</KEY_BACK_UP>
      <KEY_BACK>Stop</KEY_BACK>
      <back>Stop</back>
      <backspace>Stop</backspace>
      <aspectratio>AspectRatio</aspectratio>
    </remote>
  </fullscreenvideo>
</keymap>
Reply
#6
DISPLAY_TOGGLE_UP is just the key being released. Try putting <aspectratio>AspectRatio</aspectratio> in keyboard.xml, some remotes are recognized as keyboards.
If I have been of help, please add to my reputation as a way of saying thanks, it's free.
Reply

Logout Mark Read Team Forum Stats Members Help
GPIO LIRC Button Mapping0