Here’s how I paired my Lakka machine with the Xbox One Bluetooth controller. What I found out is that you need to leave out the “pair” command in bluetoothctl and immediately go for “connect”. The usual pairing and then connecting will not work. I think this might also be why the pairing fails in Retroarch. I had to do it over the command line. You also need to either disable ERTM (using the echo command below) or compile a custom linux kernel with this patch applied.
My system:
- S905X TV Box
- Kernel version 5.8
- Bluetooth adapter: rtl8723bs
- Bluetooth driver: default btrtl (bluetooth.ko) that comes with the kernel
Note: I am using a fairly recent version of the linux kernel. If you’re using a pre-compiled version of Lakka, the linux kernel (and as such the bluetooth drivers) will be older and this might or might not work for you. I just wanted to show that it’s possible.
Here are the commands that I used:
First, purge your bluetooth configuration to make sure nothing interferes:
rm -rf /storage/.cache/bluetooth/*
Then, disable ERTM. This is a hack to fix a bug in the bluetooth driver that will prevent the controller from connecting:
echo 1 > /sys/module/bluetooth/parameters/disable_ertm
Then, pair the controller using the following commands:
Lakka:~ # bluetoothctl
Agent registered
[CHG] Controller E0:B9:4D:30:A7:1B Pairable: yes
[bluetooth]# scan on
Discovery started
[CHG] Controller E0:B9:4D:30:A7:1B Discovering: yes
[NEW] Device 5C:BA:37:8A:28:4A Xbox Wireless Controller
[bluetooth]# connect 5C:BA:37:8A:28:4A
Attempting to connect to 5C:BA:37:8A:28:4A
[CHG] Device 5C:BA:37:8A:28:4A Connected: yes
[CHG] Device 5C:BA:37:8A:28:4A Modalias: usb:v045Ep02E0d0903
[CHG] Device 5C:BA:37:8A:28:4A Modalias: usb:v045Ep02FDd0903
[CHG] Device 5C:BA:37:8A:28:4A UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device 5C:BA:37:8A:28:4A UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device 5C:BA:37:8A:28:4A ServicesResolved: yes
[CHG] Device 5C:BA:37:8A:28:4A Paired: yes
Connection successful
[Xbox Wireless Controller]#
Remember, you must not use the “pair” command. If you do, the pairing will be successful, but the subsequent connect command will fail in an endless loop. Once paired, bluetoothctl will forever remember the controller in its config file, but you need to run the first line (echo disable_ertm) every time you restart your lakka machine.