PC ver. Suggestion - Custom Device Profiles

As everybody else im waiting for that new version of Retroarch that is gonna rule over all the emulators out there (lol).

One of the things i liked from the Android version is the auto preconfigure option to the pads. As i am using right now more often the pc version was thinking about something…

Could there be an option to have some kind of “custom auto configuration” for the devices?

What i try to say here is to have different mappings for different devices saved (the device named Device1 has this button mapping and the Device2 has this other one, Device3-4-5…etc) and once i connect it i just have to select “Player 1: Device X” and “Player 2: Device Y” for example on the new RGUI and all the buttons are configured automatically taking the conf for that device that we choosed.

Sorry if i cant describe well what i want to say, would be really nice to have this kind of autoconf for pads because when you are with friends and there are a lot of pads around its a bit messy being configuring all the pads all the time.

Hope you guys read it :wink:

Best regards,

No, dear no. Autoconfiguration of pads has been absolute hell to maintain for Squarepusher on Android. On PC it’s even more of a clusterfuck because button layouts can change per input driver and per OS. (E.g. SDL, linuxraw and DirectInput doesn’t map exactly the same way …)

Ideally, we’ll have something like retroarch-joyconfig built into RGUI. Maybe a database could be created locally, which remembers how devices were bound earlier based on device name or something … But there will never be a centrally maintained database for this.

Actually thats what i tried to say! Sorry if i didnt wrote it well…

I dont want an autoconfiguration like the Android version, just being able to save different configurations locally as you say on a database so in the RGUI once i get onto Controller 1 and choose “Device X” i already have saved the inputs for that device.

What Square did on the Android version is really nice but not viable on PC because of what you say, different OS, inputs, etc…

This thing if made you will help a lot of partys/friendship tournaments made at home a lot easier :smiley:

Best regards and thanks for the quick responde, as always :slight_smile:

Was starting to think of a potentially very useful feature which wouldn’t be too complex.

Say you have a gamepad config folder. This folder will be filled with potentially configs for all your gamepads:


input_device = "Foo Gamepad"
a_btn = "..."
b_btn = "..."
left_axis = "..."

When a gamepad is loaded, the device name is read, and compared to all configs in the “database”. If it’s found, and joypad configs for that player isn’t already bound (in main config), it’ll read static binds from that config file and bind stuff for that player automatically.

Combine that with plug and play (inotify on Linux perhaps), and you could have a very consoleque setup for sure. Creating a database could be done collaboratively (by someone else, harhar), and it’s a one-time thing anyways unless you’re completely nuts and want to bind different things to every core …

Thanks for that, hope some day we will see it implemented on Retroarch,

Having device inputs and then giving the chance to set Player1: Device 1, Player 2: Device 2 at any time (RGUI) would be amazing.

About the conf per core…wont be bad but i think is not as important as being able to choose from all your profile devices and only plug the usb and select for the character the device that you want.

If theres anything i could test of this at any given time just let me know!

Retroarch, thanks for existing (and all of you for creating it :D)

Best regards,

That would be awesome, Maister. Especially plug and play is one thing I really miss from consoles. Having to quit and start the application again because for example a controller accidentally got disconnected kind of takes away from the experience.

For reference, which PC-based emulators actually implement plug and play? Would be nice to know.

mupen64plus does. it has a big config file with a lot of controllers in it

https://bitbucket.org/richard42/mupen64plus-input-sdl/src/725bc6d288ae00fea416fb30d38535c1e783a073/data/InputAutoCfg.ini?at=default

Interesting. If I do implement autodetection, someone could write a script which translates that into our format I hope? N64 doesn’t have all the buttons though, but.

First part is done on Linux. I’ve implemented hotplugging. No need to restart anymore to plug in and out gamepads. Next step is adding autoconfigurability support.

It uses inotify to get file system events in /dev/input. Also refactored input code to use epoll() instead of nonblocked reads on every pad.

Also added that to Phoenix to make it consistent. Some input binds might have changed if you’re unlucky.

Ok, I got autoconfigure to work on PC. There were some refactors to input which aren’t fully tested yet, so I pushed it to a branch for now. https://github.com/Themaister/RetroArch/tree/joypad-autoconfig It only works on Linux (with linuxraw driver) for now.

Idea:


# Enable input auto-detection. Will attempt to autoconfigure
# joypads, Plug-and-Play style.
# input_autodetect_enable = true

# Directory for joypad autoconfigs (PC).
# If a joypad is plugged in, that joypad will be autoconfigured if a config file
# corresponding to that joypad is present in joypad_autoconfig_dir.
# Input binds which are made explicit (input_playerN_*_btn/axis) will take priority over autoconfigs.
# Autoconfigs can be created with retroarch-joyconfig, manually, or with a frontend.
# Requires input_autodetect_enable to be enabled.
# joypad_autoconfig_dir =

Promoted input_autodetect_enable setting from Android.

Here’s an example autoconfig, xbox-wireless.cfg:


input_device = "Xbox 360 Wireless Receiver"
input_driver = "linuxraw"
input_b_btn = "0"
input_y_btn = "2"
input_select_btn = "6"
input_start_btn = "7"
input_up_btn = "13"
input_down_btn = "14"
input_left_btn = "11"
input_right_btn = "12"
input_a_btn = "1"
input_x_btn = "3"
input_l_btn = "4"
input_r_btn = "5"
input_l2_axis = "+2"
input_r2_axis = "+5"
input_l3_btn = "9"
input_r3_btn = "10"
input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+4"
input_r_y_minus_axis = "-4"

You can add other binds as well if you want (–misc in joyconfig for one).

There’s only input as prefix, and not input_playerN since it’s player-agnostic (only cares about joypad itself).

I added some functionality to retroarch-joyconfig so it can create these autoconfigs.


retroarch-joyconfig --autoconfig /autoconfig/folder/pad.cfg -j joypad_index

I also added some “fixes” to joyconfig. Now you’ll be prompted first to clear out state before you start initial poll. Some pads/drivers are kinda ugly here and start with garbage state …


Found joypad driver: linuxraw
Using joypad: Xbox 360 Wireless Receiver

Joypads tend to have stale state after opened.
Press some buttons and move some axes around to make sure joypad state is completely neutral before proceeding.
When done, press Enter ... 

You should see an on-screen message in RetroArch when autoconfigure goes right (and in regular log).

You can change selected device now as well in RGUI. Should be pretty powerful now.

This sounds great. Very convenient.

Glad to hear this is turning real, as far as there is any windows version precompiled out there with this i´ll try it out.

Hope we can change Device-PlayerX on the new RGUI with just a few seconds and plugging the pad, will be really, really nice.

Best regards,

Dunno about hotplugging on Windows (DirectInput). Patches welcome.

So… Did you want a database or not? If you want it, I’ll upload profiles for whatever controllers I can get working here. Either way, really nice work.

If i get it right the idea is that everyone can make their own database (or txt files) of their own pads, not like the android version to have a universal database of controllers. Or at least that was the idea i wanted to put on the thread, that and the chance to change device-player relation at any time via RGUI.

I know maybe i am not explaining this well, you will understand it this way.

Imagine a fighting game tournament, you have some people everyone with their own device and everyone could be on the Player 1-2 side. The idea is that i only need to bind input for every pad once (on a txt-database file) and then once i got the game running i only need to plug the controller and on RGUI (or Phoenix) i only need to say that for that fight Player1=DeviceX and Player2=DeviceY, maybe a few fights later that DeviceX could be on Player 2, etc…

I know its easier to write here than coding it (hope i could know how to code this stuff), the idea is to have less time configurating inputs and more playing the games.

Thanks in advice, this is the first forum i see on the web that the emulator developers actually say what they think of the ideas of the people, since i got Retroarch on PC and Android i dont use any other emulator (again, because binding inputs once it works for all the cores, something amazing)

Thanks again!

Best regards,

Oh ok. Well it’s fine with me either way, I was just wondering in case there would be any way for me to contribute, since I can’t code and I couldn’t save up for that iPad.

If i get it right the idea is that everyone can make their own database (or txt files) of their own pads, not like the android version to have a universal database of controllers. Or at least that was the idea i wanted to put on the thread, that and the chance to change device-player relation at any time via RGUI.

I know maybe i am not explaining this well, you will understand it this way.

Imagine a fighting game tournament, you have some people everyone with their own device and everyone could be on the Player 1-2 side. The idea is that i only need to bind input for every pad once (on a txt-database file) and then once i got the game running i only need to plug the controller and on RGUI (or Phoenix) i only need to say that for that fight Player1=DeviceX and Player2=DeviceY, maybe a few fights later that DeviceX could be on Player 2, etc…

I know its easier to write here than coding it (hope i could know how to code this stuff), the idea is to have less time configurating inputs and more playing the games.

Thanks in advice, this is the first forum i see on the web that the emulator developers actually say what they think of the ideas of the people, since i got Retroarch on PC and Android i dont use any other emulator (again, because binding inputs once it works for all the cores, something amazing)

Thanks again!

Best regards,[/quote]

On Linux, your use case is implemented now. Not sure if it can be done on Windows (without a million hacks).

Oh god thanks! As far as it gets an official release or someone precompiles this i have to start thinking on which linux distro to use for this and XBMC to have my full media center haha, maybe Ubuntu will make it.

Thanks once more, will wait if it can get onto the windows version or getting a dual boot with any linux distro.

Best regards,