PS3 BD Remote Setup primer

  • Hi. I've just arrived at LibreELEC (generic) after I found out that Kodi Matrix on Windows 10 refuses to have hardware acceleration (it crashes) with my Nvidia ION HTPC.

    Back on Windows 7 I used PS3BluMote to support my PS3 BD Remote and it worked very well. When I installed LE10 I was very happy to find out the remote was supported; but I'd like to change some key assignments and add others and I'm at a loss.

    I tried to use the Keymap Editor plugin and it doesn't work.

    I don't know if I should activate Lirc and create a lircmap.xml, or something else. Should I follow the Wiki instructions for IR Remotes? I can do basic Linux stuff, I already tried getting the key events for some buttons and forcing them manually into Keymap Editor's gen.xml but I doesn't work.

    I just need a primer, or a map, of how the PS3 BD Remote is configured. I think I can do the rest myself.

    Thank you

  • You can do that without a keymap editor by creating keyboard.xml at /storage/.kodi/userdata/keymaps.

    Then you can re-map action ID's to other functions, like red remote button to mute audio volume:

    Code
    <keymap>
        <global>
            <keyboard>
                <red>mute</red>
            </keyboard>
        </global>
    </keymap>
  • Thanks. When I press the "Red" key, what I get in /storage/.kodi/temp/kodi.log is:

    Code
    2022-01-29 15:20:36.933 T:847     DEBUG <general>: LIRC: - NEW 18e 0 KEY_RED devinput (KEY_RED)
    2022-01-29 15:20:36.976 T:842     DEBUG <general>: HandleKey: 251 (0xfb, obc4) pressed, action is ActivateWindow(TVChannels)

    I suspect that it's the HandleKey line that is showing the button assignment, and if someone can point me to where exactly is the LibreELEC-specific file where the PS3 BD is being configured so I can infer how things are set up, it would help me a lot.

    However, many keys look the same to HandleKey, like these two:

    Code
    2022-01-29 15:22:36.742 T:847     DEBUG <general>: LIRC: - NEW 165 0 KEY_OPTION devinput (KEY_OPTION)
    2022-01-29 15:22:36.751 T:842     DEBUG <general>: HandleKey: 0 (0x00, obc255) pressed, action is
    2022-01-29 15:22:38.977 T:847     DEBUG <general>: LIRC: - NEW 177 0 KEY_ASPECT_RATIO devinput (KEY_ASPECT_RATIO)
    2022-01-29 15:22:38.992 T:842     DEBUG <general>: HandleKey: 0 (0x00, obc255) pressed, action is

    Even though LIRC recognizes them as different keys (and actually names them perfectly), they are both given the same UniversalRemote OriginalButtonCode (obc255). Are these buttons assignable?

    Thank you

    Edit: I found /etc/eventlircd.d/ps3remote.evmap - this looks to me to be a translation map from LIRC keys to Kodi keys:

    KEY_EJECTCD = KEY_EJECT # Eject

    And if I press Eject on the remote I get this on kodi.log:

    2022-01-29 15:47:59.793 T:847 DEBUG <general>: LIRC: - NEW a1 0 KEY_EJECTCD devinput (KEY_EJECTCD)

    2022-01-29 15:47:59.807 T:842 DEBUG <general>: HandleKey: config (0xeb) pressed, action is EjectTray()

    What's the format of ps3remote.evmap? <key_LIRC> = <key_Kodi>? The other way around? Something else?

    Edited once, last by TJSilva: Added more information (January 29, 2022 at 3:53 PM).

  • I used this remote but the main issue on LE for me was really quick battery drain.

    Please tell if you get different experience..

    At least with LE 10.0.1 (Generic), I get the opposite, the BD Remote disconnects really quickly I and most of the time I have to hit a button twice; I don't mind, it saves battery.

    Thank you for the help, Da Flex, I had that page open and trying to understand it. AFAICT, /etc/eventlircd.d/ps3remote.evmap is translating between the raw event button codes (that can be examined by dumping the detected /dev/input/eventXX events with .kodi/addons/virtual.system-tools/bin/evtest) into button codes paired with Kodi buttons (<Kodi button>Lirc button</Kodi button>) configured at /usr/share/kodi/system/Lircmap.xml

    I tried overriding that Lircmap.xml by creating an alternative at /storage/.kodi/userdata/Lircmap.xml (<lircmap><remote device="devinput"><kodi>Lirc</kodi></remote></lircmap>) and it didn't work.

    I tried overriding the evmap by creating a /storage/.config/eventlirc.d/ps3remote.evmap and it also didn't work.

    In all cases, whatever I change isn't picked up after a reboot, it still uses the default configuration.

    /etc/ is supposed to be read-only and I should only override it at /storage/.config, correct?

    Thank you.

  • I tried overriding that Lircmap.xml by creating an alternative at /storage/.kodi/userdata/Lircmap.xml (<lircmap><remote device="devinput"><kodi>Lirc</kodi></remote></lircmap>) and it didn't work.

    That's not what post #2 says. Use the correct file name. This approach works independent of the source (LIRC, CEC, joystick etc.).

    • create /storage/.kodi/userdata/keymaps/keyboard.xml (or /storage/.kodi/userdata/keymaps/remote.xml with <remote> instead of <keyboard> inside the file - both variants should work)
    • add the mappings from ps3remote.evmap
  • I get the opposite, the BD Remote disconnects really quickly I and most of the time I have to hit a button twice; I don't mind, it saves battery.

    IIRC, there is an option in LE for BT devices to disable auto-disconnect. Try submenu on connected PS3 remote, or similar.

  • That's not what post #2 says. Use the correct file name. This approach works independent of the source (LIRC, CEC, joystick etc.).

    • create /storage/.kodi/userdata/keymaps/keyboard.xml (or /storage/.kodi/userdata/keymaps/remote.xml with <remote> instead of <keyboard> inside the file - both variants should work)
    • add the mappings from ps3remote.evmap

    Well, for a start I'd like to override many /etc/eventlircd.d/ps3remote.evmap remappings, especially the one that maps KEY_CONTEXT_MENU to KEY_EPG; habits of 10 years are hard to sweep away.

    From evtest and some time looking at the kodi log while pressing the BD Remote's buttons, I got this .evmap to make sense between key events and the BD Remote buttons:

    Display Spoiler

    This .evmap doesn' t remap anything to anything and AFAICT would be exactly the same as an empty /etc/eventlircd.d/ps3remote.evmap; from here, I was going to try to do my own remappings in the middle column to the Kodi_actions/Lirc_button pairs in /usr/share/kodi/system/Lircmap.xml. What you're telling me is that it wouldn't work and I can't override /etc/eventlircd.d/ps3remote.evmap - I have to keep two (three?) layers of indirection in my head from /dev/input/eventXX button codes to ps3remote.evmap remaps to Lircmap.xml kodi buttons to /storage/.kodi/userdata/keymaps/keyboard.xml Kodi actions?

    I'm probably too dumb to be able do that. But if you tell me that's the only way, I'll get a paper and pencil and start drawing arrows.

    Thank you for the help