Linux Cannot get Kodi react to Lirc
#1
Hello,

I'm on Ubuntu 15.10 if that matters, using Kodi 16. It's my first install, so I don't know if it was OK before.

It seems that Lirc is correctly configured on my machine (eventually!), since irw output correct keys. E.g.,:
Code:
0000000080010160 00 KEY_OK devinput
when pressing the "OK" button on my MCE remote. Also, my .kodi/userdata/Lircmap.xml contains (I've just removed the <?xml opening and header comments) :
Code:
<lircmap>
        <remote device="devinput">
                <!-- new kernel-based lirc button names -->
                <eject>KEY_EJECTCD</eject>
                <left>KEY_LEFT</left>
                <right>KEY_RIGHT</right>
                <up>KEY_UP</up>
                <down>KEY_DOWN</down>
                <select>KEY_OK</select>
                <start>KEY_HOME</start>
                <back>KEY_EXIT</back>
                <record>KEY_RECORD</record>
                <play>KEY_PLAY</play>
                <pause>KEY_PAUSE</pause>
                <stop>KEY_STOP</stop>
                <forward>KEY_FORWARD</forward>
                <reverse>KEY_REWIND</reverse>
                <volumeplus>KEY_VOLUMEUP</volumeplus>
                <volumeminus>KEY_VOLUMEDOWN</volumeminus>
                <pageplus>KEY_CHANNELUP</pageplus>
                <pageminus>KEY_CHANNELDOWN</pageminus>
                <skipplus>KEY_NEXT</skipplus>
                <skipminus>KEY_AGAIN</skipminus>
                <mute>KEY_MUTE</mute>
                <power>KEY_POWER</power>
                <myvideo>KEY_VIDEO</myvideo>
                <mymusic>KEY_AUDIO</mymusic>
                <livetv>LiveTV</livetv>
                <guide>KEY_EPG</guide>
                <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>
                <red>KEY_RED</red>
                <green>KEY_GREEN</green>
                <yellow>KEY_YELLOW</yellow>
                <blue>KEY_BLUE</blue>
                <menu>KEY_DVD</menu>
                <clear>KEY_CLEAR</clear>
                <enter>KEY_ENTER</enter>
        </remote>
</lircmap>
the remote name (devinput) matches the one defined in lirc and shown in irw output just above.
Some of the keys work in Kodi (such as LEFT, RIGHT, UP, DOWN, ENTER, VOLUME_UP...), but not all. Actually, it seems that my settings are just ignored, since <select> seems to be mapped to KEY_ENTER instead! My .kodi/userdata/keymaps/remote.xml contains "standard" definition. For instance, up to "Select" action:
Code:
<keymap>
  <global>
    <remote>
      <play>PlayPause</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>
      <select>Select</select>
   ...
"Select" action should be triggered by "select" key, which is bound to "KEY_OK" in Lircmap.xml. Which is not the case...

So, what am I doing wrong? How could I get intermediate information to figure out what is not correctly set?

Thanks!

PS - I've just swapped KEY_LEFT and KEY_RIGHT in Lircmap.xml, and it confirms that this file is just ignored since those keys are still correctly interpreted...
Reply
#2
Are you sure that your input device is correct ?

On my machine, input is /dev/lirc0 .

Anyway, despite that, have you defined your remote in /etc/lirc/hardware.conf ?

For reference, this is my hardware.conf

PHP Code:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="pioneer-dvr"
REMOTE_MODULES=""
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
REMOTE_SOCKET=""
TRANSMITTER_SOCKET="" 

There is then a file (/etc/lirc/lircd.conf) which maps the codes from the remote to button names. I've included a small sample from the beginning of the file.

PHP Code:
begin remote

  name  pioneer
-dvr
  bits           32
  flags SPACE_ENC
|CONST_LENGTH
  eps            30
  aeps          100

  header       8476  4198
  one           551  1538
  zero          551   493
  ptrail        545
  gap          90158
  toggle_bit_mask 0x0

      begin codes
          KEY_ENTER                0xD52A34CB 0xF50AF708
          KEY_LEFT                 0xD52A34CB 0xF50AC639
          KEY_RIGHT                0xD52A34CB 0xF50A26D9
          KEY_UP                   0xD52A34CB 0xF50A4FB0
          KEY_DOWN                 0xD52A34CB 0xF50ACF30
          KEY_BACK                 0xD52A34CB 0xF50A2FD0
          KEY_MENU                 0xD52A34CB 0xF50A9D62
          KEY_STOP                 0xD52A04FB
          KEY_PLAY                 0xD52A44BB
          KEY_FASTFORWARD          0xD52A24DB
          KEY_REWIND               0xD52AA45B
          KEY_PAUSE                0xD52AC43B
          KEY_NEXT                 0xD52A649B
          KEY_PREVIOUS             0xD52AE41B
          KEY_MENU                 0xD52A34CB 0xF50A9D62 

etc etc - I snipped it because there are a lot of buttons. Then, in ~/.kodi/userdata we have Lircmap.xml which maps those button names to actual actions in kodi.

PHP Code:
<lircmap>
         <
remote device="pioneer-dvr">
        <
play>KEY_PLAY</play>
        <
pause>KEY_PAUSE</pause>
        <
stop>KEY_STOP</stop>
        <
forward>KEY_FASTFORWARD</forward>
        <
reverse>KEY_REWIND</reverse>
        <
left>KEY_LEFT</left>
        <
right>KEY_RIGHT</right>
        <
up>KEY_UP</up>
        <
down>KEY_DOWN</down>
        <
select>KEY_ENTER</select>
        <
info>KEY_C</info>
        <
back>KEY_BACK</back>
        <
title>KEY_MENU</title>
        <
hash>KEY_SETUP</hash>
        <
clear>KEY_HOME</clear>
        <
pageplus>KEY_NUMERIC_3</pageplus>
        <
pageminus>KEY_NUMERIC_9</pageminus>
        <
star>KEY_NUMERIC_5</star>
        <
skipplus>KEY_NEXT</skipplus>
        <
skipminus>KEY_PREVIOUS</skipminus>
        <
zero>KEY_NUMERIC_0</zero>
        <
one>KEY_NUMERIC_1</one>
    </
remote>
</
lircmap

They are the only three files I had to configure to get my remote working.

There is an excellent guide to how it all hangs together and how to configure things here -> http://forum.kodi.tv/showthread.php?tid=170372
Learning Linux the hard way !!
Reply
#3
OK, for whatever reason, the device in Ubuntu is /var/run/lirc/lircd not the default /dev/lircd... So starting kodi with -l /var/run/lirc/lircd does the trick!

Thanks!!
Reply
#4
It's not lircd, it's lirc0 - lircd is a socket, and lirc0 is a character device.

I have set this up on several 'Buntu systems, and never had to use any command line fu starting kodi to get it to work.
Learning Linux the hard way !!
Reply

Logout Mark Read Team Forum Stats Members Help
Cannot get Kodi react to Lirc0