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

    Scummvm controller help

    Scheduled Pinned Locked Moved Help and Support
    scummvmcontroller help
    76 Posts 8 Posters 13.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 @bassman6805
      last edited by

      @bassman6805

      yes if you put this in the ssh it will come up with something

      then
      sudo killall > /dev/null 2>&1 xboxdrv
      sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv    \
      --evdev /dev/input/event0 \
      --silent \
      --detach-kernel-driver \
      --force-feedback \
      --deadzone-trigger 15% \
      --deadzone 4000 \
      --mimic-xpad \
      --evdev-keymap KEY_#44=a,KEY_#45=b,KEY_#31=x,KEY_#30=y,KEY_#16=lb,KEY_#17=rb,KEY_#1=back,KEY_#28=start,KEY_#108=du,KEY_#106=dr,KEY_#103=dd,KEY_#105=dl \
      --ui-buttonmap b=BTN_LEFT,a=BTN_RIGHT,start=KEY_F5,dr=REL_X:25,dl=REL_X:-25,dd=REL_Y:25,du=REL_Y:-25 \
      --ui-buttonmap guide=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \
      
      &
      
      

      if all works then this will come up as soon as you hit enter

      
      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.
      
      
      Your Xbox/Xbox360 controller should now be available as:
        /dev/input/js1
        /dev/input/event2
      
      Press Ctrl-C to quit
      

      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 .

      1 Reply Last reply Reply Quote 0
      • B
        bassman6805
        last edited by bassman6805

        Here are the results.

        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.
        
        
        Your Xbox/Xbox360 controller should now be available as:
          /dev/input/js0
          /dev/input/event1
        
        Press Ctrl-C to quit
        
        
        After that I was able to get the directional stick to work and the buttons.  Once I restarted the unit it stopped working again.  I'm guessing something from the code needs to be added or changed.  Thanks for taking the time to help.  Looks like we or more you might be close to fixing the issue.
        ExarKunIvE 1 Reply Last reply Reply Quote 0
        • ExarKunIvE
          ExarKunIv @bassman6805
          last edited by

          @bassman6805

          that is great, so the hard part is done and over with. now we just need to get it to start when you start scummvm

          so now you need to have it look like this in your runcommand-onstart.sh

          #!/bin/sh
          
          if [ "$1" = "scummvm" ]
          then
          sudo killall > /dev/null 2>&1 xboxdrv
          sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
              --evdev /dev/input/event2 \
          	--silent \
          	--detach-kernel-driver \
          	--force-feedback \
          	--mimic-xpad \
          	--dpad-as-button \
                  --deadzone 15% \
          	--trigger-as-button \
          

          of course change what needs to be changed, but the top few lines are needed to have the mapping auto start.

          post what you have in your runcommand-onstart.sh and i will take a look if it still not starting

          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 .

          1 Reply Last reply Reply Quote 0
          • B
            bassman6805
            last edited by

            Still no luck. Here is what I have.

            if [ "$1" = "scummvm" ]
            then
            sudo killall > /dev/null 2>&1 xboxdrv
            sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1   \
            --evdev /dev/input/event2 \
            --silent \
            --detach-kernel-driver \
            --force-feedback \
            --deadzone-trigger 15% \
            --deadzone 4000 \
            --mimic-xpad \
            --evdev-keymap KEY_#44=a,KEY_#45=b,KEY_#31=x,KEY_#30=y,KEY_#16=lb,KEY_#17=rb,KEY_#1=back,KEY_#28=start,KEY_#108=du,KEY_#106=dr,KEY_#103=dd,KEY_#105=dl \
            --ui-buttonmap b=BTN_LEFT,a=BTN_RIGHT,start=KEY_F5,dr=REL_X:25,dl=REL_X:-25,dd=REL_Y:25,du=REL_Y:-25 \
            --ui-buttonmap guide=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \
            
            
            &
            fi
            ExarKunIvE 1 Reply Last reply Reply Quote 0
            • ExarKunIvE
              ExarKunIv @bassman6805
              last edited by ExarKunIv

              @bassman6805

              is that all that you have in the run command? if you are missing a few things

              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 .

              1 Reply Last reply Reply Quote 0
              • B
                bassman6805
                last edited by

                Yes. I just copied from guide and changed the button numbers.

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

                  @bassman6805
                  ok that is why it is not working. there are commands that are needed before the keymapping

                  here is the complete runcommand-onstart.sh ( of course you just replace the mapping here with the one that we got working for you)

                  #!/bin/sh
                  
                  ## 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
                  
                  if [ "$1" = "videopac" ]
                  then
                  sudo killall > /dev/null 2>&1 xboxdrv
                  sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
                      --evdev /dev/input/event3 \
                      --silent \
                  	--detach-kernel-driver \
                  	--force-feedback \
                  	--mimic-xpad \
                          --deadzone 15% \
                  	--evdev-no-grab \
                  	--dpad-as-button \
                  	--trigger-as-button \
                  	--evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_Z=x2,ABS_RZ=y2,ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \
                  	--evdev-keymap KEY_#304=a,KEY_#305=b,KEY_#307=x,KEY_#308=y,KEY_#312=lt,KEY_#313=rt,KEY_#310=lb,KEY_#311=rb,KEY_#317=tl,KEY_#318=tr,KEY_#314=back,KEY_#315=start \
                  	--axismap -Y1=Y1,-Y2=Y2 \
                          --ui-buttonmap a=KEY_UNKNOWN,b=KEY_UNKNOWN,start=KEY_UNKNOWN,back=KEY_UNKNOWN,x=KEY_UNKNOWN,y=KEY_UNKNOWN,lt=KEY_UNKNOWN,rt=KEY_UNKNOWN,lb=KEY_UNKNOWN,rb=KEY_UNKNOWN,tl=KEY_UNKNOWN,tr=KEY_UNKNOWN \
                  	--ui-axismap x2=KEY_#2:KEY_2,Y2=KEY_3:KEY_4 \
                  &
                  fi
                  
                  

                  and the runcommand-onend.sh

                  #!/bin/sh
                  
                  sudo killall >/dev/null xboxdrv 
                  
                  sudo pkill -CONT python
                  

                  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 .

                  1 Reply Last reply Reply Quote 0
                  • B
                    bassman6805
                    last edited by

                    I'm really confused now with the runcommand-onend.sh. Here is what I have for the 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
                    
                    if [ "$1" = "scummvm" ]
                    then
                    sudo killall > /dev/null 2>&1 xboxdrv
                    sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1   \
                    --evdev /dev/input/event2 \
                    --silent \
                    --detach-kernel-driver \
                    --force-feedback \
                    --deadzone-trigger 15% \
                    --deadzone 4000 \
                    --mimic-xpad \
                    --evdev-keymap KEY_#44=a,KEY_#45=b,KEY_#31=x,KEY_#30=y,KEY_#16=lb,KEY_#17=rb,KEY_#1=back,KEY_#28=start,KEY_#108=du,KEY_#106=dr,KEY_#103=dd,KEY_#105=dl \
                    --ui-buttonmap b=BTN_LEFT,a=BTN_RIGHT,start=KEY_F5,dr=REL_X:25,dl=REL_X:-25,dd=REL_Y:25,du=REL_Y:-25 \
                    --ui-buttonmap guide=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \
                    
                    
                    &
                    fi
                    1 Reply Last reply Reply Quote 0
                    • B
                      bassman6805
                      last edited by bassman6805

                      Here is the onend.sh

                      
                      sudo killall >/dev/null xboxdrv
                      
                      sudo pkill -CONT python
                      
                      sudo killall > /dev/null 2>&1 xboxdrv
                      /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1 \
                        --evdev /dev/input/by-id/event2 \
                        --silent \
                        --detach-kernel-driver \
                        --force-feedback \
                        --deadzone-trigger 15% \
                        --deadzone 4000 \
                        --mimic-xpad \
                        --evdev-absmap ABS_[•]=x1,ABS_[•]=y1,ABS_[•]=x2,ABS_[•]=y2,ABS_[•]=lt,ABS_[•]=rt,ABS_[•]=dpad_x,ABS_[•]=dpad_y \
                        --evdev-keymap KEY_#44=a,KEY_#45=b,KEY_#31=x,KEY_#30=y,KEY_#16=lb,KEY_#17=rb,KEY_#1=back,KEY_#28=start,KEY_#108=du,KEY_#106=dr,KEY_#103=dd,KEY_#105=dl \
                        &
                      1 Reply Last reply Reply Quote 0
                      • ExarKunIvE
                        ExarKunIv
                        last edited by

                        @bassman6805

                        Yoy just need the first two lines for the on end

                        Just copy what I posted on my last post. That is all you need

                        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 .

                        1 Reply Last reply Reply Quote 0
                        • B
                          bassman6805
                          last edited by bassman6805

                          Still no luck. Here is my onstart setup.

                          ##!/bin/sh
                          
                          ## 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
                          
                          if [ "$1" = "scummvm" ]
                          then
                          sudo killall > /dev/null 2>&1 xboxdrv
                          sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1   \
                          --evdev /dev/input/event2 \
                          --silent \
                          --detach-kernel-driver \
                          --force-feedback \
                          --deadzone-trigger 15% \
                          --deadzone 4000 \
                          --mimic-xpad \
                          --evdev-keymap KEY_#44=a,KEY_#45=b,KEY_#31=x,KEY_#30=y,KEY_#16=lb,KEY_#17=rb,KEY_#1=back,KEY_#28=start,KEY_#108=du,KEY_#106=dr,KEY_#103=dd,KEY_#105=dl \
                          --ui-buttonmap b=BTN_LEFT,a=BTN_RIGHT,start=KEY_F5,dr=REL_X:25,dl=REL_X:-25,dd=REL_Y:25,du=REL_Y:-25 \
                          --ui-buttonmap guide=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \
                          
                          
                          &
                          fi
                          
                          
                          
                          

                          Here are my onend settings.

                          #!/bin/sh
                          
                          sudo killall >/dev/null xboxdrv
                          
                          sudo pkill -CONT python
                          
                          

                          I'm not sure why it's not working now.

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

                            @bassman6805

                            is your controller event 2 or 0 ?

                            your earier post when you ran cat /proc/bus/input/devicesit came up with event 0

                            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 .

                            1 Reply Last reply Reply Quote 0
                            • B
                              bassman6805
                              last edited by

                              It's probably event 0. I think I copied the text from one of the reply's and didn't change it. I thought it was supposed to be event 2. I will try it when I get home.

                              1 Reply Last reply Reply Quote 0
                              • B
                                bassman6805
                                last edited by

                                I changed it back to event0 but still not working. I have tried event0, event1, and event2. I'm so confused.

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

                                  @bassman6805
                                  that makes two of us.

                                  just one quick question where do you have the runcommand files placed in your pie?

                                  try this

                                  To fully round out this section on key-mapping, it should be mentioned that in some scenarios, the keyboard that xbmc virtualizes may not be recognized as being a keyboard by the software you intend to use it with. In this situation, you can create a udev rule that will authenticate the input as being from an actual keyboard at a system level, allowing it to function anywhere. To add this udev rule, drop to the command line and type:

                                  sudo nano /etc/udev/rules.d/99-xboxdrv.rules

                                  Press 'Enter" and type the following:

                                  SUBSYSTEM=="input", ATTRS{name}=="Microsoft X-Box 360 pad", GROUP="users", MODE="0666", ENV{ID_INPUT_KEYBOARD}="1"

                                  Now press 'ctrl+o' to save the file, 'Enter' to confirm and 'ctrl+x' to exit.
                                  if that dont work then we need to view the log file to see why

                                  you will have to use WinSCP to dive into your Pie and view the /dev.shm/runcommand.log there.

                                  other then that i done know. from my end you have everything set correctly

                                  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 .

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    bassman6805
                                    last edited by bassman6805

                                    The xboxdrv.rules was already present. The runcommand files are located in opt/retropie/config/all. Here is a pic of all the files in the folder.

                                    0_1510097299534_runcommand folders.JPG

                                    I can't find a runcommand.log file. I have searched the whole system. Where would I find the file?

                                    1 Reply Last reply Reply Quote 0
                                    • B
                                      bassman6805
                                      last edited by

                                      Here is a rundown of everything I have so far just to make sure something isn't messed up.

                                      cat /proc/bus/input/devices

                                      
                                       I: Bus=0003 Vendor=0001 Product=0001 Version=0001
                                      N: Name="retrogame"
                                      P: Phys=
                                      S: Sysfs=/devices/virtual/input/input0
                                      U: Uniq=
                                      H: Handlers=kbd event0
                                      B: PROP=0
                                      B: EV=3
                                      B: KEY=1680 0 3000 d0030002
                                      

                                      evtest /dev/input/event0

                                      Input driver version is 1.0.1
                                      Input device ID: bus 0x3 vendor 0x1 product 0x1 version 0x1
                                      Input device name: "retrogame"
                                      Supported events:
                                        Event type 0 (EV_SYN)
                                        Event type 1 (EV_KEY)
                                          Event code 1 (KEY_ESC)
                                          Event code 16 (KEY_Q)
                                          Event code 17 (KEY_W)
                                          Event code 28 (KEY_ENTER)
                                          Event code 30 (KEY_A)
                                          Event code 31 (KEY_S)
                                          Event code 44 (KEY_Z)
                                          Event code 45 (KEY_X)
                                          Event code 103 (KEY_UP)
                                          Event code 105 (KEY_LEFT)
                                          Event code 106 (KEY_RIGHT)
                                          Event code 108 (KEY_DOWN)
                                      Properties:
                                      Testing ... (interrupt to exit)
                                      

                                      nano /opt/retropie/configs/all/runcommand-onstart.sh

                                      ##!/bin/sh
                                      
                                      ## 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
                                      
                                      if [ "$1" = "scummvm" ]
                                      then
                                      sudo killall > /dev/null 2>&1 xboxdrv
                                      sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv > /dev/null 2>&1   \
                                      --evdev /dev/input/event0 \
                                      --silent \
                                      --detach-kernel-driver \
                                      --force-feedback \
                                      --deadzone-trigger 15% \
                                      --deadzone 4000 \
                                      --mimic-xpad \
                                      --evdev-keymap KEY_#44=a,KEY_#45=b,KEY_#31=x,KEY_#30=y,KEY_#16=lb,KEY_#17=rb,KEY_#1=back,KEY_#28=start,KEY_#108=du,KEY_#106=dr,KEY_#103=dd,KEY_#105=dl \
                                      --ui-buttonmap b=BTN_LEFT,a=BTN_RIGHT,start=KEY_F5,dr=REL_X:25,dl=REL_X:-25,dd=REL_Y:25,du=REL_Y:-25 \
                                      --ui-buttonmap guide=void,x=void,y=void,lb=void,rb=void,tl=void,tr=void,lt=void,rt=void,back=void \
                                      
                                      
                                      &
                                      fi
                                      

                                      nano /opt/retropie/configs/all/runcommand-onend.sh

                                      #!/bin/sh
                                      
                                      sudo killall >/dev/null xboxdrv
                                      
                                      sudo pkill -CONT python
                                      
                                      ExarKunIvE 1 Reply Last reply Reply Quote 0
                                      • ExarKunIvE
                                        ExarKunIv @bassman6805
                                        last edited by ExarKunIv

                                        @bassman6805

                                        everything else looks like it should

                                        did you run this ?

                                        chmod +x /opt/retropie/configs/all/runcommand-onstart.sh

                                        and

                                        chmod +x /opt/retropie/configs/all/runcommand-onend.sh

                                        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 .

                                        1 Reply Last reply Reply Quote 0
                                        • B
                                          bassman6805
                                          last edited by

                                          Yes, I ran those when I very first created the runonstart and runonend files. I did that following the guide. I am idiot when it comes to linux. The part that gets me is when I started scummvm and remoted into it and run the command you gave me it started working. If you can tell me how to find the log file I will post it.

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

                                            @bassman6805

                                            ok
                                            use WinSCP
                                            to find the log file you just need to open the DEV folder and in that open SHM folder

                                            in there will be the log file that you need.

                                            just make sure you start scummvm first. cuz without it running the folder will be empty.

                                            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 .

                                            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.