We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3564

Summary: Triggers not recognized on Xbox One S controller in Bluetooth mode
Product: SDL Reporter: Misty De Meo <mistydemeo>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 2.1   
Hardware: x86   
OS: macOS 10.12   
Attachments: Fix axis detection for Xbox One S Bluetooth controller on OS X
Add controller mapping for Xbox One S wireless controller mapping in Bluetooth mode on OS X

Description Misty De Meo 2017-01-22 08:45:22 UTC
The triggers are not recognized on my Xbox One S controller when connected via Bluetooth. They don't register as either digital buttons or as axes; ; all other buttons work, as do the analogue joysticks' axes. To test, I've used controllermap and testjoystick.

I have tested with other software, and the triggers register correctly. For example, using OpenEmu, I'm able to use the analogue triggers with PS1 games.

The controller has the latest firmware installed: 3.1.1221.0. I also have access to an Xbox One S controller using a slightly earlier firmware (roughly 3-4 weeks older), whose triggers are detected.

Steps to reproduce:

1. Pair gamepad with the OS via bluetooth.
2. Run `testjoystick 0`

Expected behaviour:

The analogue triggers register as axes.

Actual behaviour:

The analogue triggers are not detected at all.

I tested using SDL2 2.0.5, and commit 0d31c6a19cd9 from hg. I'm using Mac OS X 10.12.2.

Information about the controller:

GUID (as reported by controllermap/testjoystick): 5e04000000000000fd02000000000000
Firmware Version: 0x0903
Vendor ID: 0x045E
Product ID: 0x02FD
Comment 1 Ryan C. Gordon 2017-01-24 20:17:47 UTC
Sam, do you have a One S controller laying around? I only have the non-Bluetooth Xbox One controller.

--ryan.
Comment 2 Ryan C. Gordon 2017-01-24 22:33:02 UTC
(In reply to Ryan C. Gordon from comment #1)
> Sam, do you have a One S controller laying around? I only have the
> non-Bluetooth Xbox One controller.

Just impulse-bought one of these on Amazon; if no one beats me to it, I'll take a look soon.  :)

--ryan.
Comment 3 Ryan C. Gordon 2017-01-25 23:54:24 UTC
(In reply to Ryan C. Gordon from comment #2)
> Just impulse-bought one of these on Amazon; if no one beats me to it, I'll
> take a look soon.  :)

My controller arrived and it works properly with SDL on macOS 10.12.2, but I have no idea what firmware is on it; is there a reasonable way to determine/upgrade the firmware version?

--ryan.
Comment 4 Misty De Meo 2017-01-26 00:04:01 UTC
If you have Windows, the Xbox Accessories app (distributed in the Windows store) will prompt you to upgrade if you plug in a controller with older firmware. I'm not sure if there's a way to upgrade without that app or an Xbox One.
Comment 5 Misty De Meo 2017-01-26 02:58:35 UTC
wrt checking the version, what's your product ID when connected via Bluetooth? When I compared to the controller with older firmware I had access to, the product ID was different between the two controllers (0x02E0 on the older one vs 0x02ED), while the firmware version and vendor ID are the same.
Comment 6 Misty De Meo 2017-01-26 06:19:51 UTC
Got it - patch incoming. :)
Comment 7 Misty De Meo 2017-01-26 06:26:19 UTC
Created attachment 2684 [details]
Fix axis detection for Xbox One S Bluetooth controller on OS X
Comment 8 Misty De Meo 2017-01-26 06:27:34 UTC
Created attachment 2685 [details]
Add controller mapping for Xbox One S wireless controller mapping in Bluetooth mode on OS X
Comment 9 Misty De Meo 2017-01-26 06:30:18 UTC
It looks like this version of the firmware changed the mapping; aside from changing a few buttons around, the triggers are now mapped as accelerator and brake axes. On Darwin, only rudder and throttle were being mapped as axes for inputs from the simulation page, so these two axes were unaddressible. The patch I submitted just adds accelerator and brake as axes within AddHIDElement; I also submitted a second patch with a gamecontrollerdb mapping for this controller.
Comment 10 Ryan C. Gordon 2017-01-26 18:02:26 UTC
(In reply to Misty De Meo from comment #9)
> unaddressible. The patch I submitted just adds accelerator and brake as axes
> within AddHIDElement; I also submitted a second patch with a
> gamecontrollerdb mapping for this controller.

These patches are now https://hg.libsdl.org/SDL/rev/f4a771647ecd and https://hg.libsdl.org/SDL/rev/ca523d8f1af2 ...thanks!

--ryan.