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 2781 - Regression: Official wired Xbox 360 controller not detected
Summary: Regression: Official wired Xbox 360 controller not detected
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: 2.0.3
Hardware: All Windows (All)
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-13 12:48 UTC by mushman5
Modified: 2017-08-14 04:37 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mushman5 2014-11-13 12:48:06 UTC
An official Microsoft Xbox 360 wired controller (Hardware ID: USB\VID_045E&PID_028E&REV_0114) is not detected using SDL 2.0.3. The same controller works with SDL 2.0.0.

I am attempting to use a controller with SDL through Mupen64Plus, a Nintendo 64 emulator. After initially reporting this regression to them, it was determined to be an issue with SDL when it was updated from 2.0.0 to 2.0.3. I had initially reported that this regression occured on Windows Vista x86. A developer was unable to reproduce the problem on a Windows 7 computer. However, I was able to later reproduce it on a Windows 7 x64 machine.

I am using custom drivers (XBCD 0.2.7 by Squall Leonhart), but the behaviour is still the same when they are uninstalled and the default ones are used.
Comment 1 Alex Szpakowski 2014-12-05 05:48:45 UTC
Are you able to test using the latest Mercurial version of SDL (the upcoming 2.0.4)? Just to make sure the issue is still there in the most current code.
Comment 2 mushman5 2014-12-05 10:28:53 UTC
I'd be happy to test the latest version. However, I am very inexperienced with source code and building projects. I downloaded a ZIP of the project from http://hg.libsdl.org/SDL (revision f6355bfca853) and attempted to compile it with Visual C++ 2010 Express, but the build failed. I tried to look for any exisitng builds of 2.0.4 in the repository but couldn't find one. If you could help me with getting the latest version, I would apprecaite it.
Comment 3 Ryan C. Gordon 2015-02-19 06:32:16 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry
if you got a lot of email from this. This is to help me sort through some bugs
in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4,
though!
Comment 4 Ryan C. Gordon 2015-04-07 04:57:56 UTC
(sorry if you get a lot of copies of this email, I'm marking several bugs at once)

Marking bugs for the (mostly) final 2.0.4 TODO list. This means we're hoping to resolve this bug before 2.0.4 ships if possible. In a perfect world, the open bug count with the target-2.0.4 keyword is zero when we ship.

(Note that closing a bug report as WONTFIX, INVALID or WORKSFORME might still happen.)

--ryan.
Comment 5 Alex Szpakowski 2015-08-30 18:03:12 UTC
360 controllers work for me as of the latest 2.0.4 Mercurial code; should I close this as 'worksforme'?

You can download a pre-built release candidate of SDL 2.0.4 here: https://www.libsdl.org/tmp/download-2.0.php
Comment 6 Jimb Esser 2017-03-03 19:36:31 UTC
This sounds like an issue I ran into and fixed as part of my fix to https://bugzilla.libsdl.org/show_bug.cgi?id=3299

Just the first part of the diff is a trivial fix for this issue for me.  At least on my computer, my official Microsoft Xbox wired controllers show up as "Controller (XBOX 360 For Windows)", which is a different case than the code is looking for.

diff -r f0645cd8fd39 -r 7161a0cf5b92 src/joystick/SDL_gamecontroller.c
--- a/src/joystick/SDL_gamecontroller.c	Sun Mar 20 15:35:34 2016 -0300
+++ b/src/joystick/SDL_gamecontroller.c	Mon Mar 28 14:17:55 2016 -0700
@@ -660,7 +660,7 @@
     if (!mapping) {
         const char *name = SDL_JoystickNameForIndex(device_index);
         if (name) {
-            if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box")) {
+            if (SDL_strstr(name, "Xbox") || SDL_strstr(name, "X-Box") || SDL_strstr(name, "XBOX")) {
                 mapping = s_pXInputMapping;
             }
         }
Comment 7 Sam Lantinga 2017-08-14 04:37:35 UTC
Jimb's patch is in the latest snapshot:
http://www.libsdl.org/tmp/SDL-2.0.zip

Please reopen this bug if this doesn't fix the problem for you.

Thanks!