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 3403

Summary: DirectInput joystick driver's XInput detection broken on Windows 10 Anniversary Update
Product: SDL Reporter: Mikkel Krautz <mikkel>
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_64   
OS: Windows 10   
Attachments: Proposed patch
Proposed patch, v2

Description Mikkel Krautz 2016-08-04 20:46:08 UTC
[Via http://lists.libsdl.org/pipermail/sdl-libsdl.org/2016-August/100216.html]

Hi,

We use the XInput detection code from SDL's DirectInput joystick code
in Mumble (https://www.mumble.info).

This is the code I am talking about:
https://hg.libsdl.org/SDL/file/e8281b14970c/src/joystick/windows/SDL_dinputjoystick.c#l238

We just received a bug report that the detection is broken on Windows
10 Anniversary Update (1607):
https://github.com/mumble-voip/mumble/issues/2483

I debugged it for a bit, and it doesn't seem like the "IG_" check
works anymore when using the anniversary update. The "IG_" check is
this:
https://hg.libsdl.org/SDL/file/e8281b14970c/src/joystick/windows/SDL_dinputjoystick.c#l296

For now, we've worked around the issue by adding GUIDs for
wired/wireless/bluetooth Xbox One controllers to the list of well
known XInput devices:

https://github.com/mumble-voip/mumble/pull/2484

This works around the issue for people using Xbox One controllers.

If there is any interest, feel free to copy the GUIDs from the PR
above into SDL, under SDL's zlib license.

Thanks,
Mikkel
Comment 1 Mikkel Krautz 2016-08-06 13:03:00 UTC
The list in the initial PR was a bit incomplete.
Here's a patch on top of the older PR:

https://github.com/mumble-voip/mumble/pull/2489

I'll try to prepare a patch for SDL with the combined changes.
I believe this covers all MS-released gamepad-style XInput devices.
Comment 2 Mikkel Krautz 2016-08-06 13:18:26 UTC
Created attachment 2543 [details]
Proposed patch
Comment 3 Mikkel Krautz 2016-08-06 13:18:58 UTC
OK, I've now added a patch to add Xbox One controllers to the XInput filter in the DirectInput joystick driver.
Comment 4 Mikkel Krautz 2016-08-06 18:05:26 UTC
FWIW, I reported this to MS via the Windows Insider feedback hub:
feedback-hub:?contextid=341&feedbackid=d4d0b4e9-35c2-4e7b-aa7a-513a81cd6f6a&form=1&src=2

Apparently only visible on Windows 10 boxes with the Feedback Hub app installed.
Comment 5 Mikkel Krautz 2016-08-06 18:30:16 UTC
Created attachment 2544 [details]
Proposed patch, v2
Comment 6 Ryan C. Gordon 2016-08-07 16:05:11 UTC

This patch is now https://hg.libsdl.org/SDL/rev/26104a670291, thanks!

--ryan.