I tried for several days to fix this problem.
Finally came across a posting on Instructables Where a guy was putting a pi into an Altoid tin with Xbian installed for a home media center. (cause you can
)
Find it here:
http://www.instructables.com/id/Raspberry-Pi-2-Media-Center-Kodi-on-XBian/step6/Step-6-Optional-Install-and-configure-infrared-rem/
and also
http://www.msldigital.com/pages/support-for-remote
edit the file: /etc/lirc/hardware/lirc_rpi.conf
nano /etc/lirc/hardware/lirc_rpi.conf
Comment out the line: LIRCD_ARGS="-u"
lircd -u, --uinput
Enable automatic generation of Linux input events. lircd will open /dev/input/uinput and inject key events to the Linux kernel. The key code depends on the name that was given a button in the lircd config file, e.g. if the button is named KEY_1, the '1' key code will be generated. You will find a complete list of possible button names in /usr/include/linux/input.h.
From the explanation it seems to me that when you press a key it injects another keypress via the kernel. Kinda like a feedback loop?
I had tried everything before this delays, ir-keytables etc, etc.
The mystifying thing was that the remote worked in every other raspberry linux I have.
Cheers
Hope this helps.
(11th Aug, 2015 11:58 PM)Colin Burton Wrote: [ -> ]Did you ever find an answer to this? I just setup my remote and encountered the same issue.
I had the same problem and solved it!!
When you are recording keys or you are using a template for your remote, all remote buttons are assigned to a default name listed here:
Terminal
$ irrecord --list-namespace
These names after your remote.conf file is created have to be CHANGED in order to use them properly with KODI.
For example in this xbox.conf file I created for an XBOX remote, I replaced "KEY_" with "xbox_":
Code:
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.9.1-git(default) on Sun Jan 31 11:27:02 2016
#
# contributed by
#
# brand: /home/xbian/xboxtest2.conf
# model no. of remote control:
# devices being controlled by this remote:
#
begin remote
name XBOX
bits 11
flags SPACE_ENC|CONST_LENGTH
eps 30
aeps 100
one 223 7469
zero 223 5012
ptrail 220
gap 123513
toggle_bit_mask 0x200
begin codes
xbox_UP 0x568
xbox_DOWN 0x56A
xbox_LEFT 0x571
xbox_RIGHT 0x561
xbox_ENTER 0x569
xbox_CONTEXT_MENU 0x567
xbox_BACK 0x557
xbox_EXIT 0x570
xbox_VOLUMEUP 0x556
xbox_VOLUMEDOWN 0x555
xbox_PAGEUP 0x572
xbox_PAGEDOWN 0x577
xbox_TEXT 0x550
xbox_FORWARD 0x552
xbox_REWIND 0x551
xbox_PLAY 0x559
xbox_INFO 0x55A
xbox_STOP 0x562
end codes
end remote
Then in your KODI userdata folder create a Lircmap.xml file to map these buttons. Something like that:
Code:
<lircmap>
<remote device="XBOX">
<Up>xbox_UP</Up>
<Down>xbox_DOWN</Down>
<Left>xbox_LEFT</Left>
<Right>xbox_RIGHT</Right>
<Select>xbox_ENTER</Select>
<Back>xbox_BACK</Back>
<menu>xbox_CONTEXT_MENU</menu>
<Stop>xbox_STOP</Stop>
<Play>xbox_PLAY</Play>
<Pause>xbox_PAUSE</Pause>
<Blue>xbox_BLUE</Blue>
<Red>xbox_RED</Red>
<reverse>xbox_REWIND</reverse>
<forward>xbox_FORWARD</forward>
<subtitle>xbox_TEXT</subtitle>
<title>xbox_INFO</title>
<info>xbox_GUIDE</info>
<mute>xbox_MUTE</mute>
<power>xbox_POWER</power>
<myvideo>xbox_FAV</myvideo>
<volumeplus>xbox_VOLUMEUP</volumeplus>
<volumeminus>xbox_VOLUMEDOWN</volumeminus>
</remote>
</lircmap>
Please note that these names like "volumeminus" are predifined by Kodi. You can find a list here:
XBMC/Lircmap
Finally, in your userdata/keymaps folder create a keymap.xml file to map those buttons to real KODI actions. Your keymap.xml should look something like this:
Code:
<keymap>
<fullscreenvideo>
<remote>
<subtitle>ActivateWindow(subtitlesearch)</subtitle>
<Select>PlayPause</Select>
<reverse>SubtitleDelayMinus</reverse>
<forward>SubtitleDelayPlus</forward>
</remote>
</fullscreenvideo>
<global>
<remote>
<Up>Up</Up>
<Down>Down</Down>
<Left>Left</Left>
<Right>Right</Right>
<Select>Select</Select>
<Back>Back</Back>
<menu>contextmenu</menu>
<Stop>Stop</Stop>
<Play>Play</Play>
<Pause>Pause</Pause>
<Blue>FullScreen</Blue>
<Red>ActivateWindow(weather)</Red>
<title>Info</title>
<info>Info</info>
<mute>Mute</mute>
<power>noop</power>
<myvideo>ActivateWindow(favourites)</myvideo>
<skipminus>noop</skipminus>
<volumeplus>VolumeUp</volumeplus>
<volumeminus>VolumeDown</volumeminus>
</remote>
</global>
<slideshow>
<remote>
<forward>ZoomIn</forward>
<reverse>ZoomOut</reverse>
</remote>
</slideshow>
<weather>
<remote>
<Red>Back</Red>
</remote>
</weather>
</keymap>
More info about the above file can be found here:
KODI/keymaps[/term][/quote]
p.s. You don't need to create an advancedsettings.xml file, but if you create it anyway, it will function properly regarding repeat and delay times
@
jvig
Nice info, well explained, thanks - maybe you could add it to the wiki page of xbian for all to find.
Skywatch.
@
jvig, perfect timing! Just today I sat down to try and figure out why the remote I was working with had doubled up button presses. This is my first time working with an IR receiver connected to the RPi GPIO. Your solution worked for me as well! I opted to go with "kodi_" instead of "xbox_" in the names as I think this is more working around a problem with the software (Kodi/Xbian/lirc, not sure where) than the remote itself. Good find! From previous attempts I still have the lirc_rpi.conf file edited to comment out "LIRCD_ARGS="-u"" and I haven't yet uncommented that to see if it breaks anything with your fix.
I'll note that I didn't need to do anything with keymap.xml. It seems all the mapping is picked up from remote.xml in /usr/local/share/kodi/system/keymaps. So just created the lircd.conf file with unique key names, then set up the Lircmap.xml file.
Thanks for the detail on your discovery!