Input Device Configuration Limitations

Discussion of keyboards, gamepads, joysticks and other input related peripherals.
thorr
Top Contributor
Posts: 1094
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 532 times
Been thanked: 251 times

Input Device Configuration Limitations

Unread post by thorr »

I have just built an arcade cabinet with interchangeable control panels so I can make new control setups for various games. I keep running into problems trying to configure the controls for various cores with my various controllers, and it is forcing me to have to use Mame instead of the MiSTer because I can't configure the controls. Can we either get a really good guide that explains how to handle various situations, or can we change out the way the MiSTer handles inputs to the way that Mame does (sorg question probably)?

For example, Outrun just came out. I have a really nice set of USB analog pedals. That is their only function - gas and brake. I cannot get these to work with Outrun at all. I can sort of get them working with the menus going up and down, but sometimes they select things and I am not sure why. It is very convoluted when first mapping these because it wants me to press right on the D-Pad and right on Stick 1, etc. so maybe something is triggering multiple functions when I press it.

I also have an analog joystick with three buttons. I want to press up on the joystick to accelerate and down to brake and left and right to steer. I can't. I have to use a button to accelerate and a different button to brake. However, if I use my PS4 controller, I think analog acceleration and braking work with the right thumbstick and steering works with the left thumbstick. No matter what I try, I can't get it to work the way I want to, even though I am telling it what I want during the mapping process.

In Mame, I can map anything to anything. I can have ten joysticks, wheels, pedals, etc. from ten different companies and map the brake to whatever device I want, the gas to whatever I want, the steering to whatever I want, etc. and it will work. Each player's controls can be mapped to any device and they can share the same devices that are used by other players. The MiSTer is amazing, except the seemingly super limited input device configuration which makes it impossible to use in many situations, especially with multiple devices used for one player, or even one device used the way you want to, unless I am missing something. The above Outrun examples are just two of many that I am constantly running into. I hope that this is all solvable so I can use the MiSTer instead of Mame with my arcade cabinet and its many control schemes.

bankshot
Posts: 66
Joined: Thu Dec 16, 2021 5:13 pm
Has thanked: 18 times
Been thanked: 29 times

Re: Input Device Configuration Limitations

Unread post by bankshot »

My only real disappointment about the MiSTer platform is the controller config situation. To add on to your point, I have a dual stick/trackball USB controller from Micro Center. The trackball has a separate USB interface/plug from the joystick/button section, so playing a game like Centipede arcade core is impossible because there is no way to combine the two USB devices in the MiSTer config.

I agree with you 100%. The Mame modular pick-and-choose-as-you-want approach to controller config is the right way to go - any combo of digital or analog inputs that you want to use.

thorr
Top Contributor
Posts: 1094
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 532 times
Been thanked: 251 times

Re: Input Device Configuration Limitations

Unread post by thorr »

I have heavy doubts that this is going to get addressed since the current input system is baked into everything, which is very unfortunate, but I have a new plan to try to work around the situation. It occurred to me that most cores are written with something like a PS4 gamepad controller in mind for mapping the controls. I did some digging and there are USB hats available for Arduinos that can take USB as an input from other USB devices such as keyboards and joysticks and the Arduino can work with it. So, my plan is to attempt to recreate a PS4-style gamepad device on the Arduino that will appear to the MiSTer in the format that it is expecting, and use the USB hat as input to the Arduino from my various USB devices that the MiSTer can't work with. The USB hat should be able to work with a USB hub in case I need to hook up multiple USB devices. The same could happen to convert existing USB devices to map the way I want them to like my analog joystick situation or bankshot's situation.

For example, to make my driving control panel:
On the Arduino, I will set up a PS4 style controller and map my physical devices to this.
Steering wheel: I will use an old-school Thrustmaster Grand Prix 1 with analog paddles behind the wheel. I will remove the wheel and attached paddles from the plastic shell and mount it into my control panel and connect the potentiometers for the wheel and two paddles to the Arduino's analog inputs. These will translate to the left thumbstick (left/right directions) for the wheel and the analog triggers for the paddles that the MiSTer is expecting (assuming the MiSTer works with triggers now, or I will map the paddles to the up/down on the left thumbstick).
Pedals: I will use my USB pedals and connect them to the USB hat on the Arduino and translate it to the up/down on the right thumbstick
Stick Shift: I will either use my USB stick shifter and hook it up to the USB hat on the Arduino and translate it to buttons, or I will purchase a different shifter that has connectors on it that I can wire directly to the Arduino as buttons. I haven't decided yet.
I may have an input on the Arduino where I can hook up a mode switch so I can have different mappings from the different components so they translate differently depending on which core I am using.

I think all of this will work, and be a lot of work, and in the end I will be happy I accomplished it, but it is unfortunate that I can't just map it the way I want to in the MiSTer and not have to build and figure out how to program all this.

zakk4223
Posts: 270
Joined: Sun May 24, 2020 10:55 pm
Been thanked: 107 times

Re: Input Device Configuration Limitations

Unread post by zakk4223 »

There's tradeoffs here, and mister picked one and mame picked another. Mister's advantage is if I map a controller (like say a dualsense) in a sane way for a given core it will always be mapped that way. Even if I plug in a second one, it will just show up as player 2 with no extra config required. Even better, if the controller has a gamecontrollerdb entry, there's almost zero user configuration required for many of the console cores: you just plug the controller(s) in and they work. (let's ignore that I think people still struggle a bit with the 'which controller is player 1/2/3 etc part).

The disadvantage here is doing weird stuff is difficult. You can't easily combine different devices into one 'input'. Mapping stuff like buttons on a spinner is really not intuitive to people (just find a keyboard and skip 75% of the button prompts!!) etc.

On the other hand mame is really good at weird but it's not so good at just 'plug this in and go'. There's a bunch of annoying stuff about mame too; you ever forget to plug your controller in before you start mame? Better hope you don't accidentally cause it to save mappings. I had to set my default mame map config to read only because of this.

I don't think either approach is wrong, but they both do put up barriers that make certain things more difficult. You're just finding the mister barriers now.

I do wonder if you could combine devices using the various linux utilities that can create virtual inputs via uinput and just have it handle all the weird stuff.

thorr
Top Contributor
Posts: 1094
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 532 times
Been thanked: 251 times

Re: Input Device Configuration Limitations

Unread post by thorr »

zakk4223 wrote: Fri Mar 31, 2023 6:29 pm

There's tradeoffs here

I don't think either approach is wrong, but they both do put up barriers that make certain things more difficult. You're just finding the mister barriers now.

I do wonder if you could combine devices using the various linux utilities that can create virtual inputs via uinput and just have it handle all the weird stuff.

Thank you for the well said and thought out post. I agree with most of it, except the MiSTer barriers make certain things impossible, not just difficult. My post above is trying to get around the impossible situations. What was set up to be convenient is turning out to be super inconvenient if you deviate at all from what is expected (like a DualSense controller).

If you have more details about the various Linux utilities, I am all for finding a software solution to the problem instead of trying to custom build electronics and write custom programming for each situation. I know Linux, but I don't know MiSTer Linux like how to install any additional utilities or change the kernel, etc. so I probably will not be able to figure it out.

bankshot
Posts: 66
Joined: Thu Dec 16, 2021 5:13 pm
Has thanked: 18 times
Been thanked: 29 times

Re: Input Device Configuration Limitations

Unread post by bankshot »

It would be really awesome if there was indeed a software solution, and you could simply choose during kernel boot which config option gets loaded, e.g.:

1.) Press 1 for standard plug-and-play controller subsystem (Default - 3 second timeout)
2.) Press 2 for non-standard custom mapping controller subsystem

jd213
Posts: 93
Joined: Sun Aug 15, 2021 2:44 pm
Has thanked: 15 times
Been thanked: 16 times

Re: Input Device Configuration Limitations

Unread post by jd213 »

Just spitballing an idea here since I know very little about the dev side of things, but since a keyboard + mouse + controller can be used at the same time in some PC cores, could similar functionality be added to other cores to allow for inputs from multiple devices in a single game?

Flandango
Core Developer
Posts: 386
Joined: Wed May 26, 2021 9:35 pm
Has thanked: 41 times
Been thanked: 325 times

Re: Input Device Configuration Limitations

Unread post by Flandango »

jd213 wrote: Fri Mar 31, 2023 9:21 pm

Just spitballing an idea here since I know very little about the dev side of things, but since a keyboard + mouse + controller can be used at the same time in some PC cores, could similar functionality be added to other cores to allow for inputs from multiple devices in a single game?

For the most part, yes it can be done, but it has to be done on a core by core basis and not a one solution fixes all type of deal.

thorr
Top Contributor
Posts: 1094
Joined: Mon Jul 06, 2020 9:37 pm
Has thanked: 532 times
Been thanked: 251 times

Re: Input Device Configuration Limitations

Unread post by thorr »

FYI - This will be addressed in a very positive way. We will have the ability to combine inputs into player 1 for whichever cores we want in the .ini file. https://github.com/MiSTer-devel/Main_MiSTer/issues/785 With this latest feature, I can now play SNES Super Smash TV with two arcade joysticks for example. I can map the left joystick and the right joystick to both be SNES controllers where the left one has the D-pad functions, and the right one has the button functions of a single SNES controller. Then I can use both joysticks to play the game to move around and shoot around in different directions. This will also allow multiple USB devices to work with various arcade games that have a variety of controllers for a single player. I really appreciate Sorgelig's efforts to get this implemented!

Hetzen
Posts: 141
Joined: Thu Oct 14, 2021 1:55 pm
Has thanked: 72 times
Been thanked: 43 times

Re: Input Device Configuration Limitations

Unread post by Hetzen »

This is fantastic news. I was about to get into something quite fiddly to address this with the arcade controls I'm currently building. This will make mixing controls much much easier.

Post Reply