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

joystick order on linux is random for some multijoysticks #5366

Closed
MrMEEE opened this issue Feb 25, 2022 · 5 comments
Closed

joystick order on linux is random for some multijoysticks #5366

MrMEEE opened this issue Feb 25, 2022 · 5 comments

Comments

@MrMEEE
Copy link

MrMEEE commented Feb 25, 2022

Hi

I have a 4 controller device (usb converted arcade cabinet).. where all the controllers are "behind" the same VID/PID:

[LOG] Searching gamepads...
[LOG] Found 4 gamepad(s):
[LOG] "HID 16c0:05df", 00000000c0160000df05000001010000 (mapping available)
[LOG] "HID 16c0:05df", 00000000c0160000df05000001010000 (mapping available)
[LOG] "HID 16c0:05df", 00000000c0160000df05000001010000 (mapping available)
[LOG] "HID 16c0:05df", 00000000c0160000df05000001010000 (mapping available)

(Output from gamepad-tool)

On Windows and using the old standard (/dev/input/js*) the joysticks are always presented in the same order.. but using SDL programs they are randomly changed around, between program restarts and machine reboots..

I have tried playing around with SDL_JOYSTICK_DEVICE, SDL_LINUX_JOYSTICK_CLASSIC and SDL_JOYSTICK_DISABLE_UDEV... but I can't seem to find a way to consistently get the same order...

Any ideas??

@clebercasali
Copy link

"env SDL_JOYSTICK_DISABLE_UDEV=1 mygame" should work.
SDL_JOYSTICK_DEVICE takes the event* nodes, not js*.
Check this script.

@MrMEEE
Copy link
Author

MrMEEE commented Feb 28, 2022

Will doublecheck.. but I'm pretty sure that I still get random results with SDL_JOYSTICK_DISABLE_UDEV=1...

How will I know the names of the event* ... they keep shifting?

@clebercasali
Copy link

How will I know the names of the event* ... they keep shifting?

Look in "/sys/class/input/js*/device/". There must be a directory with the event number there.

@MrMEEE
Copy link
Author

MrMEEE commented Feb 28, 2022

But the next time I turn the system on, they might/will be different?

So I should do a script that reads out the event-id?

@clebercasali
Copy link

@slouken slouken closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants