Bluetooth controllers are not working

Bluetooth controllers are still not working in the CE S905 build. It seems to be a low level system problem (kernel or bluez). The same controllers used to work fine on WeTek Play 1 OE 6.0 builds with even older amlogic-3.10 kernel. This breaks Retroplayer :wink:

The controllers work via USB but not via bluetooth. I can successfully pair and connect the controller via bluetooth, I can see it in Peripherals (with deadzone settings etc.), I can see it detected in kodi.log, I can get key presses in keyboard emulation mode and in mouse emulation mode but in default joystick mode I don’t get any key press events at all (It is generic bluetooth gamepad Terios S3).

The device node /dev/input/js0 is created when the controller is connected over bluetooth however there are no output when running cat /dev/input/js0 and pressing buttons on the controller. The same test works on an old OE 6.0 WeTek Play 1 build (you can see the key presses).

This issue was reported and discussed before, more details here: https://forum.libreelec.tv/thread/7538-bluetooth-controller-not-working-properly-in-libreelec-on-attempted-devices/.

Found the solution here:

Quick solution:
nano /storage/.config/udev.rules.d/99-terios.rules

Copy this line and replace “Gamepad” with your device name:
SUBSYSTEM=="input", ATTRS{name}=="Gamepad", KERNEL=="event*", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"

Then reload udev:
udevadm trigger

2 Likes

I have very similar problem to this. The bluetooth gamepad labelled “Gamepad” doesn’t work as expected. It works in Ubuntu but I cannot get it working under CoreELEC. I pair it and then it behaves only as keyboard and mouse so I can move by mouse pointer when moving left analog stick.

IMO the problem is in driver/udev which assigns handlers. See this:

I: Bus=0005 Vendor=1949 Product=0402 Version=011b
N: Name=“Gamepad”
P: Phys=00:1a:7d:da:71:13
S: Sysfs=/devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1:1.0/bluetooth/hci0/hci0:70/0005:1949:0402.0006/input/input9
U: Uniq=15:84:28:81:63:25
H: Handlers=kbd mouse0 js0 event3
B: PROP=0
B: EV=12001f
B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 ffff0000 70001 130f93 8b17c007 ffff7bfa d9415fff febeffdf ffefffff ffffffff fffffffe
B: REL=143
B: ABS=1 30627
B: MSC=10
B: LED=1f

Don’t you know how to configure udev the way that kbd and mouseX devices are not created for the gamepad?

I have another gamepad which works OK and this is how it looks in devices list:

I: Bus=0005 Vendor=0000 Product=0000 Version=011b
N: Name=“Hama CreeDroid”
P: Phys=00:1a:7d:da:71:13
S: Sysfs=/devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1:1.0/bluetooth/hci0/hci0:69/0005:0000:0000.0007/input/input10
U: Uniq=20:73:ab:91:18:6f
H: Handlers=js0 event3
B: PROP=0
B: EV=1b
B: KEY=fff 0 0 0 0 0 0 0 0 0
B: ABS=100 30027
B: MSC=10

The problem is in the Kodi 18 switching to libinput. It handles keyboards and mice but doesn’t handle joysticks so you need to tell the libinput to ignore this device by assigning the LIBINPUT_IGNORE_DEVICE flag to it.

Updated quick solution:
nano /storage/.config/udev.rules.d/99-gamepad.rules

Copy this 2 lines and replace “Gamepad” with your device name (check that the ENV part is kept on the same line and is not wrapped like on the forum):
SUBSYSTEM=="input", ATTRS{name}=="Gamepad", KERNEL=="event*", MODE="0666", ENV{LIBINPUT_IGNORE_DEVICE}="1"

SUBSYSTEM=="input", ATTRS{name}=="Gamepad", KERNEL=="event*", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"

Then reload udev:
udevadm trigger

4 Likes

Thank you, it works!

hi im trying to get a xbox one controller to work via bluetooth, i have it connected after some alterations but no controls work, could this issue also be the source of the problem?, if so im not exactly sure what i should put in the override file and what it should be called (trying to follow the code samples above but im not clear on it).

so the device name is “Xbox Wireless Controller”, would the filename (assuming its important?) be /storage/.config/udev.rules.d/99-gamepad.rules or something else?