How is joypad order determined?
-
Is joypad order (player 1 vs player 2) determined by the joypad vendor in udev or the USB port its plugged into? Any insight on how this works would be helpful. #joypad
-
@jkezar I don't know the true answer, but for me when using the same type of hardware it was based on the USB ports that they were plugged into.
You should try the joystick selection tool (link below), this didn't work for me for hardware named the same (if I moved what was P1 from usb 0 to usb 1 that stick was now player 2 after reboot) but if your sticks are maybe different names then this tool could help.
-
Firsly, Retroarch (and maybe EmulationStation too) has the hotplug functionality. This way, everytime a USB joystick is plugged in, Retroarch automatically detects and configures the plugged controller. Just like a console. In that case, the order is determined on a first-come, first-serve basis: the first plugged joypad is player 1, the second is player 2, and so on.
However, if you've already plugged two controllers before opening Retroarch, then in that case, if I'm not mistaken, the order is determined by the joypad vendor (assuming it's the "friendly" name the controller has, when plugged in).
In order to get a better experience, I recommend you to have the same controllers whenever possible. For SNES games, two SNES USB controllers from the same vendor. For Playstation games, a PS2 USB adapter and two PS2 controllers (this way, both controller will be treated as one, having the same vendor, thus automatically being ordered the right way).
Last, but not least, keep in mind that applies only to Retroarch. Other external games / emulators may work differently. Two examples are ZDoom and Streets of Rage Remake.
-
They are ordered by usb port. All usb ports have an order hierarchy. Top left is port 0. Bottom left is port1. Top right is port2. Bottom left is port3. You can use @meleu’s joystick selection to force specific controllers to specific player or systems.
-
@Solid-One it is not determined by vendor or order they were “plugged in” in retroarch. It is by which usb port it is in. If you are in emulationstation and a device was plugged into usb port 1, then you plug one into usb port0 even though emulationstation sees it by the order it was plugged in retroarch boots it by usb order.
-
@edmaul69 I haven't noticed how the usb port position affects the joypad order. That's news to me.
However, I have a RPI2 with RetroPie and I use it for playing emulators. A few years ago, I've done the following steps:
- With my RPI turned off, I've plugged a PS2 USB adapter with two controllers (just for curiosity, the vendor name starts with "Twin USB Joystick...");
- Turned my RPI on, and waited for it to load EmulationStation;
- Opened Super Bomberman 5, a SNES game with multiplayer support up to 5 players (used Retroarch with lr-snes9x2010 core);
- After playing a bit with two players, a friend of mine arrived and joined us, so I simply plugged a third controller on another USB port, without having to close and reopen the emulator (in that case, the vendor name of the 3rd controller starts with "Retrolink...").
The result: My PS2 controllers stayed as Player 1 and Player 2, and the third controller was automatically associated to Player 3. But at the same time, if I close and reopen the emulator, the third controller was associated to Player 1, and the PS2 USB to Player 2 and Player 3. However, I don't remember which USB port I've used in each controller, so there's the possibility my third controller was plugged in a USB port with smallest order than the other port with my PS2 USB adapter plugged.
But there's one thing I could confirm from that test: the order of my PS2 controllers wasn't changed after plugging the third controller. They stayed the same, without the first controller suddenly controlling Player 3, and so on.
-
@Solid-One yes if you are already in retroarch systems the order wont change but when you exit and go back in it takes usb order as was the case in your situation.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.