RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    [SOLVED] Controller Detection & Switching? GPIO/USB/Bluetooth

    Scheduled Pinned Locked Moved Help and Support
    bluetoothgpiousbcontroller
    17 Posts 3 Posters 10.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • obsidianspiderO
      obsidianspider @meleu
      last edited by

      @meleu I guess I'll have to think about if I want to go Bluetooth, but you answered my question so I'm going to mark this as solved and get back to messing with Python and Bash while I wait for more parts to arrive…

      📷 @obsidianspider

      FloobF 1 Reply Last reply Reply Quote 0
      • FloobF
        Floob @obsidianspider
        last edited by

        @obsidianspider I use a USB and 8bitdo, they work well with eachother as far as I can tell. Both 1 player and 2 player.

        Please read the Docs before asking a new question.
        RetroPie Help Guides: https://goo.gl/3gcNsT

        obsidianspiderO 1 Reply Last reply Reply Quote 1
        • obsidianspiderO
          obsidianspider @Floob
          last edited by

          @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

          meleuM 1 Reply Last reply Reply Quote 0
          • meleuM
            meleu @obsidianspider
            last edited by meleu

            @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

            • Useful topics
            • joystick-selection tool
            • rpie-art tool
            • achievements I made
            1 Reply Last reply Reply Quote 1
            • meleuM
              meleu
              last edited by meleu

              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?

              • Useful topics
              • joystick-selection tool
              • rpie-art tool
              • achievements I made
              obsidianspiderO 1 Reply Last reply Reply Quote 1
              • obsidianspiderO
                obsidianspider @meleu
                last edited by

                @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

                meleuM FloobF 2 Replies Last reply Reply Quote 0
                • meleuM
                  meleu @obsidianspider
                  last edited by

                  @obsidianspider
                  Indeed, that all_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!

                  • Useful topics
                  • joystick-selection tool
                  • rpie-art tool
                  • achievements I made
                  obsidianspiderO 1 Reply Last reply Reply Quote 1
                  • obsidianspiderO
                    obsidianspider @meleu
                    last edited by

                    @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

                    1 Reply Last reply Reply Quote 0
                    • FloobF
                      Floob @obsidianspider
                      last edited by

                      @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.

                      Please read the Docs before asking a new question.
                      RetroPie Help Guides: https://goo.gl/3gcNsT

                      obsidianspiderO 1 Reply Last reply Reply Quote 0
                      • obsidianspiderO
                        obsidianspider @Floob
                        last edited by obsidianspider

                        @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

                        meleuM 1 Reply Last reply Reply Quote 0
                        • meleuM
                          meleu @obsidianspider
                          last edited by

                          @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. ;-)

                          • Useful topics
                          • joystick-selection tool
                          • rpie-art tool
                          • achievements I made
                          obsidianspiderO 1 Reply Last reply Reply Quote 1
                          • obsidianspiderO
                            obsidianspider @meleu
                            last edited by

                            @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

                            meleuM 1 Reply Last reply Reply Quote 1
                            • meleuM
                              meleu @obsidianspider
                              last edited by

                              @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...

                              • Useful topics
                              • joystick-selection tool
                              • rpie-art tool
                              • achievements I made
                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post

                              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.