Is SDL_JoystickGUID supposed to change?

Some time ago, my wired xbox 360 joystick reported this GUID string: “030000005e0400008e02000014016800”. I have restarted computer several times, connected to another usb port, GUID was always the same
Today I’ve found it has reported this value: “030000005e0400008e02000014010000”. Restarted the machine, and I’ve got this new GUID again. Is this normal?

I want to save this string to a json file, so I can use a specific joystick in my game, not just any connected one
Using SDL v2.24.0 under Manjaro

The joystick GUID represents a specific controller type, driver, and OS combination. In this case the driver changed from SDL’s HIDAPI support to the Linux kernel driver. I’ve no idea why this happened, but it certainly could happen if your kernel drivers changed.

Note that if you had two wired xbox 360 controllers, they would likely have the same GUID. They represent the hardware model, not a specific device instance.

I see, thanks for your answer
So, there is no way of saving the specific device instance to a configuration file?
Unless you always connect them in the same order and get the same
SDL_JoystickID, right?

That’s generally correct. Some controllers have reliable serial numbers, e.g. Sony PS4/PS5 controllers, Nintendo Switch Pro controllers, etc., but many controllers have no serial number or have the same serial number for all units.

1 Like

Today I’ve updated my system, and now the controller reports the old GUID again :joy: