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

    Using xboxdrv with mame4all/advmame

    Scheduled Pinned Locked Moved Help and Support
    xboxdrvdevicemame4alladvmame
    49 Posts 4 Posters 5.9k 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.
    • S
      spud11 @Lummox JR
      last edited by

      @lummox-jr --detatch-kernel-driver \ should be --detach-kernel-driver \. Change that and test, I think.

      RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

      L 1 Reply Last reply Reply Quote 0
      • L
        Lummox JR @spud11
        last edited by Lummox JR

        @spud11 That's just a typo I made while making the post. I typed it in on my computer while looking at my TV screen.

        The xboxdrv command is running successfully, so I know there's nothing syntactically wrong with the options. I think the problem is something in mame4all/advmame's configuration.

        1 Reply Last reply Reply Quote 0
        • L
          Lummox JR
          last edited by

          Another part of this, I think, is that I need to drop the dead zone to something way lower. I know xboxdrv will help with that, once I can figure out how to get the driver talking to advmame.

          BTW, I looked at the advmame.rc file, and this is what I have for the devices:

          device_joystick auto
          device_keyboard raw
          device_mouse auto
          

          With that setting I find it odd that xboxdrv's mouse mapping isn't being noticed. But I'm still convinced the problem is those two emulators.

          I should also note that I've got xboxdrv working for the Atari 800 emulator so I know this isn't simply a problem with xboxdrv or runcommand itself. It's these specific emulators that aren't seeing the xboxdrv-created device.

          S mediamogulM 2 Replies Last reply Reply Quote 0
          • S
            spud11 @Lummox JR
            last edited by

            @lummox-jr What does the /dev/shm/runcommand.log show after using either mame4all or Advance Mame?

            RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

            L 1 Reply Last reply Reply Quote 0
            • L
              Lummox JR @spud11
              last edited by

              @spud11 This is the contents of the file:

              xboxdrv: no process found
              

              That's from the killall command. Next is the sudo xboxdrv command above (not bothering to retype that here, although I did change from >/dev/null to >>/dev/shm/runcommand.log), then:

              xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/
              Copyright C 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/event3
              
              Press Ctrl+C to quit
              Parameters:
              Executing: /opt/retropie/emulators/advmame/bin/advmame "starwars"
              Shutdown complete
              

              So as you see there's absolutely zero information about why advmame can't see the gamepad or the keyboard/mouse events it fires.

              1 Reply Last reply Reply Quote 0
              • L
                Lummox JR @mediamogul
                last edited by

                @mediamogul Any new thoughts?

                mediamogulM S 2 Replies Last reply Reply Quote 0
                • mediamogulM
                  mediamogul Global Moderator @Lummox JR
                  last edited by

                  @lummox-jr

                  I've been away from my setup since Saturday night and I need to look at a few of my maps to compare them. I'll be sure to touch base sometime tomorrow.

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

                  1 Reply Last reply Reply Quote 0
                  • S
                    spud11 @Lummox JR
                    last edited by

                    @lummox-jr Are you able to copy and paste rather than type everything from scratch? It's just a little bit harder to troubleshoot as I'm not sure whether it is a typo or whether it's actually a mistake in your runcommand-onstart.
                    Anyway:

                    --ui-axismap x1=REL_X:10,y1=REL_Y10
                    

                    I think it should read:

                    --ui-axismap X1=REL_X:10,Y1=REL_Y:10 \
                    

                    The X1 and Y1 should be capitalised.

                    RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

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

                      @lummox-jr said in Using xboxdrv with mame4all:

                      I find it odd that xboxdrv's mouse mapping isn't being noticed.

                      While I don't have any experience with mame4all, I know that AdvanceMAME tries to automatically arrange the mouse index and many times sets the wrong one when you have multiple mice. Setting the mouse index manually doesn't work either because the index set by the system often varies as well. I handle this by assigning mouse0, mouse1 and mouse2 indexes to the various arcade options manually in advancemame.rc, which looks like:

                      input_map[p1_dialx] mouse[0,x] mouse[1,x] mouse[2,x]
                      input_map[p1_dialy] mouse[0,y] mouse[1,y] mouse[2,y]
                      input_map[p1_paddlex] mouse[0,x] mouse[1,x] mouse[2,x]
                      input_map[p1_paddley] mouse[0,y] mouse[1,y] mouse[2,y]
                      input_map[p1_pedalgas] mouse[0,y] mouse[1,y] mouse[2,y]
                      input_map[p1_stickx] mouse[0,x] mouse[1,x] mouse[2,x]
                      input_map[p1_sticky] mouse[0,y] mouse[1,y] mouse[2,y]
                      input_map[p1_trackballx] mouse[0,x] mouse[1,x] mouse[2,x]
                      input_map[p1_trackbally] mouse[0,y] mouse[1,y] mouse[2,y]
                      

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

                      L S 2 Replies Last reply Reply Quote 0
                      • L
                        Lummox JR @mediamogul
                        last edited by

                        @mediamogul I could give the mouse thing a try. I'll do so later and post an update let you know. (Usually I do not have a mouse plugged in, since I haven't needed it since the initial setup.) However since the xboxdrv keyboard output also isn't seen, I think there's probably more to the problem than that. Mapping select/back to a key like 5 so it can trigger the coin slot does not work any more than the mouse stuff has.

                        @spud11 Sadly copying and pasting is not an option. Because of the way my network is configured I can't use SCP/SFTP to reach the Pi from my Windows desktop. However I'm absolutely positive that there is no need to capitalize x1 or y1 in the --ui-axismap option; I got that part of the command directly from mediamogul's configuration guide, where x1 and y1 are lowercase.

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

                          @lummox-jr said in Using xboxdrv with mame4all:

                          However since the xboxdrv keyboard output also isn't seen, I think there's probably more to the problem than that.

                          While you're setting the mice options, try also setting:

                          device_keyboard raw
                          

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

                          L 1 Reply Last reply Reply Quote 0
                          • L
                            Lummox JR @mediamogul
                            last edited by

                            @mediamogul I made the suggested changes for mouse input in advmame.rc, but to no avail. Also, device_keyboard was already set to raw. The emulator takes input from the actual keyboard but doesn't respond to simulated keypresses from xboxdrv.

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

                              @lummox-jr

                              Very strange. And you say other xboxdrv maps are working in other emulators? Try changing:

                              sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >/dev/null
                              

                              to

                              sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >> /dev/shm/runcommand.log 2>&1
                              

                              Then launch a game, exit the game and check /dev/shm/runcommand.log to see if there are any errors.

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

                              L 1 Reply Last reply Reply Quote 0
                              • L
                                Lummox JR
                                last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • L
                                  Lummox JR @mediamogul
                                  last edited by Lummox JR

                                  @mediamogul I had changed the > /dev/null to >>/dev/shm/runcommand.log already, but I added the 2>&1 just now. There's no change. xboxdrv is creating the virtual device like it's supposed to, and AdvanceMAME is not seeing any of its output--no stick, no mouse events, no keyboard events.

                                  [edit] And yes, xboxdrv does work in other emulators--or at least in the Atari 800 emulator(the non-RetroArch one). mame4all and advmame, not so much.

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

                                    @lummox-jr

                                    I have to admit, I'm almost at a loss. I know that AdvanceMAME will only use devices it discovers at launch, so perhaps the xboxdrv keyboard is being created slightly afterward for some reason. Try changing:

                                    advmame = "/opt/retropie/emulators/advmame/bin/advmame %BASENAME%"
                                    

                                    to

                                    advmame = "sleep 2; /opt/retropie/emulators/advmame/bin/advmame %BASENAME%"
                                    

                                    in /opt/retropie/configs/mame-advmame/emulators.cfg and see if that makes any difference.

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

                                    L 1 Reply Last reply Reply Quote 0
                                    • L
                                      Lummox JR @mediamogul
                                      last edited by

                                      @mediamogul I added sleep 2 right in runcommand-onstart.sh after the xboxdrv command, and no such luck. Both mame4all and advmame are completely oblivious to any keyboard/mouse/stick output from xboxdrv.

                                      The sad part is I can get this semi-working without xboxdrv, but the analog control snaps back and although the D-pad works now with the mapping I did, it's still hard to control via the D-pad. Besides, I still would like the option of using xboxdrv for other configuration issues down the road.

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        spud11 @mediamogul
                                        last edited by

                                        @mediamogul My advancemame.rc settings are almost the same as your's, but I include mouse3 settings as well.

                                        While trawling through that file, I did see these settings which are set to auto: input_map[p1_mousex] auto and input_map[p1_mousey] auto.

                                        I haven't changed these at all because everything is working on my system, but perhaps @Lummox-JR could change these to:

                                        input_map[p1_mousex] mouse[0,x] mouse[1,x] mouse[2,x] mouse[3,x]
                                        input_map[p1_mousey] mouse[0,y] mouse[1,y] mouse[2,y] mouse[3,y]
                                        

                                        And see if that has any effect.

                                        RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          spud11 @Lummox JR
                                          last edited by

                                          @lummox-jr Although I'm not using mame4all, I am using lr-mame2000 which uses the same mame romset so I'd assume that core would work with Star Wars.

                                          I also use xboxdrv for my libretro/retroarch cores and, on my system, xboxdrv works fine with lr-mame2000, albeit I'm not mimicking a mouse with it.

                                          RetroPie v4.4.1 • RPi3 Model B • 5.1V 2.5A PSU • 32GB SanDisk Extreme microSD • 2TB Toshiba Canvio Basics Portable USB 3.0 hard drive • 4 x DragonRise USB Arcade joysticks • 2 x TurboTwist spinners • 1 x USB trackball • 1 x PS4 wireless • 1 x 8BitDo Zero

                                          L 1 Reply Last reply Reply Quote 0
                                          • L
                                            Lummox JR @spud11
                                            last edited by

                                            @spud11 I tried changing to lr-mame2000 but the same problem happens there. xboxdrv doesn't work, and also Star Wars doesn't function properly at all in lr-mame2000. There are major glitches with the game there. (The rom loads in lr-mame2003, but then nothing functions whatsoever, even the keyboard, and I have to reboot.)

                                            I didn't try the mouse[3,x] and mouse[3,y] change, but at this point I don't see any value in trying that as the underlying problem definitely goes well beyond mouse input. Absolutely nothing from xboxdrv's mapping comes through in mame4all or advmame (or, when I tested, lr-mame2000 either which was super weird), whether it's keyboard, stick, or mouse.

                                            Just to be safe I did try adding --no-extra-events to the xboxdrv command, but no luck there.

                                            mediamogulM 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.