https://bugs.winehq.org/show_bug.cgi?id=38997
Bug ID: 38997 Summary: Non-deterministic device id assignment when using more than one joystick/gamepad (multiplayer). Unable to deactivate joystick through registry or wine control applet Product: Wine Version: 1.7.48 Hardware: x86 OS: Mac OS X Status: UNCONFIRMED Severity: normal Priority: P2 Component: directx-dinput Assignee: wine-bugs@winehq.org Reporter: spellbound42@gmx.de
Using OSX Yosemite with 2-3 gamepads (a Thrustmaster, a Saiek, and a virtual one from ControllerMate). Each of them (isolated) working well with wine.
Problem: Non-deterministic assignment of device ids when more than one of them is connected.
For example in one wine session the Thrustmaster is referred as 'Joystick 0' (-> wine control applet) in the next session its the Saitek that is getting id 0 - without changing anything between the sessions. That makes it impossible to have a stable multiplayer joystick configuration for games that rely on a stable order for the devices. It makes it impossible too to use a virtual joystick with MAME, because sometimes its JOY1 and sometimes its JOY2. Furthermore it is not possible to deactivate a joystick device through the registry or wine control respectively. That would be a workaround for using the virtual controller with MAME - i.e. hide the physical controller that drives the virtual one. Looking at the source code the latter issue seems quite clear, because in dinput/joystick_osx.c::find_osx_devices() there is missing a code snippet like it is implemented in the corresponding function in joystick_linux.c: if (device_disabled_registry(..)) { close(...); continue; } ... ok, deactivation would be useless, if its non-deterministic, which one is deactivated ... I think the id assignment bug/problem could at least be improved by sorting the device list by product names before assigning the ids. But hopefully there exists a more clever fix/solution that is closer to the root cause.
https://bugs.winehq.org/show_bug.cgi?id=38997
--- Comment #1 from Tom spellbound42@gmx.de --- How to reproduce the bug easily: Connect 2 or more gamepads to a Mac(Book). Invoke wine control / game controller test applet several times. Symptom: "Joystick 0" is bound randomly to one of the connected devices.
Hint: I think this bug is OSX specific and related to input/joystick_osx.c
https://bugs.winehq.org/show_bug.cgi?id=38997
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |ken@codeweavers.com
https://bugs.winehq.org/show_bug.cgi?id=38997
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, hardware
https://bugs.winehq.org/show_bug.cgi?id=38997
david.dljunk@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |david.dljunk@gmail.com
--- Comment #2 from david.dljunk@gmail.com --- (In reply to Tom from comment #1)
How to reproduce the bug easily: Connect 2 or more gamepads to a Mac(Book). Invoke wine control / game controller test applet several times. Symptom: "Joystick 0" is bound randomly to one of the connected devices.
Hint: I think this bug is OSX specific and related to input/joystick_osx.c
Hi, I just submitted a couple of patches to fix this in both dinput and winmm joystick controllers. It now sorts controllers by location ID which should remained stable over across boots & program launches. Which wine control/game controller test applet were you using?
https://source.winehq.org/patches/data/123721 https://source.winehq.org/patches/data/123724 https://source.winehq.org/patches/data/123722 https://source.winehq.org/patches/data/123723
It should be noted that for virtual joysticks, they may still be unordered amongst themselves if multiple virtual joysticks have the same location ID (e.g. 0).
https://bugs.winehq.org/show_bug.cgi?id=38997
Ken Thomases ken@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |33c43473c0a5d1a872b50757a9b | |ace654a6502c8 Resolution|--- |FIXED Status|UNCONFIRMED |RESOLVED
--- Comment #3 from Ken Thomases ken@codeweavers.com --- The fix has been committed: http://source.winehq.org/git/wine.git/?a=commit;h=33c43473c0a5d1a872b50757a9bace654a6502c8. Thanks, David!
https://bugs.winehq.org/show_bug.cgi?id=38997
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.9.15.