[SOLVED] Generic chinese controllers on Lakka? Chinaware Best practice

Hello folk!

I installed Lakka and it’s very amazing. But I have one problem.

I have two NES, SNES, N64 and PSX controller ordered from China. The aim is to change/plug the controllers with their core.

For example N64: I disabled the “autoconfig enable” option, then I do “User 1 bind all”, start a N64 game, go to “menu toggle gamepad” (retroarch menu), under “controlls” I save the Remap File, hoping it load the remap file independent from the plugged controller, but it doesnt work. He looks at what was configured the last time. with the option “bind all”.

That’s not the aim, because each core must have his own input-configuration independent from the plugged controller.

What’s the best way? Or: Can you tell me, in which Config-File I can put the path to the cfg. Files? With Recalbox it was “recalbox.conf”

Thank you very much folks!

best regards from switzerland

Braxtor

You want to keep autoconfiguration ON, create autoconfig profiles for your pads if they don’t exist already and then use core input remapping to move the core’s buttons around on the retropad abstraction as necessary. Then, you can just plug each controller in when you launch the appropriate core/game.

1 Like

The problem is because of the several same-name-china-controllers. I need a static map for each core. In Recalbox you can do it by linking the cfg. file in recalbox.conf.

With the remap-function you can change only buttons (for example SNES), but when you plug a PS1 china-controller with the same name like the SNES controller "usb gamepad ", lakka means that I have plug the SNES controller and Then remapping-function does nothing more.

I have tested the following steps: I plug a SNES controller and then in Lakka Menu I make “bind all”, start a SNES game, go to “menu toggle gamepad” (retroarch menu), under “controlls” I save the Remap File…but Lakka always considers the connected controller. I need a static map without check of the plugged controller. That’s important, because the are aprox. 8 controllers. And some of them with the same name, because the are controllers orderet from china.

I don’t want any autoconfiguration. With Recalbox is this possible.

I need your support folks! Am I the only one who has the problem?

Recalbox uses EmulationStation as a launcher, right? If so, disable autoconfig, plug in a pad, go to settings > input > user 1 input binds and map your controller. Go back to the main menu > configuration > save new configuration. Then, in EmulationStation, when you set up your launch commands, you can point to that configuration file with the -c or --config command line switch (e.g., retroarch -L /path/to/core -c /path/to/config %rom%). Repeat for each core/controller combination you want.

I do not quite understand how you make the lines.

Yes.

In Recalbox you put the lines in recalbox.conf like this snes.configfile=/recalbox/share/system/configs/retroarch/inputs/snesnonamecontrollers.cfg nes.configfile=/recalbox/share/system/configs/retroarch/inputs/nesnonamecontrollers.cfg psx.configfile=/recalbox/share/system/configs/retroarch/inputs/psxnonamecontrollers.cfg n64.configfile=dummy

I don’t know anything about configuring RecalBox or EmulationStation. We don’t use or know how to support them, so you might have better luck asking at their forums.

I think I have a solution.

I install Lakka fresh, after that, I make sure I have each core. Then:

I put each controller in sequence and do “bind all” one by one. After each time I simply copy the bind settings from retroarch.cfg and put in for e example SNES: /storage/remappings/Snes9x(example)/Snes9x(example).rmp

input_player1_b = “z” input_player1_b_btn = “2” input_player1_b_axis = “nul” etc. etc.

What do you mean about that?

Do I have to leave “autoconfig” enabled in Lakka Menu? Not really, right?

I hope it helps other users with controller with the same name or users who simply want to have a static map. In my opinion, the autoconfig is dangerous for china controllers or same-name controllers.

It doesn’t work. :cry:

For example, for SNES in retroarch.cfg:

Input_player1_up = "up"
Input_player1_up_btn = "nul"
Input_player1_up_axis = "+1"
Input_player1_down = "down"
Input_player1_down_btn = "nul"
Input_player1_down_axis = "-1"

In Snes9x.rmp:

input_player1_up = "5" input_player1_down = "4"

Where do I get the values for the remap? I tried almost everything…with axis = "+1", axis = "-1"… doesnt’ work.

Actually, the “Bind-All” function would suffice for “remapping”. But there is no “bind-all” function in the remappings.

Is there really no way to make the controllers static for each core?

Any idea? Is there really no way to make the controllers static for each core?

Hello @Braxtor, I’m trying to understand why the solutions proposed by hunterk are not working for you. And I think the fact that the controllers all have the same name is not helping. I guess they also have the same vid:pid?

Recalbox can have static maps for each cores because they launch a new instance of retroarch each time you start a game. They can specify a path for the retroarch.cfg where the static map is.

In Lakka, RetroArch is launched only once, and we have a single retroarch.cfg. What you want to do is usually achieved with either autoconfig or remapping. But you can’t do this because of the identical names.

So, if the controllers have a different vid:pid, you could use this to make autoconfig work. If not, I see no way to fix your problem with the current code. You’re combining two rare conditions here: wanting to switch controllers for each core, and having controllers with the same names. This is what we call an edge case…

Many thanks for your response. I appreciate it.

No not that. That’s how it looks.

Lakka looks only at the name.

Yes. Thousand times tried with Remapping and Autoconfig. Both are useless in this case.

I tried also to use the edited retroarch-core-options.cfg.

It doesn’t work.

How? I put a controller make bind all and save autoconfig for each controller. But Lakka just looks at the name. Must i switch the cfg Files to the other autoconfigurations or so?

With all respect: Thats not true. I want to switch the controllers because of the nostalgic feeling during the game. The Lakka-System serves also to play with guests. I had the same problem with Recalbox and I was the first one dedicated to the topic. You can see the hits in comparison to the others. https://forum.recalbox.com/topic/3502/solved-how-to-configure-several-same-name-controllers-chinaware-in-recalbox People write me in the Inbox and ask me specific questions. One bought his controller from Ebay and had the same problem. I bought this controllers from Aliexpress, because they was cheap. Here example: https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20170327025609&SearchText=nes+controller The reason is also to allow other people and children to buy and make a cheap console. You can have the same controllers on ebay. I have two NES, SNES, N64 and PSX controller.

Lakka does not work with multiple controllers from China. Point.

A important feature request would be: Static controller map per each core.

To be honest, I give up.

From what I see in your screenshots, the vendor id, the product id, and the device name are differents. "usb gamepad " and "USB Gamepad " are clearly differents.

So you can certainly use autoconfig. RetroArch uses a score system to match the right config, if the 3 criteria matches, you get a score of 3, if only vid and pid match, you get a score of 2, of only the name match, you get a score of 1, if nothing match, you get a score of 0. The highest score is chosen.

What can cause this bug, is having another configuration with the same name in your autoconfig directory. You can just delete all the stuff with rm /tmp/joypads/udev/* then generate your two config files again.

Then, you launch retroarch manually, with the -v flag, to be able to see the log.

You plug a first controller, and you check if the autoconfig is matched. And you do the same for the next one.

That will be a good start.

EDIT: also, do a

systemctl stop retroarch rm .config/retroarch/retroarch.cfg systemctl start retroarch

To purge your config file.

Thank you. I will test it later.

But one important point:

I’m not sure. It was a fresh installation from lakka today, then i just put two ROMs and then the controller configuration with “bind all” and “save autoconfiguration”.

The NES Controller is "usb gamepad [lots spaces] " The SNES Controller is "USB Gamepad [one or two spaces] "

I think thats not a difference for Lakka. But i will test it again later.

Well I wrote the autoconfig score code myself so I can swear that we’re doing a plain old good string comparison on the device name, and that there is no way that "usb gamepad [lots spaces] " equals "USB Gamepad [one or two spaces] " in a C program.

There is one case where we can’t do anything:

Joypad 1 : https://github.com/libretro/retroarch-joypad-autoconfig/blob/cf40f1dd9b23a8b59739461634077da60cb84cdf/udev/usb_gamepad___________(NES).cfg#L7-L9

Joypad 2 : https://github.com/libretro/retroarch-joypad-autoconfig/blob/cf40f1dd9b23a8b59739461634077da60cb84cdf/udev/usb_gamepad___________(SNES).cfg

In this case, the 3 criteria are the same, and RetroArch have no way to choose the right config file.

If you happen to be in this case, you need to use Advanced Settings, and load a different retroarch.cfg depending on the core you’re going to run. It can be done through the Main Menu. Certainly not as neet as Recalbox, but still better than nothing.

1 Like

How would autoconfig work for 2 x retropads on 1 usb cable?, i guess they call it dual pads

It seems to work. WOOOOOOHOOOOOOOOOOOOOOOOOOOO :cow::water_buffalo::ox::tiger2::rooster: :raised_hands:

Can you explain me some points. It’s important for me.

When I did, the folder filled. Must I delete all this CFG files?

Do I always have to do systemctl stop retroarch rm .config/retroarch/retroarch.cfg systemctl start retroarch after I make “bind all” and “save autoconfig” on the GUI?

I have Lakka again freshly installed, “bind all” and “save autoconfig” made and only this command executed. And it works.

Why is this not described here? http://www.lakka.tv/doc/Configuring-Lakka/ Or here? http://www.lakka.tv/doc/Configuring-Lakka/

I think that was the big mistake. Because when I had stored a thousand times the autoconfiguration, a reboot or shutdown did nothing. Also in this case not. Only with this command executed is Lakka aware of the changes with the new CFG files.

Tomorrow I will configure all controllers and test all. Then I know for sure if it works.

These files you see in the dev folder are empty files. It’s the consequence of the deletion of the config files. It’s because we use OverlayFS, a layering system for our filesystems. Lakka has a read only rootfs, to allow overriding some files in the system, we use this layer strategy. Deleting a file results in creating an empty file in the top layer. So you don’t need to care about these files. They were not appearing before because they were equal on all layers.

You don’t have to purge your tetrarch.cfg every time. It was just to ensure that your retro arch.cfg is clean after all the changes you tried during the last days.

This is not described in our documentation because I wasn’t aware that some people pushed generic chinese configs in our joypad-autoconfig repository. I’m discussing with these contributors to remove their config files from here, since they are causing conflicts.

You may encounter this bug again if you have two or three controllers with the exact same name:vid:pid. I hope all of yours are different. If so, it will work just fine. The joypad manufacturer have to care about incrementing the product ID when they release a joypad that doesn’t have the same circuit board.

The only thing that brought me further is this command - after I bind the controllers one by one. (for other users helpful to know)

systemctl stop retroarch
rm /storage/.config/retroarch/retroarch.cfg
systemctl start retroarch

You don’t have to delete the configs with rm /tmp/joypads/udev/* Because is more clearer with original empty folder \Joypads\udev and only with the specific configs. After I bind all controllers, I rename the CFG-files like “N64.cfg”. Thats clearer and it works.

And as you say, it works only if at least the vid and pid are different from controller to controller.

I happen to have the NES and SNES controller described in post number 14, the “in this case we can’t do anything” post. What would be the best practice to be able to use them to play, even if i have to tinker a bit manually before doing so? Is there a way to manually load a controller config before playing without having to bind everything manually?

Thanks in advance.

Did you have try this?

But it really makes no sense. If vid and pid are the same, you need other controllers. So changing the cores is no fun.

You have to adapt to each core the retroarch.cfg and always load manually before playing. Have not tried, and know it only theoretically for Lakka.

Here for example you can order more cheap controllers. Order and hope its not the same vid or pid