Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL_JoystickGetGUID() not unique on Linux #1293

Closed
SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Closed

SDL_JoystickGetGUID() not unique on Linux #1293

SDLBugzilla opened this issue Feb 10, 2021 · 0 comments
Labels
invalid This doesn't seem right

Comments

@SDLBugzilla
Copy link
Collaborator

This bug report was migrated from our old Bugzilla tracker.

Reported in version: 2.0.1
Reported for operating system, platform: Linux, x86

Comments on the original bug report:

On 2013-12-24 16:19:29 +0000, wrote:

The joystick GUIDs are currently generated from the USB bustype, vendor, product and version:

http://hg.libsdl.org/SDL/file/a9d1c47bb1aa/src/joystick/linux/SDL_sysjoystick.c#l117

However this only gives a GUID that is unique for the type of controller, not for the controller itself. Two controllers of the same type will generate the same GUID and cause issues with games that rely on the GUID being unique. See for example:

http://askubuntu.com/questions/394627/two-ps3-controllers-connected-via-usb-identified-as-one/395253# 395253

On 2013-12-24 20:25:01 +0000, Sam Lantinga wrote:

That is correct, the GUID is used to identify the type of controller (and what game controller mapping should be used)

As far as I know there is no way to uniquely identify a specific device.

On 2016-07-22 14:07:37 +0000, Brad Hughes wrote:

(In reply to Sam Lantinga from comment # 1)

That is correct, the GUID is used to identify the type of controller (and
what game controller mapping should be used)

As far as I know there is no way to uniquely identify a specific device.

So the GUID values provided by SDL for joysticks are not intended to be unique per-device? There is no way at all to get unique ID's per device? There is unique information provided by most USB devices that could be obtained. For instance, most devices expose a SerialNumber as well as LocationID which further identify devices.

MAME needs a way to uniquely identify two devices of the same type to support multiple controllers of the same type.

On 2016-07-26 08:46:20 +0000, wrote:

One way to fix this issue would be to add an id into the GUID. So the first controller of a given type gets the regular GUID, if a second controller of the same type is discovered it gets GUID+1, third one gets GUID+2, etc.

@SDLBugzilla SDLBugzilla added bug invalid This doesn't seem right labels Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant