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

    Controllers with analog triggers won't configure properly

    Scheduled Pinned Locked Moved Help and Support
    controllersestationjstesttriggers
    14 Posts 3 Posters 5.9k 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.
    • mituM
      mitu Global Moderator @rilight
      last edited by mitu

      When using the USB connection, the xpad driver would be used for XInput/Xbox type controllers and the shoulder triggers would register as buttons as instead of axis. With Bluetooth, this doesn't apply and it looks like the negative axis movement reported for them are filtered out by EmulationStation's input configuration (here).

      Now, what you could do, without modifying EmulationStation

      • install the xpadneo driver and see if the triggers are recognized. You'll have to re-pair and re-configure the input again.
      • add the L2/R2 triggers manually to RetroArch's configuration file, based on this configuration file. You only need to add the input_l2_axis and input_r2_axis - but in the RetroArchs repository they're bound +axis<X>, you're probably going to switch the direction and see if it works in-game. If it doesn't, then this might be the reason why the ES configuration ignores them.
      • use jscal and correct the trigger axis to repor the correct values so they'd work from 0 to +32767 instead. That might be the correct solution if the gamepad's firmware is not correctly reporting those values.
      1 Reply Last reply Reply Quote 0
      • R
        rilight
        last edited by

        I installed xpadneo, removed my controller, completely rebooted, re-paired and attempted to configure the input again. It still didn't recognize my triggers. I skipped the manual RetroArch configuration for now since I wasn't quite sure what to do and I wanted to try jscal first. I used it to calibrate the controller, but that also didn't change anything—the controller still reports negative values at resting position. At this point I feel like fixing EmulationStation to actually recognize the controller would be the nicest option, especially since it would prevent the issue for anyone else using the same or similar controllers going forward.

        mituM 1 Reply Last reply Reply Quote 0
        • mituM
          mitu Global Moderator @rilight
          last edited by mitu

          @rilight said in Controllers with analog triggers won't configure properly:

          skipped the manual RetroArch configuration for now since I wasn't quite sure what to do

          Just configure the controller in ES, ignoring the shoulder triggers, then open the generated .cfg file in \\retropie\configs\all\retroarch-joypads and add 2 lines for input_l2_axis and input_r2_axis with -2 and -5 respectively. See if that works.

          At this point I feel like fixing EmulationStation to actually recognize the controller would be the nicest option

          There might be a proper reason why this configuration is filtered, I would suggest first to test the with a modified RetroArch auto-configuration profile and see if it works.

          1 Reply Last reply Reply Quote 0
          • R
            rilight
            last edited by

            My bad, I didn't understand the reason for trying it that way. I'll check and report back.

            1 Reply Last reply Reply Quote 0
            • R
              rilight
              last edited by

              Setting the axes to -2 and -5 didn't work. However, setting them to +2 and +5 as in the example configuration seems to work in-game.

              1 Reply Last reply Reply Quote 0
              • R
                rilight
                last edited by

                So, what do you think this means in terms of EmulationStation not recognizing the inputs / what could be done to fix the problem?

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @rilight
                  last edited by

                  Looking at the code in ES that filters out the controls, I think it's doing the right thing - if the exception wouldn't have been made, the resulting configuration would be

                  input_l2_axis = -2
                  input_r2_axis = -5
                  

                  which is not a working configuration, as you discovered. I'm not familiar with that part of the code, but I assume this must have been the reason the trigger axis configuration is ignored.

                  1 Reply Last reply Reply Quote 0
                  • R
                    rilight
                    last edited by

                    That makes sense, I'm just wondering if there's a way to fix it so that it recognizes the correct axes. When the button is pressed down, it registers as the positive axis. The issue is that on return, it overshoots to the negative position instead of resting at 0. Instead of filtering out negative axes entirely, would it be possible to test for this kind of situation? It seems like multiple controllers unfortunately violate the SDL specification in the same way.

                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @rilight
                      last edited by

                      @rilight said in Controllers with analog triggers won't configure properly:

                      When the button is pressed down, it registers as the positive axis. The issue is that on return, it overshoots to the negative position instead of resting at 0. Instead of filtering out negative axes entirely, would it be possible to test for this kind of situation?

                      The problem with mapping the triggers is discussed in the issue that started this. It doesn't seem there is a reliable way to test for this situation and choosing the negative axis as a result breaks RetroArch

                      Since we can't set the axis number without polarity in mapping configuration, we have to choose either the negative or positive pole. Choosing the positive pole means that a firm press is needed, but the negative pole will cause triggers to be too sensitive. I chose the positive pole to keep it in line with the default PS3 controller mapping seen in software such as Kodi.

                      If there was a way to calibrate the axes to normalize the range from 0-32767 at a driver level, we could avoid this issue, but I'm not aware of a way to do it using the available evdev userspace tools.
                      ..

                      1 Reply Last reply Reply Quote 0
                      • R
                        rilight
                        last edited by rilight

                        Ah right, that makes sense reading back over it. In that case, I'll make a PR to whitelist the SDL ID of the SF30 Pro in XInput mode if that would work. Thanks for the help and sorry for my apparent inability to read 😅

                        1 Reply Last reply Reply Quote 0
                        • K
                          KenDB3
                          last edited by KenDB3

                          I know this is old, but this is the only thread that keeps coming up in searches that has fixed this problem for me, and I wanted to say thanks, and also include my controller model in case it helps anyone else.

                          Controller: GameSir G3s controller in X-input mode.
                          Left and right triggers were working at one point, and somewhere along the line, remapping the controller broke analog L2/R2. However, manually editing the config, like the user above (rilight) to +2 and +5 (yes, you need the + in there), fixed it for me. Specifically, this problem was plaguing me while playing OutRun on MAME.

                          Just wanted to say thanks to mitu and rilight. ;-)

                          1 Reply Last reply Reply Quote 0
                          • B bmn001 referenced this topic on
                          • 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.