libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.36k stars 1.84k forks source link

Controllers are assigning to the wrong ports #17113

Open KamiLordus opened 1 month ago

KamiLordus commented 1 month ago

Description

I have two controllers connected to my PC in Windows 11:

Unfortunately, when I connect these two devices, the system maps the Joystick to port 1 and the pad to port 2. Retroarch recognizes this, just like Windows 11, and it causes a problem. If I change the order of controller mappings in Retroarch, the analogs in the Series X pad will stop working.

Expected behavior

Setting the Xbox Series Controller to Port 1 to be fully functional (working analog sticks, in menus).

Actual behavior

Windows detects the Joystick as Controller 1 and the Xbox Series pad as Controller 2. Retroarch does the same which causes problems.

I will add that the problem only affects the Xbox Series X controller. For example, the Xbox One X controller mapped to port 1 and the problem did not occur (unfortunately it was damaged).

zoltanvb commented 1 month ago

In general, the order of devices is controlled by the underlying operating system, but now there are some options inside RetroArch. Can you check, if the controller device reservation could solve this issue? https://github.com/libretro/RetroArch/pull/16647

KamiLordus commented 1 month ago

I've been sitting on this for hours and trying different combinations. Unfortunately, nothing helps, because the analogs in the Series X pad will only work when the Joystick is in port 1 by default.

I even tried a program like devreorder, but for some reason it didn't want to work for me.

zoltanvb commented 1 month ago

"Nothing helps" includes the scenario when the Series X pad is set up as a reserved device under Port 1 Controls? If so, please generate a log (including retroarch startup and controller connection).

KamiLordus commented 1 month ago

You can change port 1 to an xbox controller, and port 2 to an xbox controller as well. Then the menu gains full functionality when controlling the pad. But in reality the controller is still in port 2, not 1. And you can control it by enabling the option in Retroarch, which allows all players to control the menu.

It becomes chaos and mess in the very cores. Player 1 is actually 2 and vice versa. Give me a moment for the log

KamiLordus commented 1 month ago

"Nothing helps" includes the scenario when the Series X pad is set up as a reserved device under Port 1 Controls? If so, please generate a log (including retroarch startup and controller connection).

Exactly. After reserving the xbox controller in port 1, the joystick automatically maps to port 2. However, the analogs in the pad still do not work. retroarch.log

zoltanvb commented 1 month ago

Weird. Logs reveal no problem. Can you test if the analogs work in Remote Retropad? (Load Core / Start Remote Retropad).

KamiLordus commented 1 month ago

Start Remote Retropad - hmm, I can't find that option anywhere. It's also strange that the Xbox Series pad analogs also work in games (for example, the Swanstation core). However, I really want them to work in the Retroarch menu as well.

Scrolling through the Retroarch menu with the d-pad is mega-tedious.

I don't know if it has any significance, but the pad is connected via a USB cable. Joystick to PC adapter + USB connection

zoltanvb commented 4 weeks ago

If analog works in games, then it is detected correctly. There can be 2 things in Settings/Input/Menu Control:

KamiLordus commented 4 weeks ago

"all users control menu" is disabled "disabled menu analog stick navigation" is also disabled The problem is the joystick (probably the drivers and how it communicates with Windows/Retroarch). Disconnecting the joystick makes the Xbox Series pad work perfectly in the menu and games. But it would be nice if both devices worked properly when connected. I managed to make the joystick and pad work perfectly once or twice.

This only happened when Windows recognized the Joystick as a SECOND device (I'm 1000% sure about that). Unfortunately I have no idea when this happens. Changing USB ports, removing devices in Windows, etc., etc., seems like nothing makes sense. What's more, even if you manage (after long combinations) to force Windows to recognize the joystick as a second device (not the first), all you have to do is restart Windows and everything is gone.

zoltanvb commented 4 weeks ago

It is probably not related to controller ordering in RetroArch, then. I tried with 2 controllers, after "all users control menu" is enabled, analog will work for menu control on both.

Changing the controller driver (Settings / Drivers) may be worth a try.

KamiLordus commented 4 weeks ago

Windows is probably to blame, treating the old joystick as a priority device :) I think we can close this problem, I guess there's nothing to be done here.