RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Xboxdrv returning back to normal settings when leaving Dosbox

    Scheduled Pinned Locked Moved General Discussion and Gaming
    xboxdrvdosboxfallout8bitdo
    8 Posts 2 Posters 585 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.
    • retropieuser555R
      retropieuser555
      last edited by

      Hi all, so I've managed to get xboxdrv up and working so my 8bitdo controller acts as a mouse for Fallout. All good so far and the game plays like a dream which is great.

      But for some reason I can't seem to get the controller to function again once I'm back in emulationstation. I was looking through some old topics and my understanding is you need to killall like I've done below, but I guess this is turning off all functions? How do I write this so when I come back to emulationstation the control function for there kicks back in?

      #!/bin/bash
      sudo killall > /dev/null 2>&1 xboxdrv
      sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
      	--detach-kernel-driver \
              --mouse \
      &
      sudo /opt/retropie/emulators/dosbox/bin/dosbox -c "mount c /home/pi/RetroPie/roms/pc" -c "c:" -c "cd fallout1" -c "FALLOUT.EXE" -c "exit"
      sudo killall > /dev/null xboxdrv

      Pi 5 4GB

      Retroflag GPI with raspberry pi zero 2 w/ wifi

      Retroachievements:- lovelessrapture

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

        The script you posted should stop the xboxdrv from after returning from dosbox. But you don't want to run dosbox through sudo, so remove that (3rd command).

        retropieuser555R 1 Reply Last reply Reply Quote 1
        • retropieuser555R
          retropieuser555 @mitu
          last edited by

          @mitu Thanks for the reply. I've adjusted the code now and removed the that 3rd sudo, but it's still not responsive upon return to emulationstation.

          If I put the controller back into a different mode & then back into the xbox 360 mode, it runs again, but that's as I've kicked xboxdrv off and the controller is back to being Xbox 360 Wireless Receiver (XBOX) as opposed to Xbox Gamepad (userspace driver).

          As I think xboxdrv kicks off at the boot, right? But oddly it's like the script won't run again once you've killed it.

          #!/bin/bash
          sudo killall > /dev/null 2>&1 xboxdrv
          sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
          	--detach-kernel-driver \
                  --mouse \
          &
          /opt/retropie/emulators/dosbox/bin/dosbox -c "mount c /home/pi/RetroPie/roms/pc" -c "c:" -c "cd fallout1" -c "FALLOUT.EXE" -c "exit"
          sudo killall > /dev/null xboxdrv
          

          Pi 5 4GB

          Retroflag GPI with raspberry pi zero 2 w/ wifi

          Retroachievements:- lovelessrapture

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

            Try executing the xboxdrv commands manually, from an SSH session, before and after starting the game. Leave the script to contain the dosbox command only and execute

            # before starting a game
            sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --detach-kernel-driver --mouse 
            
            # start the game from EmulationStation, see if the driver works
            
            # stop the driver
            sudo killall xboxdrv
            

            This way you'll see if any errors show up, maybe the way you start xboxdrv is not correct.

            retropieuser555R 1 Reply Last reply Reply Quote 1
            • retropieuser555R
              retropieuser555 @mitu
              last edited by

              @mitu said in Xboxdrv returning back to normal settings when leaving Dosbox:

              SSH

              Hiya, so the first line is giving me an error at the end but I'm not sure what that means exactly?

              pi@retropie:~ $ sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \
              > --detach-kernel-driver \
              >         --mouse \
              > 
              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. 
              
              Controller:        Microsoft X-Box 360 pad
              Vendor/Product:    045e:028e
              USB Path:          001:007
              Controller Type:   Xbox360
              
              -- [ ERROR ] ------------------------------------------------------
               Error couldn't claim the USB interface: LIBUSB_ERROR_NOT_FOUND
              Try to run 'rmmod xpad' and then xboxdrv again or start xboxdrv with the option --detach-kernel-driver.
              

              I don't have xpad installed on my pi, do I need to install that as well?

              Pi 5 4GB

              Retroflag GPI with raspberry pi zero 2 w/ wifi

              Retroachievements:- lovelessrapture

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

                @retropieuser555 said in Xboxdrv returning back to normal settings when leaving Dosbox:

                Error couldn't claim the USB interface: LIBUSB_ERROR_NOT_FOUND

                This means another driver is managing the device and you need to unload the driver or - as the message suggests - add another option to the command --detach-kernel-driver.

                retropieuser555R 1 Reply Last reply Reply Quote 0
                • retropieuser555R
                  retropieuser555 @mitu
                  last edited by

                  @mitu But haven't I already got that command in the code above at the beginning? After the path to xboxdrv?

                  Pi 5 4GB

                  Retroflag GPI with raspberry pi zero 2 w/ wifi

                  Retroachievements:- lovelessrapture

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

                    This post is deleted!
                    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.