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 3533 - Enumeration joystick devices omitted during directinput enumeration
Summary: Enumeration joystick devices omitted during directinput enumeration
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: joystick (show other bugs)
Version: HG 2.1
Hardware: x86_64 Windows 7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-29 20:16 UTC by white.magic
Modified: 2017-01-18 20:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description white.magic 2016-12-29 20:16:40 UTC
The logic which decides if a device enumerated via the direct input system in the function EnumJoysticksCallback in SDL_dinputjoystick.c is processed is discarding valid joystick devices due to the assumption that devices of the type DI8DEVTYPE_SUPPLEMENTAL are not valid devices.

This change was added with 2.0.4 with this commit http://hg.libsdl.org/SDL/rev/d5adc0c06a03 that is linked to this bug report https://bugzilla.libsdl.org/show_bug.cgi?id=2460 which indicates that in that case devices of the type DI8DEVTYPE_SUPPLEMENTAL were not desirable as they caused a singular device to emit multiple "device added" events.

Since then there appear to have been a few fixes to handle devices that fall into various other classes in the following two commits: 
http://hg.libsdl.org/SDL/rev/b9488c689ce3 and http://hg.libsdl.org/SDL/rev/161fee58e36f

Two devices I have reports of failing to be listed when the DI8DEVTYPE_SUPPLEMENTAL type is excluded are ECS Gametric Throttle and Thrustmaster MFD Cougar.

I'm unsure what the best or most desirable solution to this is as the initial change had a particular purpose, however, it also interfers with devices being properly listed that windows itself considers joystick devices. One way probably would be having a different logic to detect when a single device emits multiple "device added" events, however, I'm not familiar enough with the internals of direct input to say if that's even possible to detect.
Comment 1 Sam Lantinga 2017-01-18 20:19:13 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/b0559017b1e5