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

    xboxdrv not working through runcommand-onstart.sh but does from ssh

    Scheduled Pinned Locked Moved Help and Support
    runcommandxboxdrv
    7 Posts 2 Posters 553 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.
    • D
      dsstrainer
      last edited by dsstrainer

      Hi guys!

      I'm trying to follow the xboxdrv example on the wiki:
      https://github.com/RetroPie/RetroPie-Setup/wiki/Universal-Controller-Calibration-&-Mapping-Using-xboxdrv

      First problem is that the sample doesn't seem to work as-is.

      Simplifying one of the commands to just:

      basicPS3="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event3 --detach-kernel-driver --evdev-keymap BTN_BASE5=l2,BTN_BASE6=r2 --ui-buttonmap l2=KEY_RIGHTBRACE,r2=KEY_6"
      
      joycommand="$basicPS3 &"
      eval $joycommand
      

      Doesn't work. If you remove the ">/dev/null" redirect you see it seems the eval chokes on the arguments

      It does load fine if I don't use eval and just call it direct, but it doesn't respond to the button presses:

      #!/bin/bash
      sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event3 --detach-kernel-driver --evdev-keymap BTN_BASE5=l2,BTN_BASE6=r2 --ui-buttonmap l2=KEY_RIGHTBRACE,r2=KEY_6 &
      

      I'm using a remote putty ssh session to see if xboxdrv starts and it does, so I know it's running.

      However, If I don't run through the script, but instead manually run it from the remote ssh session, using the exact same command, everything works as expected. The buttons map correctly to keyboard commands.

      I'm currently testing with a stock 4.4 build on RPi3.
      Did some searching but didn't seem to find anyone else having an issue with this.

      Any ideas?

      RetroPie v4.2 • RPi3 Model B • 5.1V 2.5A PSU • 8GB SanDisk class 10 microSD • 16GB External USB Thumb Drive
      Roms, images and configs stored in USB and symlinked from normal microsd location
      Xarcade Keyboard encoder + Zero Delay Joystick encoder

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

        @dsstrainer said in xboxdrv not working through runcommand-onstart.sh but does from ssh:

        Any ideas?

        Don't use eval and just start the command directly ?

        1 Reply Last reply Reply Quote 0
        • D
          dsstrainer
          last edited by dsstrainer

          @mitu said in xboxdrv not working through runcommand-onstart.sh but does from ssh:

          @dsstrainer said in xboxdrv not working through runcommand-onstart.sh but does from ssh:

          Any ideas?

          Don't use eval and just start the command directly ?

          Yea I think you didn't read the rest of my post

          RetroPie v4.2 • RPi3 Model B • 5.1V 2.5A PSU • 8GB SanDisk class 10 microSD • 16GB External USB Thumb Drive
          Roms, images and configs stored in USB and symlinked from normal microsd location
          Xarcade Keyboard encoder + Zero Delay Joystick encoder

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

            @dsstrainer said in xboxdrv not working through runcommand-onstart.sh but does from ssh:

            Yea I think you didn't read the rest of my post

            Yes, you're right :). I need to get some coffee.

            1 Reply Last reply Reply Quote 0
            • D
              dsstrainer
              last edited by dsstrainer

              Still getting nowhere with this.

              I've got it down to this command:

              sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event3 --detach --evdev-keymap BTN_BASE5=l2,BTN_BASE6=r2 --ui-buttonmap l2=KEY_RIGHTBRACE,r2=KEY_6
              

              Works perfectly if i run it in a remote ssh session before starting the game. Here is what it looks like in ps -ef | grep xboxdrv

              root     12033 11480  0 01:52 pts/2    00:00:00 sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event3 --detach --evdev-keymap BTN_BASE5=l2,BTN_BASE6=r2 --ui-buttonmap l2=KEY_RIGHTBRACE,r2=KEY_6
              root     12037 12033  2 01:52 pts/2    00:00:00 /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event3 --detach --evdev-keymap BTN_BASE5=l2,BTN_BASE6=r2 --ui-buttonmap l2=KEY_RIGHTBRACE,r2=KEY_6
              

              But if I run the same command through runcommand-onstart.sh, It starts fine and the ps command shows the same results. I see it say "Xbox userspace driver loaded blah blah" in the yellow font at the bottom of the screen after startinge the rom. So I know its loading and it seems like it should work. But the buttons do not do what I expect. If i do evtest on the new userspace events, it shows the button is triggering correctly. It's just not doing what it should in the game.

              root     12196     1  0 01:53 tty1     00:00:00 sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event3 --detach --evdev-keymap BTN_BASE5=l2,BTN_BASE6=r2 --ui-buttonmap l2=KEY_RIGHTBRACE,r2=KEY_6
              root     12216 12196  1 01:53 tty1     00:00:00 /opt/retropie/supplementary/xboxdrv/bin/xboxdrv --evdev /dev/input/event3 --detach --evdev-keymap BTN_BASE5=l2,BTN_BASE6=r2 --ui-buttonmap l2=KEY_RIGHTBRACE,r2=KEY_6
              

              Any other ideas? Anyone have a successful xboxdrv start script of any kind?
              I am going to try loading it with autostart before emulationstation loads and see if it works that way.

              RetroPie v4.2 • RPi3 Model B • 5.1V 2.5A PSU • 8GB SanDisk class 10 microSD • 16GB External USB Thumb Drive
              Roms, images and configs stored in USB and symlinked from normal microsd location
              Xarcade Keyboard encoder + Zero Delay Joystick encoder

              1 Reply Last reply Reply Quote 0
              • D
                dsstrainer
                last edited by

                Also it does seem to start 2 copies of itself.. one with sudo, one without... but I don't think that matters as it happens in either case.

                RetroPie v4.2 • RPi3 Model B • 5.1V 2.5A PSU • 8GB SanDisk class 10 microSD • 16GB External USB Thumb Drive
                Roms, images and configs stored in USB and symlinked from normal microsd location
                Xarcade Keyboard encoder + Zero Delay Joystick encoder

                1 Reply Last reply Reply Quote 0
                • D
                  dsstrainer
                  last edited by

                  Starting to see a pattern actually that it only works if I run it from the remote ssh connection AFTER the game starts. Can't remember if that was always the case but perhaps I can add some delayed start to a script so that it runs in the bg after the rom loads.

                  RetroPie v4.2 • RPi3 Model B • 5.1V 2.5A PSU • 8GB SanDisk class 10 microSD • 16GB External USB Thumb Drive
                  Roms, images and configs stored in USB and symlinked from normal microsd location
                  Xarcade Keyboard encoder + Zero Delay Joystick encoder

                  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.