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.
    • 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
                          • mediamogulM
                            mediamogul Global Moderator @Lummox JR
                            last edited by

                            @lummox-jr

                            Have you tried loading the map and then running evtest from the command line on the mouse and keyboard events created by xboxdrv? If they're not registering there, that'll at least explain why mame4all and AdvanceMAME aren't finding them.

                            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 Yes, I've already tried evtest. The mapping works, but the mame4all and advmame emulators are not seeing it.

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

                                @lummox-jr

                                That would seem to isolate the problem to a configuration issue in the advancemame.rc file and the mame4all preferences. Why don't you post both and perhaps something will jump out.

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

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

                                  @mediamogul I can't post the whole files because I have no way of doing so. I can't access the Pi via SCP/SFTP, so I'm limited to typing in what I see on the screen.

                                  What I can tell you for sure is this is a vanilla config. The only relevant info I see in the mame4all mame.cfg file is this:

                                  #Joystick controls for frontend only
                                  #Defaults to XBOX60 controller
                                  J_START=7
                                  J_SELECT=6
                                  J_A=0
                                  AXIS_LR=0
                                  AXIS_UD=1
                                  

                                  And my advmame.rc file has:

                                  device_joystick auto
                                  device_keyboard raw
                                  device_mouse auto
                                  

                                  I have an update however. My evtest runs did not check the buttons, only the analog to mouse output. When I tried testing the buttons again--I think I was confused because I had tested them for the Atari 800--I discovered they weren't set up right at all for my cheapo controller. So I made the right changes for this controller and the keyboard mapping does work now.

                                  I tried to add the mouse[3,x] and mouse[3,y] stuff to advmame.rc along with the earlier mouse changes, but so far no luck with the mouse output.

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

                                    @mediamogul Adding to my previous message, I've tried setting this in advmame.rc:

                                    device_raw_mousedev[0] /dev/input/js1
                                    

                                    ...since that's one of the devices setup by xboxdrv. (The other is /dev/input/event3 but I don't think going by number is safe if I have more controllers plugged in.) No response. I also tried setting device_mouse to auto, raw, event, and sdl but no luck with any of those so I've gone back to auto. device_raw_mousetype[0] is set to the default pnp.

                                    I found some more info here which tells me I need to use the advm utility in advmame's bin files. I tried that, and it tells me there are no mice found under event or raw.

                                    What I'm wondering is if the REL_X and REL_Y mappings don't work if no mouse is attached to the system. That would honestly explain a lot. But I would expect xboxdrv to have a way of dealing with that, maybe some option I'm overlooking. I did try the --mouse option just in case, and I am not currently using --no-extra-devices so that shouldn't be in the way.

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

                                      @lummox-jr said in Using xboxdrv with mame4all:

                                      I made the right changes for this controller and the keyboard mapping does work now.

                                      Nice. That only leaves the mouse.

                                      What I'm wondering is if the REL_X and REL_Y mappings don't work if no mouse is attached to the system.

                                      xboxdrv creates its own mouse event, independent of any hardware mice that may or may not be attached. I believe we've narrowed the problem down to being emulator configuration in some way, but without being able to see a whole config file, I'm afraid its just a guessing game.

                                      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 said in Using xboxdrv with mame4all:

                                        xboxdrv creates its own mouse event, independent of any hardware mice that may or may not be attached. I believe we've narrowed the problem down to being emulator configuration in some way, but without being able to see a whole config file, I'm afraid its just a guessing game.

                                        I've shared the portions that are relevant already, and adopted the input-map items suggested above (including mouse[3,x] and mouse[3,y]), but I can type up a quick summary of that sometime tomorrow just to show where it's at. There isn't a lot in the config related to mouse input: just device_mouse, device_raw_mousedev, and device_raw_mousetype and any input mappings. At least as far as I know, anyway.

                                        Maybe a better and more expedient question, though, is whether anyone has gotten mouse events from xboxdrv to work in advmame. Because if nobody has, maybe it's just not doable. But if someone has, maybe they could post their advmame.rc file and it'd be possible to compare.

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

                                          @lummox-jr said in Using xboxdrv with mame4all/advmame:

                                          Maybe a better and more expedient question, though, is whether anyone has gotten mouse events from xboxdrv to work in advmame.

                                          I use the xboxdrv mouse abilities with advmame quite often. It's usually pretty easy to get going, as there's hardly any setup past what we've already tried. If we rule out the emulator config files, the only suggestion I really have left is that it might be related to your controller in some way.

                                          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 I'm not using the mouse in advmame, but I am in several other emulators.

                                            I'm just wondering whether you have any other input/joysticks attached or just your 1 Shanwan joystick.

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