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 2643

Summary: Two identical joysticks produce incorrect events.
Product: SDL Reporter: derekjma
Component: joystickAssignee: Sam Lantinga <slouken>
Status: RESOLVED ABANDONED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.3   
Hardware: x86_64   
OS: Windows 7   
Attachments: Basic joystick test code

Description derekjma 2014-07-15 04:25:45 UTC
Created attachment 1756 [details]
Basic joystick test code

When two identical joysticks are connected one after the other, SDL can get into a state where a button/movement only on joystick A will produce two of the same event, one for joystick A and one for joystick B. Also in this state joystick B will produce no events.

This consistently happens on my machine if I connect the devices in a specific order on the USB ports.

For example, tapping a button only on joystick A produces:

  SDL_JOYBUTTONDOWN for A
  SDL_JOYBUTTONDOWN for B
  SDL_JOYBUTTONUP for A
  SDL_JOYBUTTONUP for B

This happens with two PS360+ PCBs (which don't show up as Xinput controllers).
I don't have another pair of controllers to test with at the moment.

Attached is some basic code that I can reproduce it with.
Comment 1 derekjma 2014-10-17 01:58:45 UTC
Incorrect events also happen with 2 or more Xbox 360 controllers.
Comment 2 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 3 Sam Lantinga 2017-08-14 06:05:13 UTC
We've done a lot of work in this area recently. Can you check to see if this is fixed in the latest SDL snapshot?
http://www.libsdl.org/tmp/SDL-2.0.zip

Thanks!
Comment 4 Ryan C. Gordon 2018-08-06 21:20:22 UTC
Hello, and sorry if you're getting dozens of copies of this message by email.

We are closing out bugs that appear to be abandoned in some form. This can happen for lots of reasons: we couldn't reproduce it, conversation faded out, the bug was noted as fixed in a comment but we forgot to mark it resolved, the report is good but the fix is impractical, we fixed it a long time ago without realizing there was an associated report, etc.

Individually, any of these bugs might have a better resolution (such as WONTFIX or WORKSFORME or INVALID) but we've added a new resolution of ABANDONED to make this easily searchable and make it clear that it's not necessarily unreasonable to revive a given bug report.

So if this bug is still a going concern and you feel it should still be open: please feel free to reopen it! But unless you respond, we'd like to consider these bugs closed, as many of them are several years old and overwhelming our ability to prioritize recent issues.

(please note that hundred of bug reports were sorted through here, so we apologize for any human error. Just reopen the bug in that case!)

Thanks,
--ryan.