Has Bluetooth Remote handling changed in NG-21.2?

Setup is Cube + 21.2-Omega_nightly_20250122 (Amlogic-ng.arm) + Sony PS3 Bluetooth Remote.

Prior to 21.2, I had this working fine by following the instructions for setting up a bluetooth remote and it was working as expected.

~/.config/hwdb.d/99-ps3-bd-remote.hwdb
# Sony BD Remote Control
evdev:input:b0005v054Cp0306*
 KEYBOARD_KEY_90081=f2
 KEYBOARD_KEY_90082=f3
 KEYBOARD_KEY_90080=f4
 KEYBOARD_KEY_90083=f5
~/.kodi/userdata/keymaps/custom.xml
<keymap>
  <FullscreenVideo>
    <keyboard>
      <f2>PlayerProcessInfo</f2>
      <f3>PlayerDebug</f3>
      <f4>AspectRatio</f4>
      <f5>System.Exec(/storage/downloads/resync.sh)</f5>
    </keyboard>
  </FullscreenVideo>
</keymap>

However, after upgrading using the nightlies, these keys are no longer working. Trying to follow the guide again to set it up doesn’t change anything. In fact, using evtest fails - it says the device is grabbed by another process (/usr/sbin/eventlircd).

The logs are also different for a keypress. Previously, it would show for example

2024-11-11 15:34:45.771 T:4103    debug <general>: Keyboard: scancode: 0x67, sym: 0x111 (up), unicode: 0x00, modifier: 0x0
2024-11-11 15:34:45.771 T:4103    debug <general>: HandleKey: up (0xf080) pressed, window 10003, action is Up

but now it shows

2025-01-23 18:07:02.693 T:4092    debug <general>: LIRC: - NEW 3c 0 KEY_F2 devinput (KEY_F2)
2025-01-23 18:07:02.733 T:4087    debug <general>: HandleKey: 0 (0x0, obc255) pressed, window 12005, action is

I am wondering if a new system is in use and what I would need to modify to get this working again. Thanks.

LIRC is for IR control, it’s used by Mesor-IR & the ir-blaster. Meson-IR is automatically loaded, unless you have a remote.conf file present under /storage/.config/.

remote.conf loads the amremote driver instead, which doesn’t used LIRC.

I’m not sure why you are your evtest for Bluetooth is returning LIRC related information, Bluetooth should be independent.

Did you previously have a remote.conf file present, and now it’s gone, switching CE back to loading the meson-ir driver?

What CE version were you on prior to updating to CE-NG 21.2?

Yes, I do have a remote.conf under /storage/.config/ but this is for an old tiny Apple remote that works over IR.

I have been on the nightlies for a long time (since 20.5/21), I would get updates almost everyday. This issue seemed to start happening after the switch to 21.2.

Also the evtest is not returning LIRC related information, it’s saying it cannot run because the device is in use by another process (eventlircd). I can stop eventlircd and then evtest will read the keys from the Sony PS3 BT Remote normally. Those logs were from Kodi. Additionally it seems to be remapping some keys as some of them are performing different actions than they use to (for example, the PS key in the middle is being mapped to KEY_MEDIA as seen in the log when it should be KEY_HOMEPAGE).

It sounds like LIRCD is grabbing the bluetooth device, but it shouldn’t be, and in the past it wasn’t. LIRCD should only grab IR devices. Will need to look into what might have changed recently.

As a temporary fix you can disable LIRCD
systemctl stop lircd
systemctl mask lircd

It won’t load again until you unmask it (systemctl unmask lircd). Amremote doesn’t need LIRCD, so your Apple remote will continue to work.

EDIT: can you do a journalctl | paste after LIRCD has grabbed the BT device, and post it.

https://paste.coreelec.org/AmnesiaBarge

I’m thinking this might be related - https://github.com/CoreELEC/CoreELEC/commit/235d2148649d56f38501bf38ba28e40a30fff35a

Looks promising. How about if you replace that file with the older version and reboot. Does the controller work as it did before.

Put this older version in /storage/.config/udev.rules.d
98-eventlircd.rules (8.9 KB)

This was the reasoning behind that commit
https://github.com/LibreELEC/LibreELEC.tv/issues/9586

Assuming, applying the old dev rules works for you, this commit can be reverted in CE to work prior to that commit.

Sorry I can’t get an answer for you at this moment, I will test it when I get a chance. Thank you.

However, after reading the issue you posted, I am wondering if that is actually the correct approach. Actually, the reason I remapped the RED, GREEN, BLUE, YELLOW buttons to F2 - F5 in the hwdb from my initial post was because they were not being picked up in Kodi and I’m guessing the real issue is actually what is being described in that GitHub issue.

(Of course, I probably could have avoided this whole thing if I just used different keys on the remote :rofl: but I just wanted them all aligned in one row)

I don’t clearly understand the impact of having eventlircd handle the BT device, it may mean that your mapping just can’t be done through a hwdb file. When you get to it, see if the Kodi keymap editor is now able to detect those PS3 buttons

Placing that file does return the remote to the old behaviour. Thank you.

2025-01-24 19:27:14.728 T:4063    debug <general>: Keyboard: scancode: 0x3c, sym: 0x11b (f2), unicode: 0x00, modifier: 0x0
2025-01-24 19:27:14.728 T:4063    debug <general>: HandleKey: f2 (0xf091) pressed, window 10016, action is

I tested this out after removing my 99-ps3-bd-remote.hwdb changes and the old 98-eventlircd.rules. Now the RED button is clearly being picked up by Kodi.

2025-01-25 15:41:36.163 T:4067    debug <general>: LIRC: - NEW 18e 0 KEY_RED devinput (KEY_RED)
2025-01-25 15:41:36.205 T:4062    debug <general>: HandleKey: 251 (0xfb, obc4) pressed, window 10016, action is ActivateWindow(TVChannels)

Following along from here https://kodi.wiki/view/LIRC, Lircmap.xml, and remote.xml, we can see that it is correctly reading and performing the action <red>ActivateWindow(TVChannels)</red> correctly.

So the question is, moving forward, will the 98-eventlircd.rules be reverted or should we adjust to this new approach?

That change only affected 4 BT devices (Nintendo Wii Remote, BD Remote Control, PS3 BD Remote Version 2, Amazon Fire TV stick). It’s up to you, I think you are the first to mention a problem.

Yes, you’re right. I think I will keep it functioning as I had it and use the old 98-eventlircd.rules. Thank you very much for your help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.