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

    Configuring xboxdrv with Xin-Mo 2 player controller

    Scheduled Pinned Locked Moved Help and Support
    xin mo dualarcade4way8wayxboxdrv
    10 Posts 3 Posters 817 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.
    • R
      rogerdodger
      last edited by

      Hi there,

      I've been following the excellent thread on the forum for using xboxdrv and am trying to adapt it for arcade games to run in 4 way or 8 way for specific games with a Xin-Mo 2 player usb controller.

      I've managed to get it to work with Player 1 but when I try it with both Player 1 and Player 2, the second player doesn't work. To try and figure out what's going on I've modified the script:

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

      so that it appends the output of each xboxdrv command (Player 1 and Player 2) to:

      /dev/shm/runcommand.log
      

      From doing this I've noticed that xboxdrv is assigning both player 1 and player 2 to the same event number:

      Your Xbox/Xbox360 controller should now be available as:
         /dev/input/js2
         /dev/input/event4
       
       Press Ctrl-C to quit, use '--silent' to suppress the event output
       
       Your Xbox/Xbox360 controller should now be available as:
         /dev/input/js2
         /dev/input/event4 
      

      The retropie setup has the following devices connected to it:

      • 2 Player Xin-Mo controller configured and working for 2 players
      • usb sound card
      • Bluetooth keyboard (only enabled when I'm going into the OS to edit config)

      I've noticed event numbers of devices occasionally change, or at least I think they do.

      The following is an extract of the xboxdrive commands (mapped to event1 and event2) which I'm running in the runcommand-onstart.sh script:

          Player1_4Way_Mame2003="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >> /dev/shm/runcommand.log \
          --detach-kernel-driver \
          --deadzone=4000 \
          --deadzone-trigger 15% \
          --force-feedback \
          --mimic-xpad \
          --trigger-as-button \
          --ui-buttonmap tl=void,tr=void,guide=void \
          --evdev /dev/input/event1 \
          --device-name "Player_1" \
          --evdev-absmap ABS_X=y1,ABS_Y=x1 \
          --four-way-restrictor \
          --evdev-keymap BTN_TRIGGER=a,BTN_THUMB=b,BTN_THUMB2=x,BTN_TOP=y,BTN_TOP2=lb,BTN_PINKIE=rb,BTN_BASE4=back,BTN_BASE3=start,BTN_BASE=lt,BTN_BASE2=rt \
          --ui-axismap X1=KEY_LEFT:KEY_RIGHT,Y1=KEY_UP:KEY_DOWN \
          --ui-buttonmap a=KEY_LEFTCTRL,b=KEY_LEFTALT,x=KEY_SPACE,y=KEY_LEFTSHIFT,lb=KEY_UNKNOWN,rb=KEY_UNKNOWN,back=KEY_UNKNOWN,start=KEY_UNKNOWN,back+lt=KEY_SPACE+KEY_ESC,lt=KEY_5+KEY_1,rt=KEY_6+KEY_2"
          
          Player2_4Way_Mame2003="sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >> /dev/shm/runcommand.log \
          --detach-kernel-driver \
          --deadzone=4000 \
          --deadzone-trigger 15% \
          --force-feedback \
          --mimic-xpad \
          --trigger-as-button \
          --ui-buttonmap lb=void,rb=void,tl=void,tr=void,guide=void,lt=void,rt=void \
          --evdev /dev/input/event2 \
          --device-name "Player_2" \
          --evdev-absmap ABS_X=y1,ABS_Y=x1 \
          --four-way-restrictor \
          --evdev-keymap BTN_TRIGGER=a,BTN_THUMB=b,BTN_THUMB2=x,BTN_TOP=y,BTN_TOP2=lb,BTN_PINKIE=rb,BTN_BASE4=back,BTN_BASE3=start,BTN_BASE=lt,BTN_BASE2=rt \
          --ui-axismap X1=KEY_D:KEY_G,Y1=KEY_R:KEY_F \
          --ui-buttonmap a=KEY_A,b=KEY_S,x=KEY_Q,y=KEY_W,back=KEY_6+KEY_2,start=KEY_UNKNOWN,back+start=KEY_SPACE+KEY_ESC"
      

      The following command is then used further down in the script when a predefined 4 way game is run:

      case $1 in
        arcade)
          if [[ " ${fourWayGames[@]} " =~ " $rom " ]]; then
              $xboxkill
              joycommand="$Player1_4Way_Mame2003 & $Player2_4Way_Mame2003 &"
      	eval $joycommand
          else
              $xboxkill
      	joycommand="$Player1_8Way_Mame2003 & $Player2_8Way_Mame2003 &"
      	eval $joycommand
          fi
        ;;  
      
        daphne)
              $xboxkill
              joycommand="$Player1_4Way_Mame2003 & $Player2_4Way_Mame2003 &"
      	eval $joycommand
        ;;
      esac
      

      Has anybody had any experience of setting up xboxdrv with a Xin-Mo controller and experienced similar hurdles?

      All advice gratefully appreciated.

      Cheers.

      HalvhjearneH 1 Reply Last reply Reply Quote 0
      • HalvhjearneH
        Halvhjearne @rogerdodger
        last edited by

        @rogerdodger

        tbh i really dont understand what you are trying to achive or why you would want to use the xboxdrv with a joystick that acts as a wired ps3 controller, which should be plenty supported.

        i have a xin-mo aswell and i really have not had any problems with it yet ...
        make sure it is set to use pov as directions and not the "analog emulation" tho.

        have you done the steps to setup the xin-mo, so that its is recognized as 2 separate controllers and not just one single controller?

        and what kind of joysticks are you using?

        1 Reply Last reply Reply Quote 0
        • R
          rogerdodger
          last edited by

          Hi @Halvhjearne,

          To provide a bit more context I'm using 2 8 way Zippy arcade sticks

          I'm using xboxdrv as I want to make use of its four way restrictor mode for mame titles originally designed for 4 way joysticks (i.e. Pacman, Donkey Kong etc).

          I've modified the /boot/config.txt file so that the Xin-Mo controller is identifier as 2 joysticks in Debian. I can confirm that this works as expected when running anything using the normal ps3 controller driver.

          HalvhjearneH 1 Reply Last reply Reply Quote 0
          • HalvhjearneH
            Halvhjearne @rogerdodger
            last edited by

            @rogerdodger

            tbh i think it would be better to switch the restrictor plate between 4 and 8way on the joystick.

            personally i use the magstik, which i absolutely love (after replacing the microswitches).
            they have a switch that does not require a screw to be undone to switch between 4 and 8way.
            iirc, you can even get a small motor to switch when the game starts.

            1 Reply Last reply Reply Quote 0
            • R
              rogerdodger
              last edited by

              Switching a restrictor plate is not really an option as there is hardly any room to access it in my bartop cab.

              For this reason I'm looking for a software solution.

              HalvhjearneH 1 Reply Last reply Reply Quote 0
              • HalvhjearneH
                Halvhjearne @rogerdodger
                last edited by Halvhjearne

                @rogerdodger

                iirc, there is an option in retroarch somewhere for this aswell, but i doubt it will work well, considdering it is physically possible to activate 2 microswitches at once on the joystick.
                i dont see how will it would possibly know if you want down or left in the lower left corner.

                a hardware switch would always be the most optimal imho, as it will block the joystick and only allow one microswitch to activate at once.

                edit:
                some joysticks like the magstik plus can switch from 4 to 8way on the fly, by pulling up on the stick and twisting, but personally i dont like it as it seems like the little "ring" it grips into is made from a material that seems to wear out fairly quick (at least mine did and i barely dare to twist it any more).

                1 Reply Last reply Reply Quote 0
                • R
                  rogerdodger
                  last edited by

                  I've had a look at the option in RetroArch but figured it would be harder to automate for 200+ games.

                  Perhaps true 4 way controls can only be achieved mechanically, I have limited knowledge of Arcade stuff.

                  Somebody managed to get a Dragonrise controller with 2 joysticks working using xboxdrv so I assumed the same would be possible for a Xin-Mo controller.

                  Notably the individual isn't using the "--four-way-restrictor" xboxdrv option mentioned in the RetroPie Docs Universal Controller Calibration & Mapping Using xboxdrv article, I figured this was simply a config switch.

                  Perhaps somebody on the forum could confirm if 4 way emulation is possible with xboxdrv or if this is something that is only realistically possible with modern joypads.

                  I also take on board your suggestion xboxdrv might be a complete waste of time and that the only way to really approach this is to use a real 4 way stick or manually switching 8 way stick.

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

                    @rogerdodger said in Configuring xboxdrv with Xin-Mo 2 player controller:

                    Perhaps somebody on the forum could confirm if 4 way emulation is possible with xboxdrv or if this is something that is only realistically possible with modern joypads.

                    I believe the four-way restriction feature in xboxdrv is only designed to work with analog sticks. I had tried using it in the past on a micro-switch setup and it seemed to work. However, this was on a machine I didn't play very much and it could be that since the mapping didn't fail, I just assumed all part were working. As @Halvhjearne noted above, on its face, it would seem impossible for the software to be aware of the intended directional input.

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

                    1 Reply Last reply Reply Quote 0
                    • R
                      rogerdodger
                      last edited by

                      Fair enough, I'll go back to using the standard settings.

                      Many thanks for the help both of you have provided.

                      1 Reply Last reply Reply Quote 1
                      • HalvhjearneH
                        Halvhjearne
                        last edited by

                        @rogerdodger said in Configuring xboxdrv with Xin-Mo 2 player controller:

                        Perhaps true 4 way controls can only be achieved mechanically, I have limited knowledge of Arcade stuff.

                        i belive this is the only way ...

                        as i suggested earlier, it is possible to physically switch from 4 to 8way by loosen the screw on the bottum, but if you want something that can switch automaticly i would suggest something like the ultimarc servostik perhaps, alltho those are quite a lot more expensive than the zippy joysticks (especially if you want 2).

                        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.