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

    How to run libretro MAME from commandline? And/or see debug info?

    Scheduled Pinned Locked Moved Help and Support
    commandline
    17 Posts 2 Posters 1.1k 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.
    • W
      wrybread
      last edited by

      I'm trying to use the Attract Mode front end on my Raspbery Pi 3, since I've used Attract Mode for years. I have Attract Mode installed (through retropie_setup -> experimental packages), but it won't launch any ROMs. If I can figure out the command to run ROMs from commandline I should be all set.

      I see posts mentioning needing to turn on commandline in the Libretro core, but haven't been able to find more info. Is that necessary?

      And runcommand.log (the log created when running a ROM in Libretro MAME) isn't giving me much info. It says only:

      Parameters: 
      Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so --config /opt/retropie/configs/mame-libretro/retroarch.cfg "/home/wrybread/RetroPie/roms/mame-libretro/digdug.zip" --appendconfig /dev/shm/retroarch.cfg
      

      When I run that command directly from commandline I don't get any info either.

      /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so --config /opt/retropie/configs/mame-libretro/retroarch.cfg "/home/wrybread/RetroPie/roms/mame-libretro/digdug.zip" --appendconfig /dev/shm/retroarch.cfg
      

      Nor do I get any info when I run this command:

      /opt/retropie/supplementary/runcommand/runcommand.sh 0_SYS_mame-libretto "/home/wrybread/RetroPie/roms/mame-libretro/digdug.zip"
      

      I'm reasonably sure the ROM I'm using is correct for this version of MAME (it's a MAME 2003 rom), but unfortunately I can't see any debug info.

      Any tips to launch a ROM from commandline? And to get more debug info when I do?

      1 Reply Last reply Reply Quote 0
      • W
        wrybread
        last edited by

        I installed MAME v0.206 using apt-get ("sudo apt-get install mame") and the game play seems ok, but it freezes when I hit TAB to configure the game inputs.

        But using it with Attract Mode is a breeze since running a game from commandline is as easy as:

        mame -rompath /home/wrybread/RetroPie/roms/mame digdug
        

        If anyone knows how to do the same (run a ROM from commandline) with Mame Libretro I'd love to hear it.

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

          [...]
          I see posts mentioning needing to turn on commandline in the Libretro core, but haven't been able to find more info. Is that necessary?

          What does 'commandline' mean for the Libretro core ?

          And runcommand.log (the log created when running a ROM in Libretro MAME) isn't giving me much info. It says only:
          [...]
          When I run that command directly from commandline I don't get any info either.

          Enable verbose logging to get more info.

          [..]

          Nor do I get any info when I run this command:
          /opt/retropie/supplementary/runcommand/runcommand.sh 0_SYS_mame-libretto "/home/wrybread/RetroPie/roms/mame-libretro/digdug.zip"

          Because the command you're trying is wrong - there should be some spaces between the parameters and there's no mame-libretto system.

          Launching from the command line can be done with the command that you see in runcommand.log. Why it's not working is a different issue - most likely ROMset version is wrong, see the Arcade docs for how arcade emulation works and why it's important to have the correct ROMseet for the emulator used.

          W 1 Reply Last reply Reply Quote 1
          • W
            wrybread @mitu
            last edited by wrybread

            What does 'commandline' mean for the Libretro core ?
            

            Maybe I misunderstand what the libretro core is. I'm simply trying to launch a ROM using MAME using that version of mame via cli.

            I don't think it was just a romset mismatch, I downloaded the correct ROM for that version of MAME, or at least I think I did.

            As far as the space between 0_SYS_ and mame-libretro, good catch! I did have one in the actual commands I was running though, and it doesn't work with the space either.

            I wound up installing Mame4All (and downloading a romset specifically for it), all seems to be working perfectly now. It's a simple matter of running:

            /opt/retropie/emulators/mame4all/mame digdug

            Not sure why mame-libretro isn't straightforward to run from cli, or maybe it was just a matter of extreme user error.

            Does anyone know if there's a significant disadvantage to mame4all over mame-libretro? All the roms I've tested seem to be working perfectly, but my tastes do lean heavily to the super classics (80s and early 90s).

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

              @wrybread said in How to run libretro MAME from commandline? And/or see debug info?:

              Not sure why mame-libretro isn't straightforward to run from cli, or maybe it was just a matter of extreme user error.

              It's not that extreme. Verbose logging should clear up the issue.

              Does anyone know if there's a significant disadvantage to mame4all over mame-libretro? All the roms I've tested seem to be working perfectly, but my tastes do lean heavily to the super classics (80s and early 90s).

              Yes, mame4all is a very old and un-maintained MAME version, which runs only on a RPI. It's not supported on newer RaspiOS since it depends on the older Broadcom GPU drivers - it's only included for the weakest Pi devices (Pi0/Pi1). The Libretro based MAME cores will run wherever RetroArch runs and receive a modicum of maintenance.

              EDIT: you can use the latest mame also to run things or FBNeo Libretro core, both of which are actively maintained and kept up-to-date. Mame2003-Plus is also an option, it still gets support and - sporadically - also new games.

              W 1 Reply Last reply Reply Quote 0
              • W
                wrybread @mitu
                last edited by wrybread

                @mitu said in How to run libretro MAME from commandline? And/or see debug info?:

                EDIT: you can use the latest mame also to run things or FBNeo Libretro core, both of which are actively maintained and kept up-to-date. Mame2003-Plus is also an option, it still gets support and - sporadically - also new games.

                I tried using the latest MAME, or at least the latest MAME available in the apt package manager, installed via apt-get ("apt-get install mame"). It can launch and play games but it freezes when I hit the TAB key to configure the button inputs.

                I wonder if there's a version in retropie_setup.sh that I missed.

                mituM 1 Reply Last reply Reply Quote 0
                • W
                  wrybread
                  last edited by

                  @mitu said in How to run libretro MAME from commandline? And/or see debug info?:

                  It's not that extreme.

                  It is a bit oddly complicated. Every other version of MAME I've ever used can be run from commandline like:

                  mameExecutable romname
                  

                  With some optional commandline args of course.

                  The Libretro version is running something like:

                  /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-mame2003/mame2003_libretro.so --config /opt/retropie/configs/mame-libretro/retroarch.cfg "/home/wrybread/RetroPie/roms/mame-libretro/digdug.zip" --appendconfig /dev/shm/retroarch.cfg
                  

                  I'm sure it's possible to wade through that and make it work, by enabling verbose output (which doesn't seem to be simply adding a "verbose" commandline arg, but I might be wrong about that). But that's a lot more complicated than every other version of MAME I've ever used.

                  Not saying there aren't good reasons for it though.

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

                    I tried using the latest MAME, or at least the latest MAME available in the apt package manager, installed via apt-get ("apt-get install mame"). It can launch and play games but it freezes when I hit the TAB key to configure the button inputs.

                    I wonder if there's a version in retropie_setup.sh that I missed.

                    There is and that's the version I was referring to. Not sure what what version of RetroPie you're using and how it was installed, since you haven't added any info about your setup, but recent RetroPie versions include a MAME binary installation which installs the latest stable MAME version.

                    W 2 Replies Last reply Reply Quote 0
                    • W
                      wrybread @mitu
                      last edited by

                      @mitu said in How to run libretro MAME from commandline? And/or see debug info?:

                      since you haven't added any info about your setup

                      I mentioned that it's a Pi 3, and it's running retropie-buster-4.8-rpi2_3_zero2w.img.

                      1 Reply Last reply Reply Quote 0
                      • W
                        wrybread @mitu
                        last edited by

                        @mitu said in How to run libretro MAME from commandline? And/or see debug info?:

                        There is and that's the version I was referring to.

                        Is that the version in retropie_setup.sh called "mame" under Experimental Packages?

                        There's a few others, pasting them in in case it's one of those:

                        Under "main packages":
                        avmame-0.94
                        advmame-1.4
                        advmame
                        mame4all
                        lr-mame2000
                        lr-mame2003-plus
                        lr-mame2010

                        Under "experimental packages":
                        mame
                        lr-mame2015
                        lr-mame2016
                        lr-mame

                        1 Reply Last reply Reply Quote 0
                        • W
                          wrybread
                          last edited by

                          The package under Experimental named simply "mame", which is MAME 0.254, has the same issue as the one installed via apt-get, it plays games just fine but when you press TAB everything slows to a crawl and I have to kill the process.

                          1 Reply Last reply Reply Quote 0
                          • W
                            wrybread
                            last edited by

                            Trying to get the Libretro version of MAME working, running with verbose flag I get a lot of errors, lots of them related to trying to create directories in /home/pi subfolders (even though I'm running as user wrybread, so paths should start with /home/wrybread).

                            I pasted the output into this pastebin, I don't imagine anyone has any idea how to fix?

                            https://pastebin.com/raw/Z1JBJUpG

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

                              @wrybread said in How to run libretro MAME from commandline? And/or see debug info?:

                              Trying to get the Libretro version of MAME working, running with verbose flag I get a lot of errors, lots of them related to trying to create directories in /home/pi subfolders (even though I'm running as user wrybread, so paths should start with /home/wrybread).

                              Looks like a broken configuration for the core. Did you copy the configurations from another system ? How did you install RetroPie specifically ?

                              W 1 Reply Last reply Reply Quote 1
                              • W
                                wrybread @mitu
                                last edited by wrybread

                                @mitu said in How to run libretro MAME from commandline? And/or see debug info?:

                                Looks like a broken configuration for the core.

                                Interesting.

                                Did you copy the configurations from another system ? How did you install RetroPie specifically ?

                                No, didn't copy anything, just installed retropie-buster-4.8-rpi2_3_zero2w.img.gz using [Raspberry Pi Imager] (https://www.raspberrypi.com/news/raspberry-pi-imager-imaging-utility/)

                                Is there a way to reset the config for the core?

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

                                  @wrybread said in How to run libretro MAME from commandline? And/or see debug info?:

                                  No, didn't copy anything, just installed retropie-buster-4.8-rpi2_3_zero2w.img.gz using Raspberry Pi Imager

                                  The image is using the pi username for the installation, but you seem to be using a different username (wrybread) for the installation. That's not supported.

                                  Is there a way to reset the config for the core?

                                  You either use the pre-configured username (which is kind of the point of using the pre-installed image) or do a manual installation from the desired user account so that configurations are generated correctly.

                                  W 1 Reply Last reply Reply Quote 0
                                  • W
                                    wrybread @mitu
                                    last edited by

                                    @mitu said in How to run libretro MAME from commandline? And/or see debug info?:

                                    The image is using the pi username for the installation, but you seem to be using a different username (wrybread) for the installation. That's not supported.

                                    Whoa. And oof. I wonder if creating the user "pi" will fix it.

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

                                      @wrybread said in How to run libretro MAME from commandline? And/or see debug info?:

                                      Whoa. And oof. I wonder if creating the user "pi" will fix it.

                                      The user is already present, but the configs are probably broken now since you've run the setup as a different user. Just reinstall the image and start again.

                                      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.