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 463.4k 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.
    • mediamogulM
      mediamogul Global Moderator @Mayki
      last edited by

      @Mayki

      Very glad to hear it. Everything looks to be in order from here. If anything else comes up, I'll be around.

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

      1 Reply Last reply Reply Quote 0
      • M
        Mayki
        last edited by

        Write to rc.local:

        #!/bin/sh -e
        #
        # rc.local
        #
        # This script is executed at the end of each multiuser runlevel.
        # Make sure that the script will "exit 0" on success or any other
        # value on error.
        #
        # In order to enable or disable this script just change the execution
        # bits.
        #
        # By default this script does nothing.
        
        # Print the IP address
        _IP=$(hostname -I) || true
        if [ "$_IP" ]; then
          printf "My IP address is %s\n" "$_IP"
        fi
        sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
        	--evdev /dev/input/event2 \
        	--silent \
        	--detach-kernel-driver \
        	--force-feedback \
        	--deadzone-trigger 15% \
        	--deadzone 4000 \
        	--mimic-xpad \
        	--dpad-as-button \
        	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \
        	--evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \
        	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \
        	&
        exit 0
        

        Restart, when writing this:

        cat /proc/bus/input/devices
        
        pi@retropie:~ $ cat /proc/bus/input/devices
        I: Bus=0003 Vendor=046d Product=c52b Version=0111
        N: Name="Logitech USB Receiver"
        P: Phys=usb-3f980000.usb-1.4/input0
        S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C52B.0001/input/input0
        U: Uniq=
        H: Handlers=sysrq kbd leds event0
        B: PROP=0
        B: EV=120013
        B: KEY=10000 7 ff800000 7ff febeffdf ffefffff ffffffff fffffffe
        B: MSC=10
        B: LED=1f
        
        I: Bus=0003 Vendor=046d Product=c52b Version=0111
        N: Name="Logitech USB Receiver"
        P: Phys=usb-3f980000.usb-1.4/input1
        S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C52B.0002/input/input1
        U: Uniq=
        H: Handlers=kbd mouse0 event1
        B: PROP=0
        B: EV=1f
        B: KEY=3007f 0 0 0 0 83ffff 17aff32d bf544446 0 0 ffff0001 130f97 8b17c000 6773fa d941dfed 9ed680 4400 0 10000002
        B: REL=1c3
        B: ABS=1 0
        B: MSC=10
        
        I: Bus=0006 Vendor=054c Product=0268 Version=0100
        N: Name="PLAYSTATION(R)3 Controller"
        P: Phys=
        S: Sysfs=/devices/virtual/input/input2
        U: Uniq=
        H: Handlers=event2 js0
        B: PROP=0
        B: EV=20000b
        B: KEY=1ffff 0 0 0 0 0 0 0 0 0
        B: ABS=7f fc00ffff
        B: FF=7030000 0 0
        

        Not X-Box 360 gamepad, why?

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

          @Mayki

          So it's working when you enter it into the command line directly, but not from /etc/rc.local? Go ahead and post the entire contents of your /etc/rc.local so we can take a look at it.

          EDIT: Nevermind, I see it above.

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

          mediamogulM 1 Reply Last reply Reply Quote 0
          • M
            Mayki
            last edited by

            /etc/rc.local :

            #!/bin/sh -e
            #
            # rc.local
            #
            # This script is executed at the end of each multiuser runlevel.
            # Make sure that the script will "exit 0" on success or any other
            # value on error.
            #
            # In order to enable or disable this script just change the execution
            # bits.
            #
            # By default this script does nothing.
            
            # Print the IP address
            _IP=$(hostname -I) || true
            if [ "$_IP" ]; then
              printf "My IP address is %s\n" "$_IP"
            fi
            sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
            	--evdev /dev/input/event2 \
            	--silent \
            	--detach-kernel-driver \
            	--force-feedback \
            	--deadzone-trigger 15% \
            	--deadzone 4000 \
            	--mimic-xpad \
            	--dpad-as-button \
            	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \
            	--evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \
            	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \
            	&
            exit 0
            
            1 Reply Last reply Reply Quote 0
            • mediamogulM
              mediamogul Global Moderator @mediamogul
              last edited by

              @mediamogul

              Try pasting the command above the line # Print the IP address.

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

              1 Reply Last reply Reply Quote 0
              • M
                Mayki
                last edited by

                No change. No Xbox gamepad.

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

                  @Mayki

                  There's a conflict with the other command in the file that's printing the IP address. I'm not sure how to make them coexist, but the xboxdrv command itself should run without the other.

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

                  1 Reply Last reply Reply Quote 0
                  • M
                    Mayki
                    last edited by Mayki

                    Delete the command in the file that's printing the IP address to rc.local, restart.

                    pi@retropie:~ $ cat /proc/bus/input/devices
                    I: Bus=0003 Vendor=046d Product=c52b Version=0111
                    N: Name="Logitech USB Receiver"
                    P: Phys=usb-3f980000.usb-1.4/input0
                    S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C52B.0001/input/input0
                    U: Uniq=
                    H: Handlers=sysrq kbd leds event0
                    B: PROP=0
                    B: EV=120013
                    B: KEY=10000 7 ff800000 7ff febeffdf ffefffff ffffffff fffffffe
                    B: MSC=10
                    B: LED=1f
                    
                    I: Bus=0003 Vendor=046d Product=c52b Version=0111
                    N: Name="Logitech USB Receiver"
                    P: Phys=usb-3f980000.usb-1.4/input1
                    S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:046D:C52B.0002/input/input1
                    U: Uniq=
                    H: Handlers=kbd mouse0 event1
                    B: PROP=0
                    B: EV=1f
                    B: KEY=3007f 0 0 0 0 83ffff 17aff32d bf544446 0 0 ffff0001 130f97 8b17c000 6773fa d941dfed 9ed680 4400 0 10000002
                    B: REL=1c3
                    B: ABS=1 0
                    B: MSC=10
                    
                    I: Bus=0006 Vendor=054c Product=0268 Version=0100
                    N: Name="PLAYSTATION(R)3 Controller"
                    P: Phys=
                    S: Sysfs=/devices/virtual/input/input2
                    U: Uniq=
                    H: Handlers=js0 event2
                    B: PROP=0
                    B: EV=20000b
                    B: KEY=1ffff 0 0 0 0 0 0 0 0 0
                    B: ABS=7f fc00ffff
                    B: FF=7030000 0 0
                    

                    Still no Xbox gamepad.

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

                      @Mayki

                      Go ahead and past the contents of the newly modified rc.local.

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

                      1 Reply Last reply Reply Quote 0
                      • M
                        Mayki
                        last edited by

                        /etc/rc.local now :

                        #!/bin/sh -e
                        #
                        # rc.local
                        #
                        # This script is executed at the end of each multiuser runlevel.
                        # Make sure that the script will "exit 0" on success or any other
                        # value on error.
                        #
                        # In order to enable or disable this script just change the execution
                        # bits.
                        #
                        # By default this script does nothing.
                        sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                        	--evdev /dev/input/event2 \
                        	--silent \
                        	--detach-kernel-driver \
                        	--force-feedback \
                        	--deadzone-trigger 15% \
                        	--deadzone 4000 \
                        	--mimic-xpad \
                        	--dpad-as-button \
                        	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \
                        	--evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \
                        	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 \
                        	&
                        exit 0
                        
                        mediamogulM 1 Reply Last reply Reply Quote 0
                        • mediamogulM
                          mediamogul Global Moderator @Mayki
                          last edited by

                          @Mayki

                          At this point, I'm starting to suspect poltergeists ;). Let's try reformatting the command to:

                          sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event2 --silent --detach-kernel-driver --force-feedback --deadzone-trigger 15% --deadzone 4000 --mimic-xpad --dpad-as-button --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt --evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl --calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767 &
                          

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

                          1 Reply Last reply Reply Quote 0
                          • M
                            Mayki
                            last edited by Mayki

                            Such an idea.
                            If Sony gamepad connected via bluetooth and I enter the SSH command:

                            sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                            	--evdev /dev/input/event2 \
                            	--silent \
                            	--detach-kernel-driver \
                            	--force-feedback \
                            	--deadzone-trigger 15% \
                            	--deadzone 4000 \
                            	--mimic-xpad \
                            	--dpad-as-button \
                            	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \
                            	--evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \
                            	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767
                            

                            output is this:

                            Your Xbox/Xbox360 controller should now be available as:
                              /dev/input/js1
                              /dev/input/event3
                            
                            Press Ctrl-C to quit
                            

                            Unless Sony gamepad connected via bluetooth and I enter the SSH command output is this:

                            pi@retropie:~ $ sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                            > --evdev /dev/input/event2 \
                            > --silent \
                            > --detach-kernel-driver \
                            > --force-feedback \
                            > --deadzone-trigger 15% \
                            > --deadzone 4000 \
                            > --mimic-xpad \
                            > --dpad-as-button \
                            > --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \
                            > --evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \
                            > --calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767
                            xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/
                            Copyright © 2008-2011 Ingo Ruhnke <grumbel@gmail.com>
                            Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
                            This program comes with ABSOLUTELY NO WARRANTY.
                            This is free software, and you are welcome to redistribute it under certain
                            conditions; see the file COPYING for details.
                            
                            
                            -- [ ERROR ] ------------------------------------------------------
                            /dev/input/event2: No such file or directory
                            

                            The rc.local It starts with the system, gamepad is not yet connected.
                            May not be gamepad startup already connected via cable necessary?

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

                              @Mayki

                              Ah... nice! OK, There's a command to force Bluetooth to load and pair known devices that can be added before the xboxdrv command. From memory I believe it's called 'modprobe' or something like that. I'll be more than happy to help you out with it, but to be honest, I'm starting to fade and should get some sleep. I'll look into it further after a few ZZZs, but feel free to read ahead. I'm curious about this myself and I remember thinking that this could potentially be a problem with Bluetooth as the system starts.

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

                              1 Reply Last reply Reply Quote 0
                              • M
                                Mayki
                                last edited by

                                It's as if Sony gamepad connected via a cable already at system startup, log on as an X-Box gamepad.

                                I: Bus=0003 Vendor=045e Product=028e Version=0110
                                N: Name="Microsoft X-Box 360 pad"
                                P: Phys=
                                S: Sysfs=/devices/virtual/input/input3
                                U: Uniq=
                                H: Handlers=js1 event3
                                B: PROP=0
                                B: EV=20000b
                                B: KEY=7cdb03c0 0 0 0 0 0 0 0 0 0
                                B: ABS=3f
                                B: FF=1 3f870000 0 0
                                

                                XBOX

                                If Sony gamepad connects to the system startup via Bluetooth, so the X-Box driver not lead.

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

                                  @Mayki

                                  With any luck, forcing Bluetooth to load and pair known devices at startup should correct the problem. The fact that it connects via USB at startup is a good sign.

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

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    Mayki
                                    last edited by

                                    O.K. Thank you so much for your help in solving the problem.

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

                                      @Mayki

                                      Not a problem. I get the benefit of learning from this too. Try adding rfcomm bind 0 XX:XX:XX:XX:XX:XX 1 in a line just before the xboxdrv command in rc.local, substituting your controller's Blutooth address for "XX:XX:XX:XX:XX:XX" of course.

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

                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        Mayki
                                        last edited by Mayki

                                        This is probably not the right way, it wanted the script to be run after connecting the PS3 gamepad via bluetooth. They must be written in rc.local?
                                        Gamepad itself does not connect If you press the PS button.

                                        Idea:

                                        • 1 - Start Retropie

                                        • 2 - Press PS button on gamepad (gamepad connected as PS3)

                                        • 3 - Run script (with similar content) :

                                        sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
                                        	--evdev /dev/input/event2 \
                                        	--silent \
                                        	--detach-kernel-driver \
                                        	--force-feedback \
                                        	--deadzone-trigger 15% \
                                        	--deadzone 4000 \
                                        	--mimic-xpad \
                                        	--dpad-as-button \
                                        	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_#48=lt,ABS_#49=rt \
                                        	--evdev-keymap KEY_#302=a,KEY_#301=b,BTN_DEAD=x,KEY_#300=y,BTN_THUMB=tl,BTN_THUMB2=tr,BTN_BASE5=lb,BTN_BASE6=rb,BTN_TRIGGER=back,KEY_#720=guide,BTN_TOP=start,BTN_TOP2=du,BTN_PINKIE=dr,BTN_BASE=dd,BTN_BASE2=dl \
                                        	--calibration x1=-32767:0:32767,y1=-32767:0:32767,x2=-32767:0:32767,y2=-32767:0:32767
                                        
                                        • 4 - PS3 gamepad via bluetooth logs on as MICROSOFT X-BOX 360 PAD

                                        Is it real?

                                        mediamogulM 1 Reply Last reply Reply Quote 0
                                        • RionR
                                          Rion
                                          last edited by

                                          @BuZz Having this kind of functionality build in to the Retropie setup would be very useful.

                                          FBNeo rom filtering
                                          Mame2003 Arcade Bezels
                                          Fba Arcade Bezels
                                          Fba NeoGeo Bezels

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

                                            @Mayki

                                            Your idea should work. Give it a try and see how it goes.

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

                                            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.