Xbox One S Controller (2016) Support on rpi2

Hi, I purchased a Xbox One S Controller (the new one with bluetooth) and want to get it to work on osmc. But neither USB or Bluetooth seems to work.

When I connect it via USB, the controller vibrates and lsusb show me that it is recognized, but there is no input recognition from jstest. (see logs)

Output lsusb:

osmc@himbeerkuchen:~$ sudo lsusb
Bus 001 Device 008: ID 045e:02ea Microsoft Corp.
Bus 001 Device 006: ID 0603:00f2 Novatek Microelectronics Corp.
Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Output jstest:

Driver version is 2.1.0.
Joystick (Generic X-Box pad) has 8 axes (X, Y, Z, Rx, Ry, Rz, Hat0X, Hat0Y)
and 11 buttons (BtnX, BtnY, BtnTL, BtnTR, BtnTR2, BtnSelect, BtnThumbL, BtnThumbR, ?, ?, ?).
Testing … (interrupt to exit)
Axes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:oAxes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:oAxes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 Buttons: 0:off 1:off 2:off 3:off 4:off 5:off 6:oAxes: 0: 0 1: 0 2: 0 3: 0 4: 0 5: 0 6: 0 7: 0 Buttons: 0:off

and so on

I tried installing the newest xpad kernel module from GitHub - paroj/xpad: Linux Kernel Driver for the Xbox/ Xbox 360/ Xbox One Controllers but dkms needs the kernel-headers and I don’t know how to install the right package, because osmc has its own kernel it seems? (Kernel 4.4):

osmc@himbeerkuchen:~$ sudo dkms install -m xpad -v 0.4
Error! Your kernel headers for kernel 4.4.27-5-osmc cannot be found.
Please install the linux-headers-4.4.27-5-osmc package,
or use the --kernelsourcedir option to tell DKMS where it’s located

I read that Kernel 4.8 supports the new Xbox One S Controller so I wanted to upgrade to that, but OSMC again has some configurations so that I couldn’t use the kernel 4.8 from jessie-backports. And it was kind of sketchy, I don’t want to make my system unbootable.
I also tried getting it to work with xboxdrv, but that doesn’t recognize the controller either.

Then I ordered a bluetooth dongle and tried to make that work, but I also have problem pairing the controller to OSMC.
Logs from bluetoothctl:

[bluetooth]# scan on
Discovery started
[CHG] Controller 00:1A:7D:DA:71:11 Discovering: yes
[NEW] Device C8:3F:26:90:86:42 Xbox Wireless Controller
[bluetooth]# connect C8:3F:26:90:86:42
Attempting to connect to C8:3F:26:90:86:42
[CHG] Device C8:3F:26:90:86:42 Connected: yes
Failed to connect: org.bluez.Error.Failed
[CHG] Device C8:3F:26:90:86:42 Connected: no
[CHG] Device C8:3F:26:90:86:42 RSSI: -64
[bluetooth]#

And logs from journalctl:

Jan 09 18:36:33 himbeerkuchen sudo[603]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/usr/bin/bluetoothctl
Jan 09 18:36:33 himbeerkuchen sudo[603]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
Jan 09 18:36:34 himbeerkuchen sudo[611]: osmc : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/mv /var/tmp/config.txt /boot/config.txt
Jan 09 18:36:34 himbeerkuchen sudo[611]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jan 09 18:36:34 himbeerkuchen mediacenter[317]: mv: failed to preserve ownership for ‘/boot/config.txt’: Operation not permitted
Jan 09 18:36:34 himbeerkuchen sudo[611]: pam_unix(sudo:session): session closed for user root
Jan 09 18:36:39 himbeerkuchen kernel: OnAction_back
Jan 09 18:36:39 himbeerkuchen kernel: OnAction_back, action=2
Jan 09 18:36:39 himbeerkuchen kernel: OnAction_back(): DELBA: 0(27)
Jan 09 18:36:39 himbeerkuchen nmbd[470]: [2017/01/09 18:36:39.426590, 0] …/source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
Jan 09 18:36:39 himbeerkuchen nmbd[470]: *****
Jan 09 18:36:39 himbeerkuchen nmbd[470]:
Jan 09 18:36:39 himbeerkuchen nmbd[470]: Samba name server HIMBEERKUCHEN is now a local master browser for workgroup WORKGROUP on subnet 192.168.100.3
Jan 09 18:36:39 himbeerkuchen nmbd[470]:
Jan 09 18:36:39 himbeerkuchen nmbd[470]: *****
Jan 09 18:36:39 himbeerkuchen sudo[603]: pam_unix(sudo:session): session closed for user root
Jan 09 18:36:50 himbeerkuchen sudo[622]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/usr/bin/bluetoothctl
Jan 09 18:36:50 himbeerkuchen sudo[622]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back, action=2
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back(): DELBA: 0(27)
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back, action=2
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back(): DELBA: 0(0)
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back
Jan 09 18:37:05 himbeerkuchen kernel: OnAction_back, action=0
Jan 09 18:37:05 himbeerkuchen kernel: issue_action_BA, category=3, action=1, status=0
Jan 09 18:37:06 himbeerkuchen bluetoothd[268]: sdp_service_search_attr_async: Error sending data:Transport endpoint is not connected
Jan 09 18:37:06 himbeerkuchen bluetoothd[268]: C8:3F:26:90:86:42: error updating services: Input/output error (5)
Jan 09 18:37:12 himbeerkuchen sudo[622]: pam_unix(sudo:session): session closed for user root
Jan 09 18:37:16 himbeerkuchen sudo[629]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/bin/journalctl -n 100
Jan 09 18:37:16 himbeerkuchen sudo[629]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)

I don’t really know how to read those logs, so I need help troubleshooting it. Maybe I’m missing a simple solution, so don’t hesitate to suggest anything that might make it work.Oh and I also updated the controllers firmware with win10 and OSMC is up to date.

Thanks, Felix

I already backported some improvements to the XPad module for 4.4, however I have no controllers to test with apart from a wired 360 one.

I think we will update to 4.10 by the March update. This may have some improvements.

If you would like to test this kernel before it is made available publicly, please let me know and I will ping you when we have things ready for testing

I’d love to test it out and support development with logs or whatever you need! The XPad drivers don’t have anything to do with bluetooth support though, right? Working bluetooth support for the controller would be a dream.

No.

I don’t know enough about the controller to advise.

But some other developers on our team have Xbox One.

Xbox One S controller works for me with Krypton using the USB connection.
I believe the bluetooth support is non-standard and doesn’t currently work with linux.

Eg from here

Okay, thats weird. I updated to krypton too now but still no input from the controller. Only a notification ‘new device configured - Generic X-Box Pad’.
I mean there is a device /dev/input/js0, but still no recognition with jstest.
Not sure why its different on my system?
krypton is still on 4.4 right? ‘uname -a’ gives me:

Linux himbeerkuchen 4.4.27-5-osmc #1 SMP PREEMPT Tue Nov 22 02:23:12 UTC 2016 armv7l GNU/Linux

But other than that I have to say that osmc on krypton is looking really nice and more polished, kudos to the developer

I did a reinstall of kodi and upgraded to krypton again but that did not help either. Are you sure it worked out of the box for you? Or maybe its the old Xbox One Controller without bluetooth? Because I have the newest one with the model number 1708.

EDIT: i meant a reinstall of osmc

I’ve just done a clean install to check.

It doesn’t seem to be working on OSMC.
I also tried with Krypton LibreELEC and with that the X led/button does light up on boot and I was able to use it.

Note, it doesn’t quite work out of the box. I had to go into system/input settings and click on “controller configuration”
A dialogue says “controller configuration depends on a disabled add-on. Would you like to enable it?”
Click OK. Then the controller works.

Both LE and OSMC detect the device with evtest, but OSMC doesn’t detect the buttons pressed.
LE: LibreELEC:~ # lsmodModule Size Used byhci_uart - Pastebin.com
OSMC: osmc@osmc:~$ lsmodModule Size Used bybnep - Pastebin.com

I suspect this is a kernel issue, as LE uses a newer kernel, but it may be possible for OSMC to cherry-pick commits to get the same behaviour.

1 Like

Soon we will move to 4.10 anyway, which does have better XPad handling (and some features that were tricky to backport)

Sam

Alright, I guess I just have to wait! I just want it to work so badly right now :smile:
Will the kernel update be available through the osmc.tv krypton repo?

It will be released in the stable repository.
Kernel 4.10 is not ready at this time. When it is final we will rebase on to it and then do some testing first before making it public, as there are a lot of changes.

1 Like

I finally got it to work:
With the update to Kernel 4.9 the controller worked when connected via USB.
Bluetooth still didn’t work though, the controller only paired for one second and then disconnected. After searching for a solution again I found this and this thread. After I removed the controller in bluetoothctl and disable L2CAP/ERTM with “echo 1 > /sys/module/bluetooth/parameters/disable_ertm” the controller worked flawlessly. So the workaround is to write this command in the rc.local file.

Just wanted to share the solution for other user that may struggle with the same problem.
EDIT: Just the select button is not supported over bluetooth apparently

For anybody that follows: GitHub - atar-axis/xpadneo: Advanced Linux Driver for Xbox One Wireless Controller (shipped with Xbox One S)

1 Like