[SOLVED] Controller Detection & Switching? GPIO/USB/Bluetooth
-
@obsidianspider I use a USB and 8bitdo, they work well with eachother as far as I can tell. Both 1 player and 2 player.
-
@Floob This is probably a dumb question, but when using both together, or switching back and forth, how does that work? I assume you can't just switch while in a game, but do you have to reboot the Pi before switching controllers? Do you have to unplug the USB controller to have the Bluetooth take over as Player 1? Since my USB adapter will be plugged in all the time that's where my concern comes in.
My ideal situation would be something like "Oh, hey, that Bluetooth controller you previously set up has connected, I'm going to use that instead of the USB one" and then if the Bluetooth controller isn't connected, fall back to the USB one. With multiplayer and all sorts of other variables I have a feeling I may need to just buy a Bluetooth controller and mess around with it.
-
@obsidianspider said in [SOLVED] Controller Detection & Switching? GPIO/USB/Bluetooth:
when using both together, or switching back and forth, how does that work? I assume you can't just switch while in a game, but do you have to reboot the Pi before switching controllers?
Your question make it seem like you didn't read my previous posts... :)
Is there a way to switch it on the fly?
For RetroArch, yes! You can have some issues, but if you update RetroArch from source it'll be solved. I'm talking about it here: https://retropie.org.uk/forum/topic/3882/change-retroarch-controllers-index-on-the-fly-with-no-issues
I've seen things about fussing with config files, but I'm hoping there's a way to easily switch once the system is configured.
You can use this tool to simplify some configs: https://github.com/meleu/RetroPie-joystick-selection
-
Just to make it really clear: when I say "switch controllers on-the-fly", I mean "switch controllers during a game". You definetely don't need to reboot to change the controllers between players.
The only emulator I know that is very limited in doing these controller changes is pifba. But you are probably using a libretro fba core, right?
-
@meleu I did read your earlier posts and I appreciate them. I was just asking Floob how it was working with his setup as it looks like the very new RetroArch solution (so new that version of RetroArch isn't in RetroPie) that you found requires something I would assume most people haven't done.
-
@obsidianspider
Indeed, thatall_users_control_menu
option is a new feature. In my opinion this option is needed to switch controllers on-th-fly with no issues (the issues I'm talking about basically happens when switching the player1 joypad, details here).But the other methods (RetroPie-joystick-selection, RetroPie-Setup config editor, or manually edit the
retroarch.cfg
) works out-of-the-box. You only have to exit the emulator. There's no need to reboot your raspi.Keep in mind that the joystick connection method (USB, GPIO, Bluetooth, whatever) is the OS responsibility. For RetroArch the connection method doesn't matter, it only gets the available joysticks from the OS. Therefore, all the switching controllers methods I showed you works fine for GPIO, USB, and Bluetooth joysticks. (I saw some posts here in the forum saying that some devices (eg: IPAC2) are recognized as a keyboard in RetroPie, but I think it's not your case.)
BTW: yours SuperFamicom build looks really great! I would like to have this enough electronics knowledge to build one for me! :-)
Cheers!
-
@meleu said in [SOLVED] Controller Detection & Switching? GPIO/USB/Bluetooth:
Keep in mind that the joystick connection method (USB, GPIO, Bluetooth, whatever) is the OS responsibility. For RetroArch the connection method doesn't matter, it only gets the available joysticks from the OS. Therefore, all the switching controllers methods I showed you works fine for GPIO, USB, and Bluetooth joysticks. (I saw some posts here in the forum saying that some devices (eg: IPAC2) are recognized as a keyboard in RetroPie, but I think it's not your case.)
That makes sense. I was just asking here because I don't want to end up buying a $35 controller and then not be able to use it the way I want.
BTW: yours SuperFamicom build looks really great! I would like to have this enough electronics knowledge to build one for me! :-)
Thanks. I really don't know what I'm doing. It's been a lot of reading, followed by trial and error. I had more parts show up today so hopefully I can make some progress this weekend on the hardware.
-
@obsidianspider No need to reboot the Pi to get the game to detect which controller is plugged in. Its happy to detect whats plugged in at the time, although I havent tested to see how easy it is to force a controller to be player 1 - I'm using a Pi3.
-
@Floob If you have a USB controller plugged in, then pair a Bluetooth controller (USB still plugged in) how does the system choose which controller to use? (I'm assuming it'll use the one that's USB, maybe making the Bluetooth Player 2?)
I think I'm going to run into issues because I'm never going to be unplugging the USB SNES controller adapter as it'll be built into the case.
-
@obsidianspider said in [SOLVED] Controller Detection & Switching? GPIO/USB/Bluetooth:
how does the system choose which controller to use?
forgive me if you just want a second opinion... but I explained you what happens in my first response to your post. ;-)
-
@meleu It was more of me asking in layman's/simpler terms. Like "Ok, I did this, now what did the Pi do?" I'm going to stop asking follow up questions until I actually get a Bluetooth controller and can't figure it out. :-P
-
@obsidianspider
you may have some issues in connecting and configuring the buttons of your bluetooth controllers. But once it's done, it's really easy to switch between the available controllers in RetroArch.Trying to ask your question "how does the system choose which controller to use?" (assuming system = RetroArch). Like I said in my first response, RetroArch define some indexes for the controllers. The default is player1 = index 0, player2 = index 1, and so on (I didn't make it clear in my first post). But you can change it in retroarch.cfg. What the RetroPie-Setup config editor and my joystick-selection tool do is just this: change these options in retroarch.cfg.
BTW: the options related to what we are talking about here are
input_player1_joypad_index
,input_player2_joypad_index
, etc...
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.