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

    Guide: Advanced Controller Mappings

    Scheduled Pinned Locked Moved Help and Support
    joystickcontrollermappingxboxdrvscummvm
    626 Posts 35 Posters 460.5k 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.
    • ExarKunIvE
      ExarKunIv @mediamogul
      last edited by

      @mediamogul

      tired that too, still nothing

      RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
      RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
      Maintainer of RetroPie-Extra .

      mediamogulM 1 Reply Last reply Reply Quote 0
      • mediamogulM
        mediamogul Global Moderator @ExarKunIv
        last edited by

        @ExarKunIv

        Try putting the following at the top of your runcommand-onstart:

        ## Name of the emulator
        echo $1 >> /dev/shm/runcommand.log
        
        ## Name of the software used for running the emulation
        echo $2 >> /dev/shm/runcommand.log
        
        ## Name of the rom
        echo $3 >> /dev/shm/runcommand.log
        
        ##Executed command line
        echo $4 >> /dev/shm/runcommand.log
        

        Then, after you launch solarus, look at your /dev/shm/runcommand.log file and list what's on the first four lines.

        RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

        ExarKunIvE 1 Reply Last reply Reply Quote 0
        • ExarKunIvE
          ExarKunIv @mediamogul
          last edited by

          @mediamogul

          zelda_roth_se
          solarus
          
          LD_LIBRARY_PATH=/opt/retropie/ports/solarus/lib /opt/retropie/ports/solarus/bin/solarus_run /opt/retropie/ports/solarus/share/solarus/zelda_roth_se/
          /opt/retropie/configs/all/runcommand-onstart.sh: line 109: syntax error near unexpected token `&'
          /opt/retropie/configs/all/runcommand-onstart.sh: line 109: `&'
          Parameters: 
          Executing: LD_LIBRARY_PATH=/opt/retropie/ports/solarus/lib /opt/retropie/ports/solarus/bin/solarus_run /opt/retropie/ports/solarus/share/solarus/zelda_roth_se/
          Solarus 1.4.5
          Opening quest '/opt/retropie/ports/solarus/share/solarus/zelda_roth_se/'
          AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"
          2D acceleration: yes
          

          ask and you will receive

          RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
          RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
          Maintainer of RetroPie-Extra .

          mediamogulM 1 Reply Last reply Reply Quote 0
          • mediamogulM
            mediamogul Global Moderator @ExarKunIv
            last edited by mediamogul

            @ExarKunIv

            Based on "solarus" being the second line,

            if [ "$2" = "solarus" ]
            

            should be doing the trick. After you launch solarus with that setting, check to see if xboxdrv is at least launching alongside it from another terminal.

            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

            ExarKunIvE 1 Reply Last reply Reply Quote 0
            • ExarKunIvE
              ExarKunIv @mediamogul
              last edited by

              @mediamogul

              how do i check if xboxdrv is running.

              and should i worry about /opt/retropie/configs/all/runcommand-onstart.sh: line 109: syntax error near unexpected token &'
              /opt/retropie/configs/all/runcommand-onstart.sh: line 109: &'

              RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
              RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
              Maintainer of RetroPie-Extra .

              mediamogulM 1 Reply Last reply Reply Quote 0
              • mediamogulM
                mediamogul Global Moderator @ExarKunIv
                last edited by

                @ExarKunIv

                how do i check if xboxdrv is running.

                You can run top via ssh.

                and should i worry about... line 109

                It might be the issue here. If nothing else, it's likely to be some other issue that needs looking at. Take a look at line 109 of the runcommand-onstart.sh closely to see if anything stands out.

                RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                ExarKunIvE 1 Reply Last reply Reply Quote 0
                • ExarKunIvE
                  ExarKunIv @mediamogul
                  last edited by

                  @mediamogul

                  again thank you for the help.

                  i ran top and xboxdrv is running.
                  so i took a better look at the code. i did not see anything so i deleted

                  &
                  fi
                  

                  and copyed it from a code above and it worked. i think i had a enter before

                  &
                  fi
                  

                  would not of thought that would of done it, and

                  if [ "$2" = "solarus" ]
                  

                  works great

                  RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                  RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                  Maintainer of RetroPie-Extra .

                  mediamogulM 1 Reply Last reply Reply Quote 1
                  • mediamogulM
                    mediamogul Global Moderator @ExarKunIv
                    last edited by

                    @ExarKunIv

                    i think i had a enter before

                    Nice catch!

                    works great

                    Good to hear.

                    RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                    1 Reply Last reply Reply Quote 0
                    • C
                      Chillimonster
                      last edited by

                      Been linked to this thread whilst trying to sort Daphne / Dragonrise issues.

                      Looks like this could work.

                      Just need to get my head around how it all works and generate a config file (only 210 posts to read through!)

                      Thanks for the work that has gone into this.

                      1 Reply Last reply Reply Quote 1
                      • E
                        EVEGames
                        last edited by

                        @mediamogul ,
                        This guide is a jem, thank you for creating it and monitoring this thread for the past seven months.
                        Quick question please.
                        I just switched from a wired SNES style pad to a wireless XBox360 controller, and following the instructions on the GutHub RetroPie Setup Wiki for XBox360 controllers, I was lead to believe that XPad is the way to go, due to kernel issues plaguing XBoxdrv. But I see that this thread still has people using XBoxdrv, and clearly XBoxdrv is vastly more configurable than XPad. So my question, before fully diving into this guide and applying it, is, are the warnings against using XBoxdrv unfounded? Let me put it another way, is there a single specific pitfall to avoid which would render XBoxdrv problematic? If it's about the kernel, any hints on how to determine what version of the kernel I am currently on, and how to avoid updating it in the future would be a big help. If the answer to these questions is available in the pages of this thread, please let me know that and I'll search it out.
                        Thanks!
                        -Dave

                        mediamogulM 1 Reply Last reply Reply Quote 0
                        • C
                          Chillimonster
                          last edited by

                          To save me a lot of reading can someone give me a set of simplified steps to implement this for daphne and my dragonrise zero delay encoder, or even the most relevant posts to read

                          There is a lot of stuff in here that i'm not too sure of and dont want to mess my system up (Have taken a backup just in case!)

                          1 Reply Last reply Reply Quote 0
                          • mediamogulM
                            mediamogul Global Moderator @EVEGames
                            last edited by mediamogul

                            @EVEGames

                            are the warnings against using XBoxdrv unfounded?

                            xboxdrv has two different modes of operation. The first acts as a tailored driver for an XBox 360 controller. It's here where there are kernel issues and if the goal is to simply get an XBox 360 controller up and running, then XPad is recommended. However, xboxdrv can also act as a mapping soltion for any controller that reports itself as a joystick event to the system, which also happens to apply to an XBox 360 controller. Using it in this way presents no kernel conflicts to my knowledge.

                            @Chillimonster

                            To save me a lot of reading can someone give me a set of simplified steps to implement this for daphne and my dragonrise zero delay encoder

                            While the information is currently unfamiliar to you and seems like a lot to digest, don't let it put you off too badly. Most of the length of the guide is dedicated to detailing the minor steps that are sometimes taken for granted. Make no mistake, this is more of an advanced technique than just normally configuring your controller, but by documenting every button press and keystroke along the way, you might be surprised at how quickly it moves from top to bottom once begun.

                            When I replied to you earlier, I took a brief look at the dragonrise zero delay encoder and what I found seemed to indicate that it identifies itself as a joystick event, which would allow it to work here. However, some encoders identify as a keyboard and cannot be mapped by xboxdrv. Fortunately, if you decide to move forward with this, you'll know in the earliest steps of the guide whether this will ultimately be possible when running evtest. If your button presses come back as BTN_ you can continue on. If they come back KEY_ then unfortunately it's not going to work, but at least you won't have wasted much time on anything.

                            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                            C E 2 Replies Last reply Reply Quote 1
                            • C
                              Chillimonster @mediamogul
                              last edited by

                              @mediamogul

                              Many thanks for the clarification on the DR encoders.

                              Will have a play later and report back (as no doubt a config file will be of use to others if i get it working)

                              Chris

                              mediamogulM 1 Reply Last reply Reply Quote 1
                              • mediamogulM
                                mediamogul Global Moderator @Chillimonster
                                last edited by

                                @Chillimonster

                                a s no doubt a config file will be of use to others if i get it working

                                Very much so.

                                RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                1 Reply Last reply Reply Quote 0
                                • C
                                  Chillimonster
                                  last edited by

                                  When i run evtest i get continuous scrolling of various text.

                                  Is there any way to stop it to get the details i need?

                                  mediamogulM 1 Reply Last reply Reply Quote 0
                                  • mediamogulM
                                    mediamogul Global Moderator @Chillimonster
                                    last edited by mediamogul

                                    @Chillimonster

                                    Someone else recently reported the same issue with the scrolling data. Is there anyway you can report back as to exactly what information is scrolling? Does it make mention of an axis repeatedly by chance?

                                    RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                    C 1 Reply Last reply Reply Quote 0
                                    • E
                                      EVEGames @mediamogul
                                      last edited by EVEGames

                                      @mediamogul said in Guide: Advanced Controller Mappings:

                                      ...xboxdrv can also act as a mapping soltion for any controller that reports itself as a joystick event to the system, which also happens to apply to an XBox 360 controller. Using it in this way presents no kernel conflicts to my knowledge.

                                      That said, @mediamogul, if I follow your guide, am I operating the driver purely in 'mapping solution' mode by default? Also should I uninstall my Xpad driver before attempting your guide? Many thanks for the help.

                                      mediamogulM 1 Reply Last reply Reply Quote 0
                                      • C
                                        Chillimonster @mediamogul
                                        last edited by

                                        @mediamogul

                                        OK by following the guide and in particular post 126 on this thread i have mapped the dragonrise to use xboxdrv when booting daphne.

                                        Now the next issue.

                                        Daphne (The emulator i am having problems with) always looks for the first js0, and the mapped xboxdrv is js1

                                        is there a way to have this appear as js0 for this emulator?

                                        mediamogulM 1 Reply Last reply Reply Quote 0
                                        • mediamogulM
                                          mediamogul Global Moderator @EVEGames
                                          last edited by mediamogul

                                          @EVEGames

                                          if I follow your guide, am I operating the driver purely in 'mapping solution' mode by default?

                                          In a sense, it's all pretty much the same thing. Mapping the physical controller to the xboxdrv virtual controller that it creates is more or less what is being done in the automatic mode anyway, but in answer to your question, yes it would then solely be used in this second manner.

                                          Also should I uninstall my Xpad driver before attempting your guide?

                                          All of my mapping examples include the --detach-kernel-driver argument, which is supposed to detach the XPad driver on launch, allowing them both to coexist.

                                          From the xboxdrv man page

                                          -d, --detach-kernel-driver
                                          Detaches the kernel driver that is currently associated with the
                                          given device. This is useful when you have the xpad module
                                          loaded and want to use xboxdrv without unloading it.

                                          However, I'm unsure if the Xpad driver would be active again when xboxdrv exits. I'm afraid a little experimentation would be needed there.

                                          RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                          E 1 Reply Last reply Reply Quote 0
                                          • mediamogulM
                                            mediamogul Global Moderator @Chillimonster
                                            last edited by mediamogul

                                            @Chillimonster said in Guide: Advanced Controller Mappings:

                                            is there a way to have this appear as js0 for this emulator?

                                            There is, but Daphne actually looks for the first joystick event rather than a jsX assignment and the event order cannot be changed. If you are able to map the dragonrise encoder's joystick to keyboard input using the xboxdrv guide, then Daphne won't have to worry about finding it, as it will just think it's any other keyboard.

                                            Edit: Do you happen to know if the dragonrise has a mode to switch itself to keyboard input? If it did, then you should be able to map it that way instead.

                                            RetroPie v4.5 • RPi3 Model B • 5.1V 2.5A PSU • 16GB SanDisk microSD • 512GB External Drive

                                            C 2 Replies 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.