Xbox One Controller - Bluetooth

  • Hey,

    My english is not the best but i am trying.

    I have a problem with LibreElec (testet on 8.0.2 and 8.1.1) with Kodi 17.4 on a Raspberry Pi 3.

    I want to connect a Xbox One Controller via Bluetooth (The Controller support this connection, connection with windows 10 no problem).

    But it comes an Error "Input/Output Error".

    I have tried it with the bluetooth on the raspberry pi and with a bluetooth usb dongle.

    Can somebody help me ?

    If this topic is not right here, please move it in the right topic.

    Thank you for reading

  • IIRC the xbox one bluetooth controller requires extra config via SSH.

    Code
    echo 1 > /sys/module/bluetooth/parameters/disable_ertm

    then try pairing

  • IIRC the xbox one bluetooth controller requires extra config via SSH.

    Code
    echo 1 > /sys/module/bluetooth/parameters/disable_ertm

    then try pairing

    Hi Irusak,

    thank you for this command. I also use the xbox one controller (Rev. 3). With your command I get the controller connected via bluetooth. But after a restart those "input/output errors" come again. Is there a way to get it working durable?

  • I created a autostart.sh with this code:

    Code
    (
     echo 1 > /sys/module/bluetooth/parameters/disable_ertm
    ) &
    nohup script.sh &

    Now the controller is connecting automatically. But it takes 30 seconds after Kodi-Start. Any ideas to do it in a better way?

  • Hi,

    where/how can i disable_ertm on a RPi3/LibreElec 18? Can't edit disable_ertm file, (squashed system?)!

    Trying to connect my Xbox Wireless Controller Modell 1708 per Bluetooth.

  • Add a persistent module option like this:

    Code
    echo 'options bluetooth disable_ertm=1' > /storage/.config/modprobe.d/bluetooth-disable-ertm.conf

    The modprobe.d files are loaded at boot time and apply module options.

  • Thanks aneagoe!

    But doesn't help for me. Gettin input/output error when i try to connect my Xbox Controller. :(

    EDIT: Tried another BT Controller and it works now! :D

    Edit2: Tried to config the Controller to navigate in Kodi and cant get it work. So needs more investigation now,,

    Edited once, last by Cris_ (September 11, 2018 at 8:10 AM).

  • I there an solution for the Xbox Controller modell 1914 with LibreELEC (9.2.8 or the current version) for RPi3 or RPi4?

    I would like to play SNES games or GBA games with LibreELEC.

    Currently still use the Gamestarter AddOn, but unfortunately with LibreELEC 10 should no longer work.

    Are there alternatives?

  • Hi Guys,

    I would like to thank the community by signing up here and describing my solution to the problem. Here is the problem I had:

    - New Microsoft XBox Controller Model 1914

    - Pairing failed all the time

    - The connection kept switching between on and off to the controller

    - The XBox icon has been flashing continuously

    My system:

    - LibreElec (official) 10.0.4 (kernel: Linux 5.10.161)

    - New XBox controller model 1914 with latest firmware; Previously I updated the controller on a Windows PC with the XBox accessory software.

    - TP Link USB Bluetooth Stick UB400

    My steps to the solution:

    1. Switch OFF the controller

    2. Disable ERTM (type in the following line in command line)

    Code
    echo 'options bluetooth disable_ertm=Y' > /storage/.config/modprobe.d/bluetooth-disable-ertm.conf

    2.1 After that a file "bluetooth-disable-ertm.conf" should be created in the directory and have the entry 'options bluetooth disable_ertm=Y'.

    3. 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. I don't know if it was solved in Kodi 19, that's why I did this step.

    3.1 Create a file "99-gamepad.rules" with the following content in "/storage/.config/udev.rules.d/" (type in the following line in command line)

    Code
    echo -e 'SUBSYSTEM=="input", ATTRS{name}=="Xbox Wireless Controller", KERNEL=="event*", MODE="0666", ENV{LIBINPUT_IGNORE_DEVICE}="1"\nSUBSYSTEM=="input", ATTRS{name}=="Xbox Wireless Controller", KERNEL=="event*", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"' > /storage/.config/udev.rules.d/99-gamepad.rules

    3.3 If your controller is not "Xbox Wireless Controller" then replace it with the controller name

    3.3.1 You will see your controller name within bluetoothctl with the command "devices" after you switched the controller on.

    Example:

    Code
    Media-PC:~ # bluetoothctl
    Agent registered
    [bluetooth]# devices
    Device 68:XX:XX:XX:XX:E7 Xbox Wireless Controller
    Device 10:XX:XX:XX:XX:56 AR
    [bluetooth]#

    4. Reboot the system

    5. Open bluetoothctl via console: "bluetoothctl"

    5.1 Check devices: Type "device" - You will get a list with all available Bluetooth devices. Search for the XBox controller.

    5.2 If the XBox controller is present, delete it from the list: "remove AA:BB:CC:DD:EE:FF" (Replace the MAC address with the address of the controller)

    5.3 Turn on the controller and hold the connection button on the top until the controller starts blinking faster.

    5.4 Search for the controller in the console with "scan on".

    5.5 Wait until you see the XBox controller on the screen.

    5.6 End the search with "scan off"

    5.7 Trust the controller with "trust AA:BB:CC:DD:EE:FF"

    5.8 After that, try to pair the controller with "pair AA:BB:CC:DD:EE:FF". The step can take a little longer and you must not get an error in the console. Furthermore the controller should still be in pairing mode. If you get an error just start again at step 5.1.

    5.9 After a while it will ask you if you want to allow the connection. Acknowledge this with "yes".

    6. Now the XBox icon should light up permanently on the controller and the controller should be connected.

    6.1 Now switch to the view in Kodi and press a button on the controller. A message should appear that a new controller has been found and that you can set it up now. Confirm it with "Yes". Otherwise you can also set up the controller again under System/Input/Controller.

    6.2 In my case, the controller was displayed in the menu as "Kodi Standard Controller". I simply assigned the buttons and the sticks by following the menu entries.

    Now the controller should be completely set up and you can use it to operate the menu. After a restart, the controller should connect again as soon as you turn it on. If this does not work, check step 2 again.

    If there are any suggestions for improvement or if I am talking complete nonsense or if you have any questions, please let me know.

    Thanks

    Hellsgore

    EDIT: Thx to 1postNghost for the suggestion. I have revised point 3.

    Edited once, last by Hellsgore (February 22, 2023 at 7:09 PM).

  • Followed this and had success!

    I'm somewhat of a beginner to doing things in the terminal as well as ssh so i wanted to make a post to make things easier for others. In my situation I didn't know how to open a visual app to enter the multi lines of code.

    so...for steps 3-3.3 i used this command. ...also keep an eye on your current directory.

    I CD'd into root "/storage/.config/udev.rules.d/" then ran this;

    Code
    echo -e 'SUBSYSTEM=="input", ATTRS{name}=="Xbox Wireless Controller", KERNEL=="event*", MODE="0666", ENV{LIBINPUT_IGNORE_DEVICE}="1"\nSUBSYSTEM=="input", ATTRS{name}=="Xbox Wireless Controller", KERNEL=="event*", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"' > 99-gamepad.rules

    after that follow the rest of Hellsgore's guide. I had to go through the button binding process before the controller actually worked.

    Thanks Hellsgore !

  • these are very difficult steps for a linux beginner. Will this be integrated into LibreElec later? That is, that I no longer have to do this whole difficult tutorial? Why does this have to be done?

  • Will this be integrated into LibreElec later? Why does this have to be done?

    It cannot be default bundled because the "disable_ertm" property being set is global for all USB devices; and that may cause problems for other devices owned by other users in our large userbase that don't want that to be set (hypothetical but highly-probable scenario).

    The correct fix would be to ammend the upstrem kernel driver to set the property. Then the patch can be upstreamed; we can temporarily patch our kernel sources and later drop the patch when we bump the kernel to a version that already includes it. This requires someone to create and then usptream the patch though. Any volunteers?

  • these are very difficult steps for a linux beginner. Will this be integrated into LibreElec later? That is, that I no longer have to do this whole difficult tutorial? Why does this have to be done?

    Hi LeannLL,

    I know it's hard for beginners because you need some basic knowledge. At which step do you struggle?

    Greetings

  • TL;DR: update your XBOX wireless controller's firmware

    On LibreELEC 11.0.1, both these things are still needed to connect your XBOX wireless controller via Bluetooth and use it:

    1. Disable ERTM, lets the controller be paired and connected (1 command, pastable):
      echo 'options bluetooth disable_ertm=1' > /storage/.config/modprobe.d/bluetooth-disable-ertm.conf
    2. Ignore libinput, makes the controller's buttons work (2 commands, pastable):
      echo 'SUBSYSTEM=="input", ATTRS{name}=="Xbox Wireless Controller", KERNEL=="event*", MODE="0666", ENV{LIBINPUT_IGNORE_DEVICE}="1"' > /storage/.config/udev.rules.d/99-gamepad.rules
      echo 'SUBSYSTEM=="input", ATTRS{name}=="Xbox Wireless Controller", KERNEL=="event*", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"' >> /storage/.config/udev.rules.d/99-gamepad.rules

    After running the above, you would reboot and try pairing your controller. Potentially you would fail to do so with a newer XBOX Series X/S controller or succeed with an older XBOX One controller.

    If pairing worked, you would usually navigate to LibreELEC's Settings > System > Input and do Configure attached controllers. During configuration you probably would not be able to map the Back and Guide buttons.

    The thing that has changed for me (why I'm posting this) is that all the buttons including Back and Guide (XBOX) started working on both my controllers - the older XBOX One controller and the newer XBOX Series S/X - after I updated their firmware via the Xbox Accessories app on my Windows 11 machine (for this, controllers should be connected with a USB-cable or using XBOX Wireless Adapter). So all buttons are now functional, yay!

    Edited 7 times, last by roxton (April 5, 2023 at 8:49 AM).

  • Hello all!

    I installed the LibreELEC 12 and I want to use my xbox controller....I follow all these instructions and tried several times, and the controller keeps on/off until timeout


    Result of the attempted to connect:

  • In LibreElec 13 nightly for rpi5 my Xbox BT controller is successfully connected and a i can control the Kodi UI with it but not the puae addon with a game loaded. I have successfully configured the blue hog controller profile with the Xbox BT Gamepad which comes with the puae addon already. Still controlling the Kodi UI. :(


    Any hint?