Trying to setup a custom key map to use LIRC.Send(command)

I have a bluetooth remote that I’ve been using with my Vero4K almost a year now.

It has Vol+ and Vol- buttons that, unfortunately, are not directly re-learnable.

So I’m trying to modify my keymap file:

/home/osmc/.kodi/userdata/keymap/gen.xml

<keymap>
            <global>
                    <keyboard>
                            <key id="61654">contextmenu</key>
                            <key id="61620">stop</key>
                            <key id="61572">pageup</key>
                            <key id="61573">pagedown</key>
                            <key id="61626">stepforward</key>
                            <key id="61627">stepback</key>
                            <key id="61637">fastforward</key>
                            <key id="61636">rewind</key>
                            <key id="61630">showsubtitles</key>
                            <key id="61675">osd</key>
                            <key id="61623">LIRC.Send(SEND_ONCE Yamaha_RAV337 KEY_MUTE)</key>
                            <key id="61625">LIRC.Send(SEND_ONCE Yamaha_RAV337 KEY_VOLUMEUP)</key>
                            <key id="61624">LIRC.Send(SEND_ONCE Yamaha_RAV337 KEY_VOLUMEDOWN)</key>
                </keyboard>
        </global>
</keymap>

…so that when kodi receives the key press, it will send the IR single to my AV Receiver to up/down the value.

I have modified the file: /etc/lirc/lircd.conf to include my Yamaha_RAV337 device:

begin remote
  name           Yamaha_RAV337
  bits           16
  flags          SPACE_ENC|CONST_LENGTH|REVERSE
  eps            30
  aeps           100

  header         8853  4532
  one            533  1714
  zero           533   589
  ptrail         533
  pre_data_bits  16
  pre_data       0x857A
  gap            107903
  toggle_bit     0

  begin codes
    SYSTEM_POWER             0x000000000000E21D
    KEY_VOLUMEUP             0x000000000000E51A        #  Was: VOL+
    KEY_VOLUMEDOWN           0x000000000000E41B        #  Was: VOL-
    KEY_MUTE                 0x000000000000E31C        #  Was: MUTE
    KEY_UP                   0x0000000000006798        #  Was: UP
    KEY_DOWN                 0x0000000000006699        #  Was: DOWN
    KEY_LEFT                 0x000000000000AC53        #  Was: LEFT
    KEY_RIGHT                0x000000000000AD52        #  Was: RIGHT
    KEY_ENTER                0x00000000000055AA        #  Was: RETURN
    ZONE2_SYSTEM_POWER       0x0000000000045BA
    ZONE2_VOL+               0x0000000000025DA
    ZONE2_VOL-               0x0000000000024DB
    ZONE2_MUTE               0x0000000000023DC
  end codes
end remote

…rebooted, and turned on debugging.

I get the following in my kodi.out:

22:27:40.285 T:4078092880   DEBUG: -------------Keyboard keyevent----------------
22:27:40.285 T:4078092880   DEBUG: CLinuxInputDevice::KeyEvent: TranslateKey with event type 0x0001, code 0x0073, value 0x0001 returned XBMCKey = 0x00af
22:27:40.285 T:4078092880   DEBUG: CLinuxInputDevice::KeyEvent: keyMods 0x0000 kbMods 0x0000 keyMapTable 0x0000
22:27:40.285 T:4078092880   DEBUG: CLinuxInputDevice::GetKeymapEntry table 0x0000 code 0x0073 value returned by KeyboardReadValue 0x011b
22:27:40.286 T:4078092880   DEBUG: CLinuxInputDevice::GetKeymapEntry values after KeyboardGetSymbol ktyp=0x00 kval=0x00
22:27:40.286 T:4078092880   DEBUG: Keyboard: scancode: 0x73, sym: 0x00af, unicode: 0x0000, modifier: 0x0
22:27:40.286 T:4078092880   DEBUG: OnKey: volume_up (0xf0b9) pressed, action is LIRC.Send(SEND_ONCE Yamaha_RAV337 KEY_VOLUMEUP)

But my receiver isn’t receiving a signal.

I tried a manual test via:

irsend -d /dev/lirc0 SEND_ONCE Yamaha_RAV337 KEY_VOLUMEUP

but I get errors:

irsend: could not connect to socket
irsend: Connection refused

Anyone have any ideas?

irsend -d /dev/lirc0 SEND_ONCE Yamaha_RAV337 KEY_VOLUMEUP

On what device are you trying this?

It has Vol+ and Vol- buttons that, unfortunately, are not directly re-learnable.

Any BT device can be remapped via eventlircd.

Device: Vero4k

When running irsend I assume you are trying to use the built in IR transmitter.

See Vero 4K + IR Queries

Yes, the internal IRblaster. So based on the link, you’re saying that the internal IRblaster isn’t usable on the Vero4k?

I’ve tried it two ways:

Via kodi key mapping:
LIRC.Send(SEND_ONCE Yamaha_RAV337 KEY_VOLUMEDOWN)

and manually via:
irsend -d /dev/lirc0 SEND_ONCE Yamaha_RAV337 KEY_VOLUMEUP

…neither worked.

So just a follow-up:

Kodi uses the irsend binary, correct? Since I have everything configured via kodi, if a future release contains a Vero4K compatible irsend binary, can I assume it should just start working then?

THANKS!
-Zac

Nothing in OSMC presently uses the IR blaster at all.
There’s been some discussion about running an ir-send service in the past.

The problem isn’t the binary, but rather that ir-send isn’t able to communicate with the IR blaster via a compatible interface.

In the future, given enough demand, we’ll either:

  • add meson_irblaster module, which will provide an ioctl like interface for blasting. This will be ab it cumbersome but we expect those who plan to send IR signals will be happy to write a script
  • integrate ir-send support by providing a compatible hardware kernel module

Cheers

Sam