Controller Priority Option (request)
A recent change to the way controller order is handled in linux has turned into the bane of some builds. For example, I have a Raspberry Pi joystick build where previously the gpio joystick had the desirable behavior of being pushed back by any additional controllers plugged in. Wanna have two people play mario kart? Awesome, plug in two SNES controllers and the joystick moves to player 3 and doesn't bother anyone. Now its player 1 no matter what and the only thing I can do is log in through SSH to activate or deactivate it. =/
Obviously the current way of handling it in normal situations is much more sensible but kinda highlights the need for a feature to either specify controller priority or at the ver least, specify low priority controllers. "Hey, this is always plugged in so treat it like you would a keyboard and move it out of the way".
I feel like this would help a lot of people who do arcade or portable style builds that leverage retroatch and probably would be simply a nice feature in general.
The new way doesn't seem more sensible though, for the exact reason you mention. Shouldn't that commit just be reverted? Stack behavior when new components come in is often the 'correct' way and i'd think for controllers it would be so (because as you mention, when you insert new ones you want to use them 'instead' of any that already exists there, by platform default or not).
It would be nice to have a menu to assign them but at the same time i think stack like reassignment is a feature not a bug.
But the old behavior seemed less 'stack' and more... semi random? At least when mixing bluetooth, USB and other devices. The new way seems more predictable and more in line with the usual case of multiple controllers being plugged in (Like if someone comes to join in on a game I'm playing, I don't expect to suddenly be player 2). Granted I don't feel particularly strongly about this. If someone wanted to argue this is dumb and have the patch be removed that'd be -okay- with me.
But being able to have some control would really help weird edge cases like those of us who build arcade machines or handhelds or whatever because I can imagine people would might want the opposite behavior on their builds too.
this issue was raised over on the retropie forums also: https://retropie.org.uk/forum/topic/17276/usb-ports-no-longer-determine-player-number-retroarch-1-7-1 0
so yeah, would be idea to have some kind of option to control this.
The only other alternative i can think of for automating both cases (keeping the relative order and get rid of useless inbuilt controllers) is to limit the number of players (which you can do in the input submenu) and anchor the retropad devices to the end of the list. This limit is impossible to find automatically though, so it's a poor solution to 'automate' things.
I'd guess the current behavior can be kept as more intuitive/better, if there is a configuration to blacklist devices that you can't turn off, or if you prefer explicitness to assign one to each retropad manually, both at the cost of slightly more configuration, the second more than the first (because moving all the controllers down at least one slot).
the only decent solution would be to bind on button press instead of on enumeration
On Thu, May 3, 2018, 4:47 AM i30817 [email protected] wrote:
The only other alternative i can think of for automating both cases (keeping the relative order and get rid of useless inbuilt controllers) is to limit the number of players (which you can do in the input submenu) and anchor the retropad devices to the end of the list.
This is impossible to do automatically though.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/libretro/RetroArch/issues/6707#issuecomment-386243119, or mute the thread https://github.com/notifications/unsubscribe-auth/ABpC0BbvP9f2fQsS5Fs3D8nP9hVV9N33ks5tutI2gaJpZM4Twkg3 .
Something like a setting called 'controllers assignment' in the main input menu (not the Binds menus) for binding controllers with a time limit that resets on a new controller press?
I can see that working ok, but i'd prefer that the current behavior was keep if the user didn't request a change.
That is, if the user just kept adding controllers, they're assigned as 'normal' to free retropad slots, but if the user requests a 're-assignment' that scheme saves a new complete order on the cfg.
But if the user adds a new controller after it'd be nice if it was just added to the end without fuss. If this last is too difficult to do (figure out that a controller was 'just inserted' instead of being just skipped) forget that detail and require a re-assigment or reset of that setting.
Still, keep the current behavior as the 'default' for the empty setting for people that don't have to care about this.
In the GUI it could be a setting with two user visible settings: [controllers assignment] [default] and [controllers assignment] [custom]
Maybe just 'enter' to reset to 'default' is enough and just make it a label instead of a spinner (because a spinner would have to only show 'custom' after a bind, which would cause confusion).
Controllers aren't assigned as 'normal' to free retropad slots. Every time a new controller is added the whole system is reinited (at least on windows / dinput / xinput) and the pad is added depending on the OS enumeration.
Windows (an linux) enumeration tends to be quite random, so you may have one controller plugged as P1, connect another one and that P1 might become P2 and the new one P1 and so on.
This is just my opinion but you keep suggesting convoluted ideas :P. This doesn't require a setting or an option, just one way that works properly.
The "old behavior" made no sense either, because on many systems telling which port is 0, 1, 2, 3, 4 etc would be impossible. It was not something that was added as a feature, it may have been a casual result of something in the RetroArch code (or even in the linux kernel they are using or whatever), since it was casual and not a predefined codepath it may break / change when anything related changes, like it did recently for udev.
The idea I have for this matter is simple, if you have 10 pads connected, no-pads would be assigned until you press a button. If you press a button in a pad it gets assigned to the first slot, if you press a button in another it would be assigned to the second an so on.
Casually (again) this is the way it works on android, because the OS keeps adding the controllers one after another when they connect.
Ok, i think i see what you mean now. You want to do that 'user press any button' scheme without a user interface action from the user being necessary (or menu option).
And any inserted new controller would force all users to decide on a new order (?).... I can live with that. I like not having a dedicated menu option.
Maybe a on screen message with 'retropad # was assigned to controller $name' would be good.
What happens if all the controllers are assigned and a new one is connected and its button pressed? Does it 'steal' player one?
What i mean is: it's a bit undesirable that on insertion of a new controller every controller (that was already assigned) needs to get reassigned and can even cause 'stealing' of player number (most notably player 1)... but if you don't do that, you need a way to reset because maybe the player wants to change the orders.
edit: Eh... it's not a big deal because people can always complain and remove the controller and reconnect and steal it back...
Unless this can 'steal' player 1 in netplay or something fishy like that: Objection/observation retired.
And any inserted new controller would force all users to decide on a new order (?).... I can live with that. I like not having a dedicated menu option.
No, any new inserted controller would be assigned to the next available slot, like what games do, in mario kart wiiu noone is p1. Then one of the users presses a button and he's P1, next one that presses a button is P2 and so forth.
For the 1 person who wants to use more than 16 controllers at the same time I don't have a solution.
The options as far as i can tell are (if a save to cfg and a new Input menu option are unneeded/vetoed):
- never reassign after assignment (obviously impossible without cfg support, likely inadvisable)
- reassign all controllers every time when a new controller is inserted transparently by keypress.
- reassign once on startup by keypress. Require closing down RA in order to change ordering (for instance to use wiimote instead of a normal controller as player 1, if RA ever gets wiimote support).
So you're saying option 3? I don't mind it, but other people might.
Yeah but I don{t see why it would require closing down RA, every subsystem is reinited in content load so whenever you load a game all ports are free again.
Oh. Ok, that's fine. Only a problem if they try to change when the games are running and you can just tell 'not supported' (or figure out a fix).
Does this work for 'keyboards as retropads' too?
no, keyboard keys are hardcoded to the port they are assigned to and I don't mean to change that at all. Actually this is just my idea for the functionality but I have no idea about how to accomplish this.
As I said it works like this on android, but casually, not because it was designed like this.
I'm fine with the keyboard mappings (if they exist) to be a 'always on' alias for player 1, which i think it's the case today. That's how i (and anyone without a controller) use them anyway.
Though i suppose with your recent PR it's actually possible for two players to share a keyboard for simple games. But again it shouldn't interfere.
Good luck.
As a user, assign on button press seems pretty solid. I can see it confusing some people at first but the functionality seems real good and can accommodate... well, pretty much every weird usecase. Priority is nice for making fixed setups but this is a solution that requires absolutely no cfg tinkering, so that's a huge plus. Very glad to see this issue get discussed seriously, especially since I was unsure if I should even make a feature request about it.
I'm not sure how this would work in my case. I use a wireless Xbox 360 controller as my primary Player 1 controller. I have the option, on occasion, to use legit NES controllers for my NES games. They're currently connected through an adapter to port 1 on my USB. I also have the option, on occasion, to use legit 6-button Sega controllers for Sega games, and/or legit Atari joysticks for Atari systems. They connect through an adapter to port 2 on my USB. Port 3 is a hard drive. Port 4 is actually going to a powered USB HUB, where I have the Xbox dongle connected to "5" and a wifi Keyboard/Mouse dongle is in "6".
The way my system works currently, the Xbox controller is the only one I have mapped in RA, and functions as my constant Player 1. Through the use of a special driver (XBOXDRV) I essentially map the other controllers to keyboard keys as needed during RA loading.
When the new release of RA came out with this Controller Priority issue, I lost all functionality of my Xbox controller inside RA. This is because it is plugged into port "5". None of my other controllers work either due to them not actually being mapped inside RA. The first thing I tried to do though was to use a keyboard, since XBOXDRV was mapping those other controllers to keyboard. It didn't work either. I suspect now that it was because the keyboard is connected to port "6".
In essence.. this entire patch edit destroyed my setup. It now requires me to take my whole system apart, reconnect my keyboard dongle to port 1, the Xbox to port 2, and then re-program all of my "on-launch" directions for the XBOXDRV. I have it the way it is now, because it was the only way to make it work 100% of the time whether my Xbox controller was on or off during power on. Why not just leave it the way it was? I mean, was there some urgent and immediate need to add this to RA?
PS, I like the idea of a "press a key to assign player 1" pop up on screen, but I don't see how it can be done to work with all scenarios. Like in my case, if I want to use a Sega controller one time, an NES another, and Xbox all other times.
every subsystem is reinited in content load so whenever you load a game all ports are free again.
You would just have to press the button of the pad you want to use.
Regarding your usecase. the way it worked as I said was a casual outcome of how the system worked. That system changed, the functionality changed. It was not on purpose, someone thought it was good an it was merged without any consideration because we can't consider every single use case in the world.
PS, I like the idea of a "press a key to assign player 1" pop up on screen, but I don't see how it can be done to work with all scenarios. Like in my case, if I want to use a Sega controller one time, an NES another, and Xbox all other times.
Well, it is already done like this on Android.
I like the idea of having a setting that would allow you to make the input autodetection work like this for other platforms as well.