The NEW Build Your Own Arcade Controls

Main => Raspberry Pi & Dev Board => Topic started by: bbegin on May 24, 2020, 11:32:13 am

Title: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on May 24, 2020, 11:32:13 am
Hi all,

I worked on a personal project for the last months.

The objective was to use a Raspberry Pi 4B and make it as a dedicated MAME Appliance. The system is minimal (following the JeOS principle) and boot straight into the very latest version of MAME. No clutter, no waste of resources and most of all, no useless GUI/window manager (X11).

The performances are really good, as most of the '80s and '90s arcade games run at full speed. Many 2000s games run at full speed as well.

Features and functionalities:

Youtube demonstration video:
(https://img.youtube.com/vi/CfTfSSFWYO0/0.jpg) (https://www.youtube.com/watch?v=CfTfSSFWYO0)

I made a How-To Guide and hosted it on GitHub, but as I am French-speaking, it is written in French. Feel free to translate it to English with Google Translate.

Here is the link to the Step-by-Step How-to Guide:

https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

Google Translate to English : https://translate.google.ca/translate?hl=fr&tab=wT&sl=fr&tl=en&u=https%3A%2F%2Fgist.github.com%2Fsonicprod%2Ff5a7bb10fb9ed1cc5124766831e120c4

Feel free to comment.

Thanks and happy classic/arcade gaming!  :D
-------------------
EDIT 2022/12/19: Here is a new 13 GB SD card image of the system with MAME 0.250 (arcade systems *and* classic computer systems), without ROMs (just put them into /data/roms using the Samba share while in Service mode). The download file size is reduced to 1.3 GB, once compressed (gzip).

https://drive.google.com/file/d/1yd4YG0qNVGhcwFcXYwp_4-3Lor-RUzDo/view?usp=sharing (https://drive.google.com/file/d/1yd4YG0qNVGhcwFcXYwp_4-3Lor-RUzDo/view?usp=sharing)

Important information:
   - The password of the user pi is left to default (raspberry)
   - The Wi-Fi has not been disabled
   - No overclocking has been configured in /boot/config.txt
   - No controller has been configured in mame.ini
   - You will have to expand the /data partition by executing a script (see below)

The system will initially boot in Service mode. Just log in and type:

Code: [Select]
./expand-data-partition.sh
This script will expand /data from 200 MB to all the available free space of the SD Card.

Please refer to the README.txt file once logged in the system.

Please note:


----

Let me know how you appreciate the system!  :-)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 26, 2020, 04:57:54 pm
Interesting project. I guess you could get an even more trimmed down OS by using something else thatn Raspbian, but it would be much more complicated.

One question though: the default SDL2 raspbian package doesn't have KMS support ???
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 26, 2020, 07:50:08 pm
Interesting project. I guess you could get an even more trimmed down OS by using something else thatn Raspbian, but it would be much more complicated.

Yes, you are correct (at least in my opinion).

One question though: the default SDL2 raspbian package doesn't have KMS support ???

There are two (2) problems with the available SDL2 pre-built .deb package from Raspbian repository:
1) SDL2 is built with X11 support, wich drain way too much resources from the Rasperry Pi 4. We are rather using Open GL ES 2 as the graphic rendering engine.
2) Starting from version 2.0.11 of SDL2, a bug is introduced when using KMS/DRM backend and MAME will systematically output a Segmentation fault as soon as we select a game (graphic mode switching).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on May 27, 2020, 01:57:43 pm
Yes, cool project.
I'm building it right now with gcc8 on armbian buster minimal for an odroid xu4.
I'm curious if it'll work out and how its performance will be.
Always nice to try something new.
Thank you.

Edit: I just looked at your video - you really should try https://github.com/mgzme/MAME-PSGS as it looks stunning.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 27, 2020, 07:36:11 pm
Yes, cool project.
I'm building it right now with gcc8 on armbian buster minimal for an odroid xu4.
I'm curious if it'll work out and how its performance will be.
Always nice to try something new.
Thank you.

Edit: I just looked at your video - you really should try https://github.com/mgzme/MAME-PSGS as it looks stunning.

Yes, most of the steps (if not all of them) should work with your Odroid XU4 based on Armbian Buster.

Please keep me informed of the level of performance you get on game emulation with MAME. :)

Thanks,
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 28, 2020, 08:26:32 am
Not trying to sell groovyarcade, but Arch Linux is a great and up to date distro, and pretty lightweight. You could give a try to archlinuxarm (the mame binary should be compatible). The main adgantage is that the steps would be pretty much the same for pi, xu4 or whichever SBC.

See https://archlinuxarm.org/platforms
.
The real question is: did they compile SDL2 with KMS ... If it's using the same package as on x86, the answer should be yes as I've tried MAME on KMS on x86 and it was working pretty well.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 28, 2020, 04:55:56 pm
Not trying to sell groovyarcade, but Arch Linux is a great and up to date distro, and pretty lightweight. You could give a try to archlinuxarm (the mame binary should be compatible). The main adgantage is that the steps would be pretty much the same for pi, xu4 or whichever SBC.

See https://archlinuxarm.org/platforms

Thanks for the suggestion, Substring.

I took a look at ArchLinux ARM, installed it and got stucked at installing the proper build tools (gcc) to build and install SDL2 with KMS and OpenGL ES 2 support enabled, but X11 and OpenGL support disabled. I'm really not familiar at all with pacman.

I was able to enable the Fake KMS driver (in /boot/config.txt) and I can see /dev/dri is successfully enumerated.

I think I will stick with Raspbian Buster Lite as it is based on Debian and I am way more confortable with this flavor of Linux.  ;D
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 29, 2020, 02:12:54 am
Just
Code: [Select]
pacman -Sy base-devel sdl2 mame, it should be enough. Arch already has sdl 2.0.12, so you don't need to compile anything. It will probably install some X dependencies, but it doesn't mean you must start mame in X rather than KMS
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: mamemaniac on May 29, 2020, 09:09:13 am
Can you just upload a torrent? We can add the roms.


Hi all,

I worked on a personal project for the last 2 months.

The objective was to use a Raspberry Pi 4B and make it as a dedicated MAME Appliance. The system is minimal (following the JeOS principle) and boot straight into MAME 0.221, the latest version as of today. No clutter, no waste of resources and most of all, no useless GUI (X11).

The performances are really good, as most of the '80s and '90s arcade games run at full speed. Many 2000s games run at full speed as well.

Features and functionalities:
  • Based on Raspbian Lite (minimal Linux edition based on Debian);
  • At startup, display of a custom splash screen (for example, the MAME logo);
  • The MAME emulator starts automatically and displays the ROM selection screen;
  • When you exit MAME, the system initiates a shutdown;
  • During the shutdown, display of a personalized splash screen (for example, the MAME logo);
  • When the stop operations are completed, the system powers off;
  • To preserve the life of the SD card, the root filesystem is kept in read-only mode;
  • A maintenance mode is proposed (it's called the Service Mode) to allow system updates and the management of ROMs and Snapshots (via a Samba file share).

Youtube demonstration video:
(https://img.youtube.com/vi/CfTfSSFWYO0/0.jpg) (https://www.youtube.com/watch?v=CfTfSSFWYO0)

I made a How-To Guide and hosted it on GitHub, but as I am French-speaking, it is written in French. Feel free to translate it to English with Google Translate.

Here is the link to the Step-by-Step How-to Guide:

https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

Google Translate to English : https://translate.google.ca/translate?hl=fr&tab=wT&sl=fr&tl=en&u=https%3A%2F%2Fgist.github.com%2Fsonicprod%2Ff5a7bb10fb9ed1cc5124766831e120c4

Feel free to comment.

Thanks and happy classic/arcade gaming!  :D
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 29, 2020, 10:07:22 am
Can you just upload a torrent? We can add the roms.

Yes, I will provide a link with a pre-built image ready to be flashed to the SD card.

The only thing to do will be to add ROMs to the /data/roms folder.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on May 29, 2020, 01:10:01 pm
On the xu4 the newly compiled binary bombs with 'Illegal instruction'.
the assembler also gave the following warning:
IT blocks containing 32-bit Thumb instructions are performance deprecated in ARMv8-A and Armv8R just before linking.
If you have any idea or you encountered the same thing please do share or could you provide your binary through pm? I'm curious if yours does the same on my os.
We can exchange them through wetransfer or something...
edit: oh yes, I compiled mame 0219
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 29, 2020, 01:55:20 pm
On the xu4 the newly compiled binary bombs with 'Illegal instruction'.
the assembler also gave the following warning:
IT blocks containing 32-bit Thumb instructions are performance deprecated in ARMv8-A and Armv8R just before linking.
If you have any idea or you encountered the same thing please do share or could you provide your binary through pm? I'm curious if yours does the same on my os.

I'm sorry, I've never had this message while linking MAME. I think it has to do the build architecture flags (ARCHOPTS) when building MAME.

You may take a look at this page to select the proper values for your ARM system:
https://gist.github.com/fm4dd/c663217935dc17f0fc73c9c81b0aa845

We can exchange them through wetransfer or something...
edit: oh yes, I compiled mame 0219

Here is my mamearcade binary (0.221) via Firefox Send : https://send.firefox.com/download/d25b295c469e7fdf/#KR9ojBH4J08N2mY_Ep7BuQ
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on May 29, 2020, 03:02:04 pm
ha... your binary runs. I can create mame.ini but then it fails with
MESA-LOADER: failed to retrieve device information
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so: cannot open shared object file: No such file or directory
failed to load driver: exynos
OpenGL not supported on this driver: Could not initialize EGL
video_init: Initialization failed!

Oh well... it's proving to be more difficult than I assumed. I'll have a look at the link you gave me for the archopts... It's just that it takes hours to compile... but, I guess you've been through that rabbit hole a lot. ;-)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 29, 2020, 03:20:14 pm
ha... your binary runs. I can create mame.ini but then it fails with
MESA-LOADER: failed to retrieve device information
gbm: failed to open any driver (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
gbm: Last dlopen error: /usr/lib/dri/exynos_dri.so: cannot open shared object file: No such file or directory
failed to load driver: exynos
OpenGL not supported on this driver: Could not initialize EGL
video_init: Initialization failed!

Oh well... it's proving to be more difficult than I assumed. I'll have a look at the link you gave me for the archopts... It's just that it takes hours to compile... but, I guess you've been through that rabbit hole a lot. ;-)

Do the DRI drivers are created under /dev ? To check, just type:

ls -l /dev/dri*

You should see "card0" and "renderD128" under /dev/dri.

Did you compiled SDL2 with KMS and OpenGL ES 2 support enabled, and X11 and OpenGL support disabled as per the procedure I made?

If so, you should check carefully in the summary of the configuration utility and the keyword "dynamic" should apper next to "kmsdrm" at the "Video drivers" line (meaning it was dynamically detected):

Video drivers   : dummy kmsdrm(dynamic) opengl_es2
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on May 30, 2020, 01:41:48 am

Do the DRI drivers are created under /dev ? To check, just type:

ls -l /dev/dri*

You should see "card0" and "renderD128" under /dev/dri.

Did you compiled SDL2 with KMS and OpenGL ES 2 support enabled, and X11 and OpenGL support disabled as per the procedure I made?

If so, you should check carefully in the summary of the configuration utility and the keyword "dynamic" should apper next to "kmsdrm" at the "Video drivers" line (meaning it was dynamically detected):

Video drivers   : dummy kmsdrm(dynamic) opengl_es2

well yes it all checks out as far I see

drwxr-xr-x  2 root root        120 Mar 26 23:47 by-path
crw-rw----+ 1 root video  226,   0 Mar 26 23:47 card0
crw-rw----+ 1 root video  226,   1 Mar 26 23:47 card1
crw-rw----+ 1 root render 226, 128 Mar 26 23:47 renderD128
crw-rw----+ 1 root render 226, 129 Mar 26 23:47 renderD129

Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly
Assembly Math   :
Audio drivers   : disk dummy oss alsa(dynamic) sndio(dynamic)
Video drivers   : dummy kmsdrm(dynamic) opengl_es2
Input drivers   : linuxev linuxkd
Using libsamplerate : NO
Using libudev       : YES
Using dbus          : YES
Using ime           : YES
Using ibus          : YES
Using fcitx         : NO
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 30, 2020, 02:58:33 am
What about the missing exynos_dri.so ? Can you find it on your FS ?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on May 30, 2020, 12:01:06 pm
What about the missing exynos_dri.so ? Can you find it on your FS ?

nope - no exynos_dri.so to be found. I've been looking around a bit but I haven't figured it out yet.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 30, 2020, 12:53:15 pm
No wonder DRM is not working then ;) which distro are you using; n your xu4 ? Hardkernel's ubuntu ?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 30, 2020, 02:30:30 pm
As promised, here is a 32 GB SD card image of the system, without ROMs (just put them into /data/roms using the Samba share while in Service mode):

https://drive.google.com/file/d/1I6N4ocQxNH-PhAUYzS8f-6PA_lkmCLeq (https://drive.google.com/file/d/1I6N4ocQxNH-PhAUYzS8f-6PA_lkmCLeq)

Important information:

Let me know how your appreciation of the system!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on May 30, 2020, 02:32:02 pm
No wonder DRM is not working then ;) which distro are you using; n your xu4 ? Hardkernel's ubuntu ?

 :o indeed - no, I'm using Armbian_20.02.7_Odroidxu4_buster_current_5.4.28_minimal.img
No idea how to add that feature as of yet...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 30, 2020, 06:04:30 pm
As promised, here is a 32 GB SD card image of the system, without ROMs (just put them into /data/roms using the Samba share while in Service mode):

https://drive.google.com/file/d/1I6N4ocQxNH-PhAUYzS8f-6PA_lkmCLeq (https://drive.google.com/file/d/1I6N4ocQxNH-PhAUYzS8f-6PA_lkmCLeq)

Important information:
  • The password of the user pi is left to default (raspberry)
  • The Wi-Fi has not been disabled
  • No overclocking has been configured in /boot/config.txt
  • No controller has been configured in mame.ini

Let me know how your appreciation of the system!

I haven't tried your img, but if you allow me to share my experience :
- sharibg an image of a sd card can be risky as most cards thay say 32GB don't have the same size, so the flashing fails
- there is a raspbian image maker that you can very easily customize. This would be a great improvement. See https://github.com/RPi-Distro/pi-gen
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 30, 2020, 06:07:07 pm
No wonder DRM is not working then ;) which distro are you using; n your xu4 ? Hardkernel's ubuntu ?

 :o indeed - no, I'm using Armbian_20.02.7_Odroidxu4_buster_current_5.4.28_minimal.img
No idea how to add that feature as of yet...
The so may bot be in the search path listed in the mesa error, but the file may indeed exist. Find it, then symlink it to one of the paths listed
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 30, 2020, 06:48:29 pm
As promised, here is a 32 GB SD card image of the system, without ROMs (just put them into /data/roms using the Samba share while in Service mode):

https://drive.google.com/file/d/1I6N4ocQxNH-PhAUYzS8f-6PA_lkmCLeq (https://drive.google.com/file/d/1I6N4ocQxNH-PhAUYzS8f-6PA_lkmCLeq)

Important information:
  • The password of the user pi is left to default (raspberry)
  • The Wi-Fi has not been disabled
  • No overclocking has been configured in /boot/config.txt
  • No controller has been configured in mame.ini

Let me know how your appreciation of the system!

I haven't tried your img, but if you allow me to share my experience :
- sharibg an image of a sd card can be risky as most cards thay say 32GB don't have the same size, so the flashing fails
- there is a raspbian image maker that you can very easily customize. This would be a great improvement. See https://github.com/RPi-Distro/pi-gen

I agree that that flashing will fail if the SD Card is smaller than 32 GB in capacity. I just did a quick image with dd and then I compressed it.

I will use a more elaborate imaging solution to make let's say a 8 GB image so it could fit on the vast majority of the SD Cards. The 3rd partition (data) may then be expanded with a utility like gparted or similar.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on May 31, 2020, 03:29:17 am
You can find some tools that can trim down a partition or image to almost the bare necessary. Some distros (like raspbian) have a script that can resize the / partition to extend it to the full capacity. This could be a better idea than having a second partition that require some tools to edit partitions. Not all people are comfortable with this
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on June 01, 2020, 02:49:22 pm
You can find some tools that can trim down a partition or image to almost the bare necessary. Some distros (like raspbian) have a script that can resize the / partition to extend it to the full capacity. This could be a better idea than having a second partition that require some tools to edit partitions. Not all people are comfortable with this

I published a new 8 GB version of the image (see the original post of the topic).

In the next version, I will automate the resizing of /data (using the same principle from Raspbian with expanding the root filesystem).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on June 02, 2020, 10:32:54 am
In the mean time I managed to compile an odoid xu4 version using the same methodology as you.
I'm using other archops reflecting my cpu etc.
ARCHOPTS = -mcpu=cortex-a15.cortex-a7 -mtune=cortex-a15.cortex-a7 -mfpu=auto -mfloat-abi=hard -funsafe-math-optimizations -fexpensive-optimizations -fprefetch-loop-arrays
build cmd
make -j $(nproc) CFLAGS="-Wno-error=format-truncation -fPIC" SUBTARGET=arcade OSD=sdl NO_X11=1 NOWERROR=1 NO_USE_XINPUT=1 NO_USE_XINPUT_WII_LIGHTGUN_HACK=1 NO_OPENGL=1 USE_QTDEBUG=0 DEBUG=0 REGENIE=1 NO_BGFX=1
It all checks out but it is extremely slow.
Cabal runs at 16% for example. The mouse barely moves when the qt window is open.
I find it odd. It is just too slow so something must still be wrong. I am thinking that maybe it's not using the gpu but I do not (yet) know how I can check that.
I first made a non optimized version and than the optimized one but both are very very slow.
The board is connected to a 1200*1920 tft at the moment. It is a 32bit cpu so a 32bit os.
I'm using ubuntu-18.04.3-4.14-minimal-odroid-xu4-20190910 atm.
If anyone has an idea (or some test program/code) do share please. 
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on June 02, 2020, 11:35:47 am
In the mean time I managed to compile an odoid xu4 version using the same methodology as you.
I'm using other archops reflecting my cpu etc.
ARCHOPTS = -mcpu=cortex-a15.cortex-a7 -mtune=cortex-a15.cortex-a7 -mfpu=auto -mfloat-abi=hard -funsafe-math-optimizations -fexpensive-optimizations -fprefetch-loop-arrays
build cmd
make -j $(nproc) CFLAGS="-Wno-error=format-truncation -fPIC" SUBTARGET=arcade OSD=sdl NO_X11=1 NOWERROR=1 NO_USE_XINPUT=1 NO_USE_XINPUT_WII_LIGHTGUN_HACK=1 NO_OPENGL=1 USE_QTDEBUG=0 DEBUG=0 REGENIE=1 NO_BGFX=1
It all checks out but it is extremely slow.
Cabal runs at 16% for example. The mouse barely moves when the qt window is open.
I find it odd. It is just too slow so something must still be wrong. I am thinking that maybe it's not using the gpu but I do not (yet) know how I can check that.
I first made a non optimized version and than the optimized one but both are very very slow.
The board is connected to a 1200*1920 tft at the moment. It is a 32bit cpu so a 32bit os.
I'm using ubuntu-18.04.3-4.14-minimal-odroid-xu4-20190910 atm.
If anyone has an idea (or some test program/code) do share please.

Hi ZoOl007,

Did you also compiled SDL2 with the provided build parameters?

Did you forced MAME to use the KMSDRM backend and OpenGL ES rendering engine (start MAME with -videodriver kmsdrm -renderdriver opengles2 -video accel)?

Make sure your user account running MAME is a member of the render group (see my procedure).
You could test if your hardware acceleration is OK with the kmscube test utility (https://gitlab.freedesktop.org/mesa/kmscube/).
 
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on June 02, 2020, 07:12:49 pm
Hi all,

Here is a new 4GB image file of the system. Again, without ROMs (just put them in /data/roms) - see the link in the original topic post.

I put the system in Service mode, so you can start with expanding the /data partition and add ROMs with Samba.

To put back in Arcade mode, just issue:

rw
arcademode
sudo reboot
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Substring on June 03, 2020, 03:10:58 am
Nice !

Have you tried sdl 2.0.12 ?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on June 03, 2020, 06:25:01 pm
Nice !

Have you tried sdl 2.0.12 ?

Thanks!

FYI, we need to build SDL 2.0.10, not 2.0.12 (as stated in the How-to Guide, there is a bug with version 2.0.11 and up, so we should stay at 2.0.10 until the bug is fixed).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ZoOl007 on June 06, 2020, 11:36:06 am
I managed to get it to work on the OdroidXU4. I did not yet set it up as a dedicated tv appliance as you did but I did get mame 0.219 running smoothly.
I tried several games including the ones in your movie and performance is top. WonderBoy3 isn't running at 100% - does that run 100% on the Pi4?
As for audio I can't say as I'm using hdmi to dvi atm.
The only thing that is a pity is that glsl can't work. If that could work it would be perfect.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on June 06, 2020, 01:09:09 pm
I managed to get it to work on the OdroidXU4. I did not yet set it up as a dedicated tv appliance as you did but I did get mame 0.219 running smoothly.
I tried several games including the ones in your movie and performance is top. WonderBoy3 isn't running at 100% - does that run 100% on the Pi4?
As for audio I can't say as I'm using hdmi to dvi atm.
The only thing that is a pity is that glsl can't work. If that could work it would be perfect.

Great to know that you've been able to successfully replicate the steps on your Odroid XU4 :)

The objective for me is to integrate the Raspberry 4B in a bartop arcade cabinet.

FYI, I also tried Wonder Boy 3, as you proposed and the speed isn't running at 100 % for me too on the Raspberry Pi 4.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: HannibalAnthrope on August 25, 2020, 09:34:35 pm
I burned your latest chip image to a clean chip and tried to boot it in a Pi4B 2gb.  Mame splash appears, boot never completes.  On tty3 I see a number of "FAILED" messages (Load/Save RF Kill Switch, dependency failed for local file systems, dependency failed for MAME autostart, etc..etc..) and then finally emergency mode.  Except it cannot open access to the console and reports the root account is locked.  LOL
Can't even get to a # prompt to try to fix it.  Shame too because it looks like you put a lotta work into this.  Seems like you may have overcooked the soup!  A bit too much automation maybe?  No offense intended.  I'll take a look around it and see if I can find the main issues.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on August 25, 2020, 10:08:22 pm
I burned your latest chip image to a clean chip and tried to boot it in a Pi4B 2gb.  Mame splash appears, boot never completes.  On tty3 I see a number of "FAILED" messages (Load/Save RF Kill Switch, dependency failed for local file systems, dependency failed for MAME autostart, etc..etc..) and then finally emergency mode.  Except it cannot open access to the console and reports the root account is locked.  LOL
Can't even get to a # prompt to try to fix it.  Shame too because it looks like you put a lotta work into this.  Seems like you may have overcooked the soup!  A bit too much automation maybe?  No offense intended.  I'll take a look around it and see if I can find the main issues.

I would try first to get back the kernel messages on the console so you can pinpoint the problem.

From another computer, you can edit the file /boot/cmdline.txt on the SD card and remove the following arguments from the kernel command-line:

    logo.nologo vt.global_cursor_default=0 quiet

And put back "console=tty1", instead of "console=tty3".

Can you take a picture of the kernel messages (and post it here) once the boot process is stucked?

To make an offline switch to Service mode, delete these 2 files from the SD card:
/etc/systemd/systm/network.target.wants/mame-autostart.service.
/etc/systemd/system/multi-user.target.wants/shutdown.service.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on August 25, 2020, 10:53:00 pm
I burned your latest chip image to a clean chip and tried to boot it in a Pi4B 2gb.  Mame splash appears, boot never completes.  On tty3 I see a number of "FAILED" messages (Load/Save RF Kill Switch, dependency failed for local file systems, dependency failed for MAME autostart, etc..etc..) and then finally emergency mode.  Except it cannot open access to the console and reports the root account is locked.  LOL
Can't even get to a # prompt to try to fix it.  Shame too because it looks like you put a lotta work into this.  Seems like you may have overcooked the soup!  A bit too much automation maybe?  No offense intended.  I'll take a look around it and see if I can find the main issues.

I would try first to get back the kernel messages on the console so you can pinpoint the problem.

From another computer, you can edit the file /boot/cmdline.txt on the SD card and remove the following arguments from the kernel command-line:

    logo.nologo vt.global_cursor_default=0 quiet

And put back "console=tty1", instead of "console=tty3".

Can you take a picture of the kernel messages (and post it here) once the boot process is stucked?

To make an offline switch to Service mode, delete these 2 files from the SD card:
  -  /etc/systemd/systm/network.target.wants/mame-autostart.service          OR (old name)        autostart-mame.service
  -  /etc/systemd/system/multi-user.target.wants/shutdown.service
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: HannibalAnthrope on August 27, 2020, 09:56:09 am
I had the same ideas, plus I just loaded the overlay to disable wifi because I don't use it.
I got the failed messages pretty much cleared up, and I cleaned up the filesystems on another Pi but I was never able to get past the root account locked problem and a few hours trying to research that on the net was painful and unfruitful.  I still don't know what to do to solve it or what causes it because there were as many "answers" as people.  I did try more than one Pi even though this one was brand new and is running fine now (and it ran RetroPie just fine too although that was a short test because I hate it and think it's garbage LOL).

If you'd like me to test again I can probably do that, but I would ask that you re-download the image you've posted, burn it to a chip and test it on your Pi4 to verify - and not that I don't appreciate your work, I do - but debugging a bootable chip image is time consuming and frustrating.  And I'm pretty sure the final result is going to be confirming for me that MAME still does NOT work right on a Pi4, at least not with the classic games I use (Space Invaders for one).  Even back to build .078 and having compiled SDL2 correctly MAME just eats the cpu and is far too slow to even play Space Invaders.  I'm not sure how others are reporting it to work ok for them <shrug>.  Anyway, let me know if you want try fixing it.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on August 27, 2020, 02:53:43 pm
I had the same ideas, plus I just loaded the overlay to disable wifi because I don't use it.
I got the failed messages pretty much cleared up, and I cleaned up the filesystems on another Pi but I was never able to get past the root account locked problem and a few hours trying to research that on the net was painful and unfruitful.  I still don't know what to do to solve it or what causes it because there were as many "answers" as people.  I did try more than one Pi even though this one was brand new and is running fine now (and it ran RetroPie just fine too although that was a short test because I hate it and think it's garbage LOL).

I think your problem is caused by the kernel not being able to mount the root filesystem (for some reason). Maybe because of the wrong PARTUUID, depending the tool you used to write the .img file to the SD card. I will update the procedure to switch to LABEL= in /etc/fstab.

Can you try this solution, please:
1. Mount the Raspberry Pi SD card on another computer
2. Edit the file /etc/fstab
3. Make sure you update these 3 lines (notice the LABEL= at leftmost):

LABEL=boot            /boot           vfat    defaults,ro                 0    2
LABEL=rootfs          /               ext4    defaults,noatime,ro         0    1
LABEL=data            /data           f2fs    defaults,noatime,discard    0    2


4. Edit /boot/cmdline.txt and replace the parameter "root=PARTUUID=xxxxxxxx" by:
root=/dev/mmcblk0p2

If you'd like me to test again I can probably do that, but I would ask that you re-download the image you've posted, burn it to a chip and test it on your Pi4 to verify - and not that I don't appreciate your work, I do - but debugging a bootable chip image is time consuming and frustrating.  And I'm pretty sure the final result is going to be confirming for me that MAME still does NOT work right on a Pi4, at least not with the classic games I use (Space Invaders for one).  Even back to build .078 and having compiled SDL2 correctly MAME just eats the cpu and is far too slow to even play Space Invaders.  I'm not sure how others are reporting it to work ok for them <shrug>.  Anyway, let me know if you want try fixing it.

If you are not able to emulate Space Invaders on a Raspberry Pi with MAME, it's because the hardware acceleration is not enabled.
I am able to emulate much more complex games with full speed (DoDonPachi, Truxton II, etc.) on my Raspberry Pi 4 with the provided How-To.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 16, 2020, 03:03:30 am
I got your image running and it's a great project! I would like to know how I can update MAME to the latest version (0.224). As far I followed to your step-by-step tutorial you excluded MESS. I would like to include the whole MAME (with the systems from MESS). What do I need to modify in the update script?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 16, 2020, 08:30:54 am
Hi teller,

To get the full MAME (arcade and classic systems), just remove SUBTARGET=arcade from MAKEOPTS variable asingment.

Be advised that I did not tested this build/compilation.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 16, 2020, 08:51:36 am
Thanks for your quick reply.
So I better make a backup before I update.
What are the update commands in servicemode?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 16, 2020, 09:48:34 am
Thanks for your quick reply.
So I better make a backup before I update.
What are the update commands in servicemode?

Yes, make à backup of the MAME binary before starting à MESS/MAME build.

Start the build with (provided you already made the ajustments to drawbgfx.cpp):

./mame-update.sh 0224
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 16, 2020, 09:52:18 am
Ok, I will try out tonight and let you know.
Thanks!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 16, 2020, 02:15:43 pm
To remove the line "MAKEOPTS='SUBTARGET=arcade",
where is the "mame-update.sh" located?
In servicemode if I type
Code: [Select]
nano ~/mame-update.shall I get is a blank GNU nano 3.2.
Sorry for the noob question, I'm a Windows user ;).
And always, thanks for taking your time.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 16, 2020, 04:29:04 pm
To remove the line "MAKEOPTS='SUBTARGET=arcade",
where is the "mame-update.sh" located?
In servicemode if I type
Code: [Select]
nano ~/mame-update.shall I get is a blank GNU nano 3.2.
Sorry for the noob question, I'm a Windows user ;).
And always, thanks for taking your time.

Hi, you should be able to edit the mame-update.sh script with the command you specified. Are you logged with the user "pi" ?

If not, you should use this user account to log in. The password is the default one: raspberry

All the scripts are under /home/pi, including mame-update.sh

As a side note, you should only remove SUBTARGET=arcade from the options. All the remaining options have to remain there, unchanged.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 16, 2020, 04:32:47 pm
ANNOUNCEMENT - NEW IMAGE AVAILABLE WITH MAME 0.224

Just to let everyone know that I published today a new version of the image with MAME 0.224. The minimum size of the SD card should be 16 GB (10 GB for the root filesystem and the remaining space for the data partition for storing ROMs).

Please see the original post at the beginning of this thread for the download link and the first steps do do once the image is written to the SD card.

Thanks and happy gaming!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 16, 2020, 04:36:18 pm
wow, many thanks!
is this the full mame version (with mess)?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 16, 2020, 05:11:52 pm
wow, many thanks!
is this the full mame version (with mess)?

Hi, no this version does not include MESS. I am currently compiling the full version, as a first try. Let's see how it goes. Stay tuned.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 16, 2020, 11:05:38 pm
wow, many thanks!
is this the full mame version (with mess)?

Hi, no this version does not include MESS. I am currently compiling the full version, as a first try. Let's see how it goes. Stay tuned.

Hi, just to let you know that I successfully compiled the complete MAME (including the MESS code). I decided to include the MESS code, as it has no impact on ressource consumption on the system.

I will update the image file tomorrow.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 17, 2020, 01:43:18 am
 :applaud:
Thanks a lot‼️
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 17, 2020, 12:32:58 pm
Just to let know to everyone that I uploaded today a new version of the disk image file. The MAME binary now include the MESS code for the emulation of classic computer systems in addition to arcade systems.

The original post of this thread has been upated with the new download link.

Enjoy!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 17, 2020, 12:45:20 pm
Fantastic news!
I will try out tonight.
One question:
Is there also a folder for "artwork" on "\\arcade\data"?
I ask because the "Game & Watch" system needs an artwork folder.

Thanks!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 17, 2020, 12:50:16 pm
Fantastic news!
I will try out tonight.
One question:
Is there also a folder for "artwork" on "\\arcade\data"?

Thanks!

Hi, the answer is yes. I externalized (among others) the "artwork" folder, so you can use your own effect masks for emulating a CRT. Not to be confused with the "snap" folder, where all the game snapshots should be placed (also under \\arcade\data).

I hope this anwser your question.

Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 17, 2020, 12:50:49 pm
First of all it's really amazing getting a working MAME 0.224 on a Raspberry Pi 4, many thanks for your effort and time!

I just tested your image and have some feedback/questions/issues:
Somehow the software list per system won't get recognized automatically which means you cannot load the game instantly in the software list menu. For example the game system "VIDEOPAC" has a voice module which has to get loaded in -cart1 and then the actual game in -cart2. I can only select one slot (cart, floppy or whatever the system needs). That's because somehow the system can't see its software.
Maybe this setting or feature is manually turned off or not yet implemented?

Further issues/questions:
- How can I change "Video Options"? Somehow I cannot enter it. I would like to have "bilinear filtering" off.
- Under "Machine options" when I set "UI Active ON", MAME is freezing (nothing can be edited).
- When I connect a USB Joystick it doesn't get recognized and cannot be mapped. Do I need to set it manually in the "cfg" folder (default.cfg)?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 18, 2020, 06:11:37 pm
First of all it's really amazing getting a working MAME 0.224 on a Raspberry Pi 4, many thanks for your effort and time!

I just tested your image and have some feedback/questions/issues:
Somehow the software list per system won't get recognized automatically which means you cannot load the game instantly in the software list menu. For example the game system "VIDEOPAC" has a voice module which has to get loaded in -cart1 and then the actual game in -cart2. I can only select one slot (cart, floppy or whatever the system needs). That's because somehow the system can't see its software.
Maybe this setting or feature is manually turned off or not yet implemented?

Further issues/questions:
- How can I change "Video Options"? Somehow I cannot enter it. I would like to have "bilinear filtering" off.
- Under "Machine options" when I set "UI Active ON", MAME is freezing (nothing can be edited).
- When I connect a USB Joystick it doesn't get recognized and cannot be mapped. Do I need to set it manually in the "cfg" folder (default.cfg)?

First, let me say that I am very happy to hear comments and feedback like yours, teller! :)

I will try to answer your issues/questions the best I can.
For MESS emulation, I did not made tests, as this part of the code has been enabled very recently (as you know). Can you explain me how to reproduce your problem? Do I need to download the BIOS of the Phillips Videopac+ system first? What voice module does need loading from cartridge1 and what game are you trying to emulate in cartridge2? I will try to reproduce your issue and see what I can do.

The "Video Options" menu is unfortunately not working for me too (I get a Segmentation fault when I try to use it). If you want to turn off "bilinear filtering" globally, just ajust mame.ini in that way:

#
# OSD ACCELERATED VIDEO OPTIONS
#
filter                    0


For your "Machine Options" issue, do you mean the "Configure Machine" from the main selection screen?

For the USB Joystick to be recognized, you first need to be in read/write mode (use the alias "rw" in an SSH session) when connecting it. This way, Linux will be able to write the values to the root filesystem persistently. Also make sure your joystick is supported natively by the Linux kernel (lsusb -t). Once recognized by the Linux kernel, you assign the joystick configuration file (mappings) in /data/ini/mame.ini:

#
# CORE INPUT OPTIONS
#
ctrlr                     
<name-of-cfg-file-without-extension>

The mapping file is ending with a .cfg extension and should be placed in "/data/ctrlr" folder.

I hope these answers helps you a bit!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 19, 2020, 10:22:41 am
Where is my reply?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 19, 2020, 10:25:40 am
Hi teller,

I think your last post was deleted (it contained a link to a copywrited software, I guess). Can you post it again (without the link), please?

Regarding the problem with enabling "UI Active" to "On", I do not have this problem. But I think I know the cause. I just want to confirm something with your version of the file "mame-launcher.sh". Can you confirm that you have the line in red below in the script?

#!/bin/bash

# This script launch the MAME emulator and respawn it if quit unexpectedly.

export SDL_VIDEODRIVER=kmsdrm
export SDL_RENDER_DRIVER=opengles2
export SDL_RENDER_VSYNC=1
export SDL_GRAB_KEYBOARD=1
export SDL_VIDEO_GLES2=1


if [ ! -z $MAMEPATH ] && [ -f $MAMEPATH/mame ]; then
    cd $MAMEPATH
    while
        $MAMEPATH/mame -nojoy -nomouse > /dev/null 2>&1
        (( $? != 0 ))
    do
        :
    done
else
    echo $0 - Variable MAMEPATH is not defined or invalid!
    read -n 1 -s -r -p "Press any key to continue..."
    echo
fi

Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 19, 2020, 10:48:33 am
I don't have that red line in "mame-launcher.sh".
Shall I add it?

I posted a video about how the "software package list" looks in MAME on Windows and how you use The Voice module for the Videopac.
Here's the video again:
https://youtu.be/k_-VnWwKW6s

"filter 0" and "UI active On" I could set successfully in mame.ini.

I still cannot map my usb joystick, but in "rw" mode I can see it under js0 and I also tested the directions but when I try to map it in MAME under "General Options/General Inputs/Player 1 Controls" the Joystick controls cannot be mapped.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 19, 2020, 10:53:58 am
I just added the red line you mentioned and now the software list appears!
thanks for the fix!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 19, 2020, 11:09:02 am
I just added the red line you mentioned and now the software list appears!
thanks for the fix!

Great, things look good so far!

For your joystick, I think I have the solution :

Edit mame-launcher.sh and remove "-nojoy" from the Line calling the MAME binary. The Line in question begin with:

$MAMEPATH/mame -nojoy -nomouse

If you don't have any specific joystick mappings in Windows, that means you don't need them on the Raspberry Pi, so leave the "ctrlr" option empty in mame.ini.


Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 19, 2020, 11:42:21 am
The Joystick works too!
Thanks!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 19, 2020, 11:58:01 am
The Joystick works too!
Thanks!

Great news!

So everything works as expected?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 19, 2020, 12:11:49 pm
somehow i get a segmentation fault line 24 when starting some games.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 19, 2020, 12:19:30 pm
somehow i get a segmentation fault line 24 when starting some games.

You talk about the Odyssey2 games emulated by the MESS codebase?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 19, 2020, 12:36:59 pm
yep. It worked before but after loading the voice module and adding a game in -cart2. I cannot play any of the odyssey2 games  :hissy: and I don't know why. All I get is a segmentation fault line 21 error.
all other systems work very well. I also tried the Intellivison with Intellivoice (2 cart-mode too) and there is no issue at all.

Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 19, 2020, 12:47:24 pm
yep. It worked before but after loading the voice module and adding a game in -cart2. I cannot play any of the odyssey2 games  :hissy: and I don't know why. All I get is a segmentation fault line 21 error.
all other systems work very well. I also tried the Intellivison with Intellivoice (2 cart-mode too) and there is no issue at all.

Maybe flush the content of /data/nvram and any persistent data that might have been written to /data for the Odyssey2. We ajusted mame-launcher.sh so MAME can work correctly, so there may be an before/after effect/inconsistency in data files of the Odyssey2 system.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 19, 2020, 04:23:37 pm
To get the voice module working the odyssey2.cfg should be generated as this:
Code: [Select]
<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="odyssey2">
        <image_directories>
        <device instance="cartridge1" directory="/home/pi/mame0224" />
            <device instance="cartridge2" directory="/home/pi/mame0224" />
        </image_directories>
    </system>
</mameconfig>

But somehow it won't generate those directories properly.


I've also tested thos "Game & Watch" games and they are sadly too slowly for the Pi4. They must be cpu-hungry because of the vectorized svg's, maybe?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 19, 2020, 06:44:45 pm
To get the voice module working the odyssey2.cfg should be generated as this:
Code: [Select]
<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="odyssey2">
        <image_directories>
        <device instance="cartridge1" directory="/home/pi/mame0224" />
            <device instance="cartridge2" directory="/home/pi/mame0224" />
        </image_directories>
    </system>
</mameconfig>

But somehow it won't generate those directories properly.

What directories are not generated properly? If you specify the path "/home/pi/mame0224", please note that this path is read-only in normal operation. If you need write access, we need to externalize it to /data first. But first, I need to know what kind of files are generated.

Quote from: teller
I've also tested thos "Game & Watch" games and they are sadly too slowly for the Pi4. They must be cpu-hungry because of the vectorized svg's, maybe?

I didn't tested these games, so I can't comment, sorry about that.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 19, 2020, 06:54:36 pm
Teller, please note that I will be uploading a new version of the disk image-file.

Today, I made some additions that may (or not) fix your problem with the Odyssey2 system.

CHANGES:

1. In /data/ini/mame.ini, these paths have changed (please make the ajustments):

Code: [Select]
homepath             $HOME/.mame/lua
input_directory      $HOME/.mame/inp
diff_directory       $HOME/.mame/diff

2. Create the new folders on /data:

Code: [Select]
cd /data
mkdir lua inp diff
sudo chown -R nobody:pi /data
sudo chmod -R 3774 /data

3. Create the related symlinks in ~/.mame folder:

Code: [Select]
ln -s /data/lua      ~/.mame/lua
ln -s /data/inp      ~/.mame/inp
ln -s /data/diff     ~/.mame/diff
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 20, 2020, 04:12:47 am
you're a unstoppable!😜

I just tested your new image and for the sake of Videopac G7400 I still get an error but this time with more infos, see screenshot below.
I am sure that all my files are working because I copied them from my Windows MAME 0.224 set and they should be identical. This "charset_ef9340_1.rom" which is inside the "ef9340_1.zip" is working on my pc but somehow it doesn't get tolerated here as a proper BIOS. And that strange message: Invalid BIOS "1", reverting to default.
Maybe there is still something missing, needed, buggy?

All the best and thanks again.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 20, 2020, 09:23:14 am
you're a unstoppable!😜

I just tested your new image and for the sake of Videopac G7400 I still get an error but this time with more infos, see screenshot below.
I am sure that all my files are working because I copied them from my Windows MAME 0.224 set and they should be identical. This "charset_ef9340_1.rom" which is inside the "ef9340_1.zip" is working on my pc but somehow it doesn't get tolerated here as a proper BIOS. And that strange message: Invalid BIOS "1", reverting to default.
Maybe there is still something missing, needed, buggy?

All the best and thanks again.

Thanks teller!

I suggest you copy the hash files related to Odyssey2 from your Windows machine to your Raspberry Pi in /home/pi/mame0224/hash folder. MAME is using those files to check if romsets are the expected version.

As a side note, you see more information (error messages) because there is a little error in mame-launcher.sh. I will upload a new fixed version today. The script will behave differently if called in Service mode or Arcade mode.

So to get full debug, with the new image, just switch to Service mode in an SSH session and start MAME with verbose mode :

Code: [Select]
rw
servicemode
sudo reboot

./mame-launcher.sh -v
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 20, 2020, 02:02:52 pm
Thanks but it's not the hash files, I tried that. I also tried swapping out the dependent bios files with the latest ones but had still no luck.
I tried verbose mode but can't find out why most of the odyssey2 or g7400 games won't start. Weirdly I can load every game as a .bin file via File Loader when using Tab menu. But sadly it's not possible loading 'The Voice' directly from the software list menu and then loading a voice supported game into the 2nd cartridge slot.

I don't think that this 0.224 version would need different bios content than from Windows as it comes from the same source, which makes sense.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 20, 2020, 02:36:31 pm
Thanks but it's not the hash files, I tried that. I also tried swapping out the dependent bios files with the latest ones but had still no luck.
I tried verbose mode but can't find out why most of the odyssey2 or g7400 games won't start. Weirdly I can load every game as a .bin file via File Loader when using Tab menu. But sadly it's not possible loading 'The Voice' directly from the software list menu and then loading a voice supported game into the 2nd cartridge slot.

I don't think that this 0.224 version would need different bios content than from Windows as it comes from the same source, which makes sense.

The only thing I can see is that MAME (for some reason) try to write data to the root filesystem, wich is read-only by default. To validate this, you can put the system in read/write mode (while in Service mode) and try to load Odissey2 or G7400 games. You can also start MAME with -oslog and -log options to get more information on what's going on (in Service mode).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 20, 2020, 09:04:32 pm
FYI, the new disk image-file has been uploaded and is now available from the link in the original post of this topic. Enjoy!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 21, 2020, 01:04:28 pm
Thanks!
I made further investigations why Odyssey2/Videopac crashes when starting from the Software list. It's not because my files are wrong or missing or because of your image.
It's simply because it crashes generally on Linux. I just installed the latest MAME 0.224 on Linux (Ubuntu) and directed the same roms which I have on a SD card. Also The Voice module won't work.
For the moment it only works on Windows, so time will tell and hopefully it will on 0.225.
I've also heard that Odyssey/Videopac won't work normally on the latest SDL MAME on Mac.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 21, 2020, 01:47:35 pm
Thanks!
I made further investigations why Odyssey2/Videopac crashes when starting from the Software list. It's not because my files are wrong or missing or because of your image.
It's simply because it crashes generally on Linux. I just installed the latest MAME 0.224 on Linux (Ubuntu) and directed the same roms which I have on a SD card. Also The Voice module won't work.
For the moment it only works on Windows, so time will tell and hopefully it will on 0.225.
I've also heard that Odyssey/Videopac won't work normally on the latest SDL MAME on Mac.

I'm very glad to hear that my image is not related to the Odyssey2/Videopac problem. As I understand it, it looks like it is related to the use of the SDL layer by MAME. Maybe you could file a bug report to MAME devs.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 22, 2020, 09:39:43 am
Somebody already mentioned it:
https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=117746
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 23, 2020, 05:16:21 pm
Somebody already mentioned it:
https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=117746

Great, at least the bug is known and documented. Do you know if it has been filed on the official MAME testers team (on mametesters.org)?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: PL1 on September 23, 2020, 08:34:14 pm
Somebody already mentioned it:
https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=117746

Great, at least the bug is known and documented. Do you know if it has been filed on the official MAME testers team (on mametesters.org)?
Looks like there's no need to report it to MAME testers -- the "m_b = get_feature("b_pin") && bool(strtoul(get_feature("b_pin"), nullptr, 0)) ? 1 : 0;" code mentioned by hap in that thread was added to lines 146 and 147 of src/devices/bus/odyssey2/slot.cpp (https://github.com/mamedev/mame/blob/3624b416ba81e5e17f051005f5bd39cb1f6d1130/src/devices/bus/odyssey2/slot.cpp) on August 30th.

You can see the before(pink)/after(green) code about half-way down the page of this commit.
https://github.com/mamedev/mame/commit/3624b416ba81e5e17f051005f5bd39cb1f6d1130#diff-c903dd5a8ba87be3732bd5fca46d20c7 (https://github.com/mamedev/mame/commit/3624b416ba81e5e17f051005f5bd39cb1f6d1130#diff-c903dd5a8ba87be3732bd5fca46d20c7)


Scott
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 24, 2020, 12:10:34 pm
Does that mean if we would compile MAME again it would be fixed or do we have to wait for 0.225?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 24, 2020, 12:38:29 pm
Does that mean if we would compile MAME again it would be fixed or do we have to wait for 0.225?

Hi teller, if you download the master branch (from GitHub), then yes you will get all the fixes that have been already integrated in the master branch. You will get à file named mame-master.zip. You will have to uncompress in a folder you create manually (like mame0224a) and call the build script with: ./mame-update 0224a
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 24, 2020, 01:20:46 pm
Cool, I will try it out!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 25, 2020, 01:52:49 am
I built it over night. it's done but I don't know where it's placed. I named it mame0224a. The old mame0224 is still there.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 25, 2020, 07:17:16 am
I built it over night. it's done but I don't know where it's placed. I named it mame0224a. The old mame0224 is still there.

If the build was successful, it produced a binary named mame in /home/pi/mame0224a. The mame-launcher.sh script expect the environment variable $MAMEPATH to be set. Make sure this variable is ajusted to /home/pi/mame0224a (sudo edit /etc/environment). You may have to reboot for this to take effect.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 25, 2020, 12:19:04 pm
Unfortunately I don't see any mame binary in /home/pi/mame0224a and tried again with ./mame-update.sh 0224a. During the make1 this error occured: "3rdparty/genie/build/gmake.linux -> No such file or directory".
What could be wrong?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 25, 2020, 12:34:35 pm
Unfortunately I don't see any mame binary in /home/pi/mame0224a and tried again with ./mame-update.sh 0224a. During the make1 this error occured: "3rdparty/genie/build/gmake.linux -> No such file or directory".
What could be wrong?

It may be because there is not enough free space for the build process to complete (check with "df"). Can you check if the file exist in the specified location? How much RAM your Raspberry Pi 4 has? To build with 4 threads in parallel, you need 4 GB of RAM.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 25, 2020, 02:45:20 pm
Indeed that 3rdparty folder was missing. Will copy mame-master again and try from scratch.
I have a Pi4 4G Model B.
Happy weekend.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 25, 2020, 10:49:08 pm
Indeed that 3rdparty folder was missing. Will copy mame-master again and try from scratch.
I have a Pi4 4G Model B.
Happy weekend.

I think the fact that the 3rdparty folder was missing is due to a logic error in the mame-update.sh script (we should only do the cleanup if the build is successful - I just fixed this and uploaded a new version of the image-file and also updated the How-To, if you want to ajust the script, wich is faster).

Thanks and have a great weekend you too!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 26, 2020, 10:44:33 am
Build FAILED with your latest image.
make: *** [makefile:1375: linux] Error 2
Wasted more than 5h...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 26, 2020, 11:29:09 am
Build FAILED with your latest image.
make: *** [makefile:1375: linux] Error 2
Wasted more than 5h...

What's the build error message (look upward in the scrollback).

Personnally, I successfully compiled the master branch without any issue.

I can send you the binary, if you want. Here we go (just put the binary in /home/pi/mame0224a):

https://drive.google.com/file/d/1NNdl2eDRnf3l5O8iePnfoMuaPKswH5QM/view?usp=sharing
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on September 26, 2020, 11:32:29 am
Thanks for the binary, it's finally working!
Now I can play all the VIDEOPAC games with full Voice support!
Amazing work and lots of help from you, thanks again!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on September 26, 2020, 03:32:54 pm
Thanks, it's finally working!
Now I can play all the VIDEOPAC games with full Voice support!
Amazing work and lots of help from you, thanks again!

Great, my pleasure! :)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on October 01, 2020, 07:15:21 am
MAME v0.225 just released!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on October 01, 2020, 08:20:29 am
MAME v0.225 just released!

Yes, and I built it successfully yesterday. I will post à new image today with MAME 0.225.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on October 01, 2020, 10:38:13 am
Glad you will keep it updated, thanks!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on October 01, 2020, 01:12:32 pm
Just to let you know the availability of the new disk image file with MAME 0.225 (please see the original post of this thread for the download link).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on October 01, 2020, 02:52:23 pm
I updated successfully! thanks again and happy gaming!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: teller on October 09, 2020, 06:14:52 pm
I could see great potential seeing a port of latest MAME on the Nintendo Switch. The Switch uses the Tegra X1 chipset from NVIDIA and would be powerful enough to run more even more modern arcade games. Meanwhile it's possible to run the systems Android (Oreo v8.1) and Linux (Ubuntu LTS 18.04) (see switchroot.org) but as far I know nobody ported the lastest version of MAME yet. I tried to install it on Ubuntu LTS 18.04 but it somehow it won't run.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on October 28, 2020, 08:54:48 pm
Just to let you know the availability of the new disk image file with MAME 0.226 (please see the original post of this thread for the download link).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: _Iz- on October 31, 2020, 12:55:19 pm
Can I use the gpio pins on the pi4 to interface controls with this or will it only accept input from an encoder that emulates a keyboard?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on October 31, 2020, 04:56:55 pm
Can I use the gpio pins on the pi4 to interface controls with this or will it only accept input from an encoder that emulates a keyboard?

Yes, you can definitely use the GPIO pins to hook up an arcade joystick and buttons.

Please refer to:
https://www.crackedconsole.com/2019/03/21/mk_arcade_joystick_rpi/ (https://www.crackedconsole.com/2019/03/21/mk_arcade_joystick_rpi/)
https://www.cuddleburrito.com/blog/2015/5/31/connecting-raspberry-pi-arcade-buttons-to-gpio (https://www.cuddleburrito.com/blog/2015/5/31/connecting-raspberry-pi-arcade-buttons-to-gpio)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on November 02, 2020, 08:45:19 pm
Hi all,

I updated the How-To Guide today to incorporate a new feature:

Now, while in Service Mode:

The pre-built disk image file is not yet updated with this change. I will notify you as soon as it's done.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: mahuti on November 05, 2020, 07:26:45 pm
Quote
Can I use the gpio pins on the pi4 to interface controls with this or will it only accept input from an encoder that emulates a keyboard?

You can. I've done it, but I prefer to use the GPIO for other stuff personally.

This a really cheap encoder that works really well with the pi, and has decent software available to configure the key mapping from the /boot/config.txt
https://www.adafruit.com/product/4518

It also makes it simple to wire a button to power off and on the pi.

Usually I use its bigger brother directly on the pi
https://www.adafruit.com/product/3402

Anyway, you can use the GPIO, it just takes a bit of scripting to make it work. Lots of tutorials out there on that subject.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: mahuti on November 14, 2020, 03:43:39 pm
By the way, I used some of the information in the article to do my last MAME build. While I know a lot of tricks with the Pi, I definitely learned some new ones.

I didn't use the instructions completely. I wanted to automate the build / patching process on mame to work with the Pi4 though, and the instructions work really well for that, but it requires some serious attention to sort out what parts of that article are about compiling a solid version of mame vs all the other stuff that makes the "appliance" part.

In the end, I have a working copy of 225 running on a Pi4. Without overclocking, 225 runs over 99% speed without frameskipping on games like DigDug and Galaga. I just wanted a version of MAME that has the output system that will work with LEDSpicer. I started with MAME v 189 and manually applied the patch changes (since the suggested patch doesn't work on versions that old), but it still chokes at the linking stage after compiling, due to some requirement for X11 that's buried in the MAME code somewhere... I ended up just trying to see if a modern MAME version worked well enough, and 225 was fine.

Anyway, based on my experience, the only thing I'd add to that guide  would be a really obvious subsection that strictly deals with MAME compiling for anyone else that isn't looking for the full appliance experience. I think the automation script for downloading, patching and building MAME is really solid and is really valuable information just by itself.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on November 14, 2020, 08:27:52 pm
Hi mahuti,

Thanks for using the instructions (at least partially) from the How-To Guide. :)

I am glad you were able to get a fully working MAME 0.225 on your Pi 4. By curiosity, what are the new tricks you learned from the guide? ;)

About your suggestion, the thing is that this How-To Guide is all about building a dedicated and optimized system for MAME, nothing less, nothing more. Although there is the steps to build the latest version of MAME optimized for the Pi 4, this How-To Guide is nonetheless broader.

I will add more comments in the mame-update.sh script (witch have a double use: first-time setup of MAME and also build/update it).

Thanks again,

Benoit
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: warty on December 20, 2020, 10:25:44 am
An other noob question from  a Windows user
When I'm in arcademode, how can I switch back to service mode ??
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on December 20, 2020, 01:59:55 pm
An other noob question from  a Windows user
When I'm in arcademode, how can I switch back to service mode ??

Just connect to the IP address of the Pi 4 with PuTTY (a popular Windows SSH client) and start an SSH session. Once logged in, issue the following commands:

Code: [Select]
rw
servicemode
sudo reboot
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: warty on December 23, 2020, 05:47:53 am
ok, thanks for your reply, but what is the default Pi address ?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: warty on December 23, 2020, 06:09:33 am
ok, thanks for your reply, but what is the default Pi address ?
I scanned the network and finally found it at 169.254.148.87
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: ivwshane on January 04, 2021, 10:44:30 pm
So what kind of mame performance are you guys seeing on the pi 4? Does it have cps3 well? As gauge of performance, how does it do on 3d games like blitz or mk4 (I don't expect it to be playable but if it does 10+ frames a second that's pretty good).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 05, 2021, 02:25:46 pm
Just to let you know the availability of the NEW disk image file with MAME 0.227 (please see the original post of this thread for the download link).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: mahuti on January 05, 2021, 04:09:14 pm
Does your compiled version allow the user to skip warnings and nag screens?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: jhummel on January 05, 2021, 09:05:11 pm
Sorry for the total noob question here. I was able to download your image and expand the file system. I'm not able to connect to my wifi however. I know you said that wifi isn't disabled in the image, but it seems like the OS doesn't even find the interface. Trying to set things up with raspi-config gives me a "No wireless interfaces found" message. Is that something I screwed up?

Thanks for all the work
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 06, 2021, 12:04:20 am
Sorry for the total noob question here. I was able to download your image and expand the file system. I'm not able to connect to my wifi however. I know you said that wifi isn't disabled in the image, but it seems like the OS doesn't even find the interface. Trying to set things up with raspi-config gives me a "No wireless interfaces found" message. Is that something I screwed up?

Thanks for all the work

Hi jhummel,

I forgot a little ajustment (in my staging process) when I published the image of 0.227 and it has to do with Wi-Fi.

You will need to reinstall wpasupplicant with the following command and reboot:

Code: [Select]
sudo apt-get install wpasupplicant -y
Sorry for the mistake.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 06, 2021, 12:17:46 am
Does your compiled version allow the user to skip warnings and nag screens?

The "skip_gameinfo" setting is enabled in mame.ini.

Other than that, nag screens will do appear (I did'nt used the build option to disable them).

I noticed with 0.227, the emulator systematically displays "One or more ROMs/CHDs for this machine are incorrect.  The machine may not run correctly." when launching a ROM. Maybe a flag has been forgotten by the devs or something.

Anyway, I worked around this with a copy (and overwrite) of all the .xml files from the hash folder of MAME 0.226 to the hash folder of my MAME 0.227 ans everything is OK (no more nag screen with every single ROMs).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: jhummel on January 06, 2021, 12:01:34 pm

You will need to reinstall wpasupplicant with the following command and reboot:


Unfortunately, I had already ran that. Still no wlan interfaces found. I might just wait for a new image, to see if that fixes my issue. I plugged in the pi  via ethernet, and I, unfortunately, wasn't able to get Mame to start up either. Running the mame-launcher.sh script with the verbose flag in service mode showed:

Code: [Select]

The path /dev/dri/ cannot be opened or is not available
Could not initialize SDL kmsdrm not available


Looking into that error. I found some topics about building SDL that I'll try later. Just wanted to bring it up, in case it was something misconfigured in the image.


Sorry for the mistake.


Not a problem, thanks again for all the work on this.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 06, 2021, 12:10:37 pm
Hi jhummel,

Thanks for these informations. I will post an updated image with the Wi-Fi functionnal, as well as the problem related to the /dev/dri.

For this problem, maybe you can execute this command to fix (meanwhile):

Code: [Select]
sudo usermod -a -G render pi
Stay tuned for the updated image.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 06, 2021, 03:25:08 pm
Hi all,

I just uploaded a NEW updated and fixed version of the MAME 0.227 image file with working Wi-Fi and accelerated video (devices under /dev/dri).

Thanks and I apologize for the inconvenience.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: jhummel on January 06, 2021, 08:45:39 pm
Is there a new link? I think the link on your first post is still pointed at the old image?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 06, 2021, 09:22:19 pm
Is there a new link? I think the link on your first post is still pointed at the old image?

I double-checked the link and it's the new one, pointing to the new version of the fixed image file.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: jhummel on January 06, 2021, 09:28:10 pm
Actually, I guess I can tell it's a new image. It looks like it boots into arcade mode initially now instead of service mode. Unfortunately, I'm getting the same error with no wireless interface and the path /dev/dri not being available.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 06, 2021, 10:04:00 pm
Actually, I guess I can tell it's a new image. It looks like it boots into arcade mode initially now instead of service mode. Unfortunately, I'm getting the same error with no wireless interface and the path /dev/dri not being available.

 :o

I don't understand, I carefully tested the new image before publishing it.

Could you execute this command and send me the output, please?

Code: [Select]
ls -la /lib/modules/$(uname -r)
If the ls command returns no files, you could execute this command to solve the problem:

Code: [Select]
sudo rpi-update stable
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: jhummel on January 06, 2021, 11:07:32 pm

If the ls command returns no files, you could execute this command to solve the problem:


rpi-update solved it! There wasn't any files in the /lib/modules directory before. Afterwards, I was able to config wireless and start Mame. Thanks!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 06, 2021, 11:30:54 pm

If the ls command returns no files, you could execute this command to solve the problem:


rpi-update solved it! There wasn't any files in the /lib/modules directory before. Afterwards, I was able to config wireless and start Mame. Thanks!

Glad to know it now works beautifully.

This has given me the opportunity to spot a little bug in my staging script that I now fixed for the next image files. Thanks for your feedback!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: fgh on January 10, 2021, 10:16:11 pm
Thanks for doing this! I’ve been trying to run super sprint but getting 40-45% performance with the .206 version in the rpi os package manager. Will try your image tomorrow!

Do you know if older builds like .139 (‘mame2010’ from libretro) can be compiled for pi4 on current rpi os?
It should be a bit faster, and still have the layout system that I want for my cab.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: fgh on January 11, 2021, 08:49:23 am
I tried the image now, great work!!
(And of course, ssprint now flies)

The thing is though - I've made a python front-end I wanted to use on my next dual monitor cabinet (like my present cab, attached, but pi based and with three super sprint wheels).
But it uses the tkinter python module for the images, and tkinter requires a window manager installed.. (Doesn't need a full desktop interface)

I'm a linux (and python) n00b, and would like to avoid redoing the front-end if possible.
Can I install X11 on top of your image without f*cking anything up?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: mahuti on January 11, 2021, 10:03:54 am
You could recreate the same thing pretty easily in AttractMode
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 11, 2021, 10:09:58 am
I tried the image now, great work!!
(And of course, ssprint now flies)

The thing is though - I've made a python front-end I wanted to use on my next dual monitor cabinet (like my present cab, attached, but pi based and with three super sprint wheels).
But it uses the tkinter python module for the images, and tkinter requires a window manager installed.. (Doesn't need a full desktop interface)

I'm a linux (and python) n00b, and would like to avoid redoing the front-end if possible.
Can I install X11 on top of your image without f*cking anything up?

Glad to know that your rom Super Sprint is running at full speed. :)

If you install X11, I think it will break some things, unfortunately. I specifically choose to not install it for the best performance/resource consumption ratio. MAME is compiled to exclusively use SDL2 for graphics, not X11.

You would need a python module for usig SDL2 (like pySDL2) or try to compile/build (or configure) tkinter to use SDL2.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: SirRey on January 11, 2021, 01:01:41 pm
Hey, have been using RetroPi for so long having to get back to the basics with just MAME. 

I have a USB Arcade Stick that is recognized when I run lsusb -t.  When in a game and hit Tab to set up the stick and buttons it doesn't recognize any input.  Not sure what I'm doing wrong, are there instructions on setting up a usb Arcade Stick?

Appreciate the Prebuilt image, was originally going through your instructions and compiling MAME.  Seems you have written several scripts on this image that weren't part of your instructions on compiling everything from source.

Thanks
Ray
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 11, 2021, 02:35:45 pm
Hey, have been using RetroPi for so long having to get back to the basics with just MAME. 

I have a USB Arcade Stick that is recognized when I run lsusb -t.  When in a game and hit Tab to set up the stick and buttons it doesn't recognize any input.  Not sure what I'm doing wrong, are there instructions on setting up a usb Arcade Stick?

Appreciate the Prebuilt image, was originally going through your instructions and compiling MAME.  Seems you have written several scripts on this image that weren't part of your instructions on compiling everything from source.

Thanks
Ray

Hi Ray,

If you are using an old image file, the launcher script for MAME was using the -nojoy command-line argument. Just remove it, if present.

If you are using an X-Arcade joystick, you could tell MAME to use the configuration file for this joystick by editing /data/ini/mame.ini:

Code: [Select]
ctrlr        xarcade
You are correct, I added a couple of weeks ago a bash script to automate the steps to build/compile MAME from source code.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: fgh on January 11, 2021, 04:51:54 pm
You could recreate the same thing pretty easily in AttractMode

Thanks. I've never used it, but I see it can use two monitors..
Making my own frontend  has been fun though, so I'll put in some more effort before giving up on that.
(I'm only running a few top down racers, like ssprint and super off road, so attract mode feels like overkill as well)

I tried the image now, great work!!
(And of course, ssprint now flies)

The thing is though - I've made a python front-end I wanted to use on my next dual monitor cabinet (like my present cab, attached, but pi based and with three super sprint wheels).
But it uses the tkinter python module for the images, and tkinter requires a window manager installed.. (Doesn't need a full desktop interface)

I'm a linux (and python) n00b, and would like to avoid redoing the front-end if possible.
Can I install X11 on top of your image without f*cking anything up?

Glad to know that your rom Super Sprint is running at full speed. :)

If you install X11, I think it will break some things, unfortunately. I specifically choose to not install it for the best performance/resource consumption ratio. MAME is compiled to exclusively use SDL2 for graphics, not X11.

You would need a python module for usig SDL2 (like pySDL2) or try to compile/build (or configure) tkinter to use SDL2.

Ok, too bad..
It seems the PyGame module (SDL based) can be set up to use the linux framebuffer directly.
Guess I'll have a look at that then :)
Thanks for your help!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 11, 2021, 07:27:08 pm
Quote from: fgh
Ok, too bad..
It seems the PyGame module (SDL based) can be set up to use the linux framebuffer directly.
Guess I'll have a look at that then :)
Thanks for your help!

I'm glad to help. :) I would be curious to see your final python SDL frontend, once completed and integrated.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: fgh on January 12, 2021, 05:35:42 pm
I’ll let you know when (if?) I finish it!

But it’s super simple, just reads my very short game list (top five or so ssprint type games), lets you press left/right to swap the two preview images (top and bottom monitor), and starts the game. Not intended for anyone else, really :)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 12, 2021, 07:36:48 pm
I’ll let you know when (if?) I finish it!

But it’s super simple, just reads my very short game list (top five or so ssprint type games), lets you press left/right to swap the two preview images (top and bottom monitor), and starts the game. Not intended for anyone else, really :)

Oh well, okay then. :)

Happy arcade gaming!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: SirRey on January 25, 2021, 04:10:55 pm
so you have put several shell scripts in the home directory.  Can you create a read.me file on what they do and how to run them.  I know expand-data-partition.sh expands the /data partition. 

Thanks
Ray
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: SirRey on January 26, 2021, 04:34:50 pm
FYI tried to update to MAME 228 today via your script and it threw a error and failed.  I've attached the full output as well.

Done. Generated 384/384 projects.
Creating ../../../../linux_gcc/bin/x32/Release
Precompiling src/emu/emu.h...
g++: error: unrecognized command line option ‘-m32’; did you mean ‘-mbe32’?
g++: error: unrecognized command line option ‘-m32’; did you mean ‘-mbe32’?
make[2]: *** [precompile.make:317: ../../../../linux_gcc/obj/x32/Release/emu.h.gch] Error 1
make[1]: *** [Makefile:88: precompile] Error 2
make: *** [makefile:1389: linux_x86] Error 2
Build time took: 0h 6m 37s.
-----------------------------------------------------------------------------------
Build FAILED.
----------------------------------------------------------------------------------
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 26, 2021, 09:53:46 pm
I don't know why, but to fix the build error with MAME 0.228, I had to specify the target OS as Linux in $MAKEOPTS.

Code: [Select]
nano mame-updater.sh
Go to the line #10 and insert this in the value of MAKEOPTS variable assignment:

Code: [Select]
MAKEOPTS='TARGETOS=linux [...]
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: SirRey on January 27, 2021, 10:15:57 am
Made the change and it seems to have fixed it,  currently compiling.

Thanks!
Ray
 
I don't know why, but to fix the build error with MAME 0.228, I had to specify the target OS as Linux in $MAKEOPTS.

Code: [Select]
nano mame-updater.sh
Go to the line #10 and insert this in the value of MAKEOPTS variable assignment:

Code: [Select]
MAKEOPTS='TARGETOS=linux [...]
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 31, 2021, 05:15:56 pm
Just to let you know the availability of the NEW disk image file with MAME 0.228 (please see the original post of this thread for the download link).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: SirRey on January 31, 2021, 09:57:07 pm
Just flashed the 0228 image.  Thanks for the README.txt file :)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: simon0331 on February 09, 2021, 02:43:26 am
COOL! Its a very interesting project! Thanks! And, here`s my noobs problem: is it possible that I can link the roms folder to the same name folder in external usb drive? Then I can easily manage rom files.  ;D
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on February 09, 2021, 11:48:31 pm
COOL! Its a very interesting project! Thanks! And, here`s my noobs problem: is it possible that I can link the roms folder to the same name folder in external usb drive? Then I can easily manage rom files.  ;D

Sure, to use a different ROMs folder, just update the symbolic link in ~/.mame folder.

So for example, if your USB drive is mounted to /media/My-USB-Drive, just type the following commands (while in Service mode and read/write mode):

Code: [Select]
rm ~/.mame/roms

# If the ROMs .zip files are at the root, type:
ln -s /media/My-USB-Drive ~/.mame/roms

# If the ROMs .zip files are in a folder, for example roms, type:
ln -s /media/My-USB-Drive/roms ~/.mame/roms

sudo reboot
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: simon0331 on February 12, 2021, 09:52:51 pm
Thanks for your help!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: 2012 on February 22, 2021, 03:31:31 am
I'm very thankful for your project and instructional documentation! I don't have a 4B yet, but when there is time for my next project I will definitely look at this.

Has anyone tried benchmarking with this setup? Do you get significantly improved results compared to those linked below?

Relevant links
Benchmarking toolset: https://github.com/PeterBortas/mame-tools
Benchmarking results: http://mame-test.lysator.liu.se/bench/
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: mahuti on February 23, 2021, 10:20:05 pm
I haven't done benchmarking, but the speed difference  is noticeable.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Retrolou on February 24, 2021, 01:31:53 am
Is there an image that can be run on usb or ssd?  I know there’s an sd card image, but haven’t seen one that can be run on usb or ssd?  Also, all the folders in /data, can they be recreated so we can make the /data folder something like an ext4 filesystem since it's dos right now.  This will make it easier to recapture this image and use tools like pishrink./  If i wanted to wipe out the /data and recreate it as ext4, which folders need to be sym links and which ones need to be actually on /data?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on February 24, 2021, 11:55:45 am
Is there an image that can be run on usb or ssd?  I know there’s an sd card image, but haven’t seen one that can be run on usb or ssd?  Also, all the folders in /data, can they be recreated so we can make the /data folder something like an ext4 filesystem since it's dos right now.  This will make it easier to recapture this image and use tools like pishrink./  If i wanted to wipe out the /data and recreate it as ext4, which folders need to be sym links and which ones need to be actually on /data?

Hi,
Although I did not tested it, technically speaking the SD card image should boot on a SSD, as long as the boot loader on the Pi is able to boot from USB, I see no problem.

Please refer to: https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Retrolou on February 24, 2021, 01:05:34 pm
Yeah i know there is, in the retropie world SSD and USB is heavily used to give additional performance over the sd.  Was just asking if you had already created a pre-made image for USB or SSD, but sounds like no.  What about /data question?  Can that be removed as long as .mame folder has all the same files/structure?  Basically have two filesystems only, boot and root, which will make portability a bit easier.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on February 24, 2021, 01:06:14 pm
Just to let you know the availability of the NEW disk image file with MAME 0.229 (please see the original post of this thread for the download link).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 12, 2021, 10:19:35 am
Yeah i know there is, in the retropie world SSD and USB is heavily used to give additional performance over the sd.  Was just asking if you had already created a pre-made image for USB or SSD, but sounds like no.  What about /data question?  Can that be removed as long as .mame folder has all the same files/structure?  Basically have two filesystems only, boot and root, which will make portability a bit easier.

No, I did not produced a USB-bootable image, sorry (I use the built-in SD-card reader of the Pi for booting).

For your second question about the folders under /data. They can be recreated anywhere. The only thing to take care is to update the symlinks under /home/pi/.mame

You can easily script the dynamic creation of /data folder (see the How-To link in the first post of this topic).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on March 12, 2021, 03:00:22 pm
This looks like an ideal solution to get a dedicated MAME setup up and running cheaply.  Is there any way to add a very simple "front end" to something like this so all you see is a list of games based on what is in the roms folder and a screenshot?  Something simple like THIS (http://idahogaragecade.com/wp-content/uploads/2018/01/ATTRACT_7.jpg) instead of the regular MAME GUI?

Great work here!
 
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 12, 2021, 06:05:07 pm
This looks like an ideal solution to get a dedicated MAME setup up and running cheaply.  Is there any way to add a very simple "front end" to something like this so all you see is a list of games based on what is in the roms folder and a screenshot?  Something simple like THIS (http://idahogaragecade.com/wp-content/uploads/2018/01/ATTRACT_7.jpg) instead of the regular MAME GUI?

Great work here!
 

Yes, definitely. You can use the Attract Mode front-end and use a simple/basic theme.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on March 13, 2021, 11:08:54 am
This looks like an ideal solution to get a dedicated MAME setup up and running cheaply.  Is there any way to add a very simple "front end" to something like this so all you see is a list of games based on what is in the roms folder and a screenshot?  Something simple like THIS (http://idahogaragecade.com/wp-content/uploads/2018/01/ATTRACT_7.jpg) instead of the regular MAME GUI?

Great work here!
 

Yes, definitely. You can use the Attract Mode front-end and use a simple/basic theme.
Wow awesome.  Is there a tutorial somewhere that can walk me through it?  I’ve got a pi4 laying around and I’m going to try to get your image working this weekend if I can...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 13, 2021, 08:09:37 pm
This looks like an ideal solution to get a dedicated MAME setup up and running cheaply.  Is there any way to add a very simple "front end" to something like this so all you see is a list of games based on what is in the roms folder and a screenshot?  Something simple like THIS (http://idahogaragecade.com/wp-content/uploads/2018/01/ATTRACT_7.jpg) instead of the regular MAME GUI?

Great work here!
 

Yes, definitely. You can use the Attract Mode front-end and use a simple/basic theme.
Wow awesome.  Is there a tutorial somewhere that can walk me through it?  I’ve got a pi4 laying around and I’m going to try to get your image working this weekend if I can...

Hi javeryh,

You can build Attract Mode on a Raspberry Pi in following these steps, from the link below:

[EDIT: Updated URL for Raspberry Pi 4]

https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster) (https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster))
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 13, 2021, 09:04:45 pm
This looks like an ideal solution to get a dedicated MAME setup up and running cheaply.  Is there any way to add a very simple "front end" to something like this so all you see is a list of games based on what is in the roms folder and a screenshot?  Something simple like THIS (http://idahogaragecade.com/wp-content/uploads/2018/01/ATTRACT_7.jpg) instead of the regular MAME GUI?

Great work here!
 

Yes, definitely. You can use the Attract Mode front-end and use a simple/basic theme.
Wow awesome.  Is there a tutorial somewhere that can walk me through it?  I’ve got a pi4 laying around and I’m going to try to get your image working this weekend if I can...

Hi javeryh,

You can build Attract Mode on a Raspberry Pi in following these steps, from the link below:

[EDIT: Updated URL for Raspberry Pi 4]

https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster) (https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster))

[EDIT2: The Raspberry Pi 4 steps depends on X11, wich is not available (and not wanted) on my image. Please use this URL:]

https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-(Raspbian-Jessie) (https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-(Raspbian-Jessie))

Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on March 13, 2021, 09:04:52 pm
This looks like an ideal solution to get a dedicated MAME setup up and running cheaply.  Is there any way to add a very simple "front end" to something like this so all you see is a list of games based on what is in the roms folder and a screenshot?  Something simple like THIS (http://idahogaragecade.com/wp-content/uploads/2018/01/ATTRACT_7.jpg) instead of the regular MAME GUI?

Great work here!
 

Yes, definitely. You can use the Attract Mode front-end and use a simple/basic theme.
Wow awesome.  Is there a tutorial somewhere that can walk me through it?  I’ve got a pi4 laying around and I’m going to try to get your image working this weekend if I can...

Hi javeryh,

You can build Attract Mode on a Raspberry Pi in following these steps, from the link below:

[EDIT: Updated URL for Raspberry Pi 4]

https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster) (https://github.com/mickelson/attract/wiki/Compiling-on-the-Raspberry-Pi-4-(Raspbian-Buster))
Thanks for the link!  So all I have to do is get your image working and then follow these Attract Mode instructions?  I’m new to all of this...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: fgh on March 14, 2021, 04:45:34 am
I tried the image now, great work!!
(And of course, ssprint now flies)

The thing is though - I've made a python front-end I wanted to use on my next dual monitor cabinet (like my present cab, attached, but pi based and with three super sprint wheels).
But it uses the tkinter python module for the images, and tkinter requires a window manager installed.. (Doesn't need a full desktop interface)

I'm a linux (and python) n00b, and would like to avoid redoing the front-end if possible.
Can I install X11 on top of your image without f*cking anything up?

Glad to know that your rom Super Sprint is running at full speed. :)

If you install X11, I think it will break some things, unfortunately. I specifically choose to not install it for the best performance/resource consumption ratio. MAME is compiled to exclusively use SDL2 for graphics, not X11.

You would need a python module for usig SDL2 (like pySDL2) or try to compile/build (or configure) tkinter to use SDL2.

Hey there Bbegin,
AFAIK, it’s possible to run X11 and still have programs using SDL2.
Would compiling latest mame WITH SDL2 GRAPHICS for a standard rpi os install (with X11) be a lot if work?
It could go in the repository as well, and probably be appreciated by a lot of people, as the one in there is old and very slow.

(It seems it’s not easy to handle two monitors in python with SDL, so I’m stuck again, haha)

Best regards,
Frode
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 15, 2021, 04:48:04 pm
Quote from: javeryh
Thanks for the link!  So all I have to do is get your image working and then follow these Attract Mode instructions?  I’m new to all of this...

I made several build tests with Attract Mode on the image I provide and unfortunately, the SFML-pi layer is not ready for KMS/DRM without X11 on a Raspberry Pi 4 (it works on Pi 0-3, thought).

You are better to try the Pegasus front-end (tested successfully on the image I provide), but is a bit harder to configure:

https://pegasus-frontend.org/
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Ond on March 15, 2021, 07:14:19 pm
Moving beyond RetroPie is the next evolutionary step in using Raspberry Pi as a platform IMO.  Great work going on here bbegin!  I'm going to have a go at this solution and test it for performance/usability.   :cheers:
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 15, 2021, 08:29:28 pm
Quote from: fgh
Hey there Bbegin,
AFAIK, it’s possible to run X11 and still have programs using SDL2.
Would compiling latest mame WITH SDL2 GRAPHICS for a standard rpi os install (with X11) be a lot if work?
It could go in the repository as well, and probably be appreciated by a lot of people, as the one in there is old and very slow.

(It seems it’s not easy to handle two monitors in python with SDL, so I’m stuck again, haha)

Best regards,
Frode

Hi Frode,

For MAME to work both with SDL2 and X11, I would build MAME with these options removed from the make command-line:

Code: [Select]
NO_X11=1 NO_USE_XINPUT=1 NO_USE_XINPUT_WII_LIGHTGUN_HACK=1 NO_OPENGL=1 NO_BGFX=1
Good luck,

Benoit
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 15, 2021, 08:32:06 pm
Moving beyond RetroPie is the next evolutionary step in using Raspberry Pi as a platform IMO.  Great work going on here bbegin!  I'm going to have a go at this solution and test it for performance/usability.   :cheers:

I think it could be nice if you post your comments/appreciation and performance tests (versus RetroPie), thanks!  :cheers:
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on March 16, 2021, 03:15:37 pm
Is there any way to enable wifi on first boot?  I cannot SSH into the pi because I do not have an Ethernet cable to plug in.  I got the image running and expanded to fill my SD card so that's a start...

Thanks!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Ond on March 16, 2021, 04:21:46 pm
The image should support the pi 4 wifi on boot.  I don't yet have a pi 4 or the image so I don't know what features are enabled.  Can you access the command line shell on a monitor?  If so type ifconfig to reveal your networking capabilities.  wlan0 is the wireless status.  A quick way to gain access via ssh is to plug it straight into your house modems network port/s that provides connection to your ISP.  That will enable network connectivity until you get WiFi working.  Needs a network cable of course.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 16, 2021, 04:34:25 pm
Is there any way to enable wifi on first boot?  I cannot SSH into the pi because I do not have an Ethernet cable to plug in.  I got the image running and expanded to fill my SD card so that's a start...

Thanks!

The Wi-Fi interface is enabled on the image provided. However, you should configure it according to your Access Point's SSID and associated security settings.

You can do this offline from another computer, just plug the SD card in a reader and access the "boot" partition and follow these steps:

https://linuxhint.com/rasperberry_pi_wifi_wpa_supplicant/
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on March 16, 2021, 05:45:21 pm
Is there any way to enable wifi on first boot?  I cannot SSH into the pi because I do not have an Ethernet cable to plug in.  I got the image running and expanded to fill my SD card so that's a start...

Thanks!

The Wi-Fi interface is enabled on the image provided. However, you should configure it according to your Access Point's SSID and associated security settings.

You can do this offline from another computer, just plug the SD card in a reader and access the "boot" partition and follow these steps:

https://linuxhint.com/rasperberry_pi_wifi_wpa_supplicant/

Wow thanks.  This worked.  I can now access command line via Putty over WiFi.  Next, I need to figure out how to transfer roms to the SD card and then figure out how to get the front end layered overtop of MAME.  Right now I'm kind of stuck on pi@arcade(ro):~$ at the command prompt.  I found the README.txt by typing nano README.txt at the command prompt and it says to add roms via Samba share but I have no idea what that means so off to Google!

I've already learned a lot just by messing around today and I'm having fun.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Ond on March 16, 2021, 05:51:58 pm
Is there any way to enable wifi on first boot?  I cannot SSH into the pi because I do not have an Ethernet cable to plug in.  I got the image running and expanded to fill my SD card so that's a start...

Thanks!

The Wi-Fi interface is enabled on the image provided. However, you should configure it according to your Access Point's SSID and associated security settings.

You can do this offline from another computer, just plug the SD card in a reader and access the "boot" partition and follow these steps:

https://linuxhint.com/rasperberry_pi_wifi_wpa_supplicant/

Wow thanks.  This worked.  I can now access command line via Putty over WiFi.  Next, I need to figure out how to transfer roms to the SD card and then figure out how to get the front end layered overtop of MAME.  Right now I'm kind of stuck on pi@arcade(ro):~$ at the command prompt.  I found the README.txt by typing nano README.txt at the command prompt and it says to add roms via Samba share but I have no idea what that means so off to Google!

I've already learned a lot just by messing around today and I'm having fun.

Great!  Check out Filezila, super easy drag and drop ftp for transferring files.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on March 16, 2021, 09:25:13 pm
Great!  Check out Filezila, super easy drag and drop ftp for transferring files.

Thanks.  I’ll check it out tomorrow while I’m “working”.  I’m just trying to get my arms around the basics at this point.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: DaOld Man on March 19, 2021, 10:33:12 am
I use Winscp. Really simple. You can drag and drop.

https://winscp.net/eng/index.php

But you will need a connection to the pi. So may not have helped you in your original problem.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Gilrock on March 19, 2021, 11:26:09 am
Yeah I used WinSCP as well.  I like FilleZilla but didn't realize it would work I was just following online instruction for RetroPie.  Right now its the most convenient game system for me to access I just plugged in a small wireless USB dongle and I access the Pi from my main PC.  I use WinSCP for file transfers and Putty for command line access.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: nitrogen_widget on March 21, 2021, 11:07:49 am
getting mame to compile on a 64 bit OS on a pi4 with only 2gb of ram and 2 gb of swap file will be harder than i thought so i'll just not clutter this up and post a new thread when i get something that works and I can compare performance.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on March 31, 2021, 09:41:47 pm
Just to let you know the availability of the NEW disk image file with MAME 0.230 (please see the original post of this thread for the download link).  :cheers:
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: SunExerion on April 05, 2021, 08:53:27 am
First thx a lot for sharing the pre built image of your great work!  :applaud:

I have few questions: is it possible to enable scanlines (a filter) and rotate the screen?.

Which other filters are available in your compiled executable?.

I think i have to edit mame.ini while in service mode can you point me toward a dedicated tutorial?

Again thx a lot
See you
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 05, 2021, 05:25:07 pm
First thx a lot for sharing the pre built image of your great work!  :applaud:

I have few questions: is it possible to enable scanlines (a filter) and rotate the screen?.

Hi SunExerion, thanks very much for your kind words!

Yes, it is possible to enable a scanlines effect.

Just edit mame.ini and set the effect configuration option:

Code: [Select]
effect                    scanlines

To rotate the screen, just follow the steps outlined at the section named (from the How-To Guide I made available):

[Optional] Screen rotation 90 degrees

https://translate.google.ca/translate?hl=fr&tab=wT&sl=fr&tl=en&u=https%3A%2F%2Fgist.github.com%2Fsonicprod%2Ff5a7bb10fb9ed1cc5124766831e120c4

Which other filters are available in your compiled executable?.

You can use basically every filter file from the /data/artwork path. Just put the filename (without the extension) in mame.ini at the effect configuration option.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 11, 2021, 05:09:53 pm
OK, I downloaded the new image for .230 and booted up my pi.  I logged in as user "pi" and password "raspberry" and got a message that SSH was enabled and the default password has not been changed.  Right now I am stuck on the pi@arcade(ro):~$ command prompt and not sure what to do next. 

I enabled (sudo systemctl enable ssh) and started (sudo systemctl start ssh) and those commands seemed to work.

If I type "hostname -i" it returns 127.0.1.1 but I cannot use this to connect via putty or WinSCP (after following the instructions to enable SSH above... which worked on the .229 image).  I get an error saying "Network error: Connection to "127.0.1.1" refused."

EDIT: OK, I'm in.  I was typing "-i" to get the IP address and I should have been typing "-I" instead.  So it looks like I can SSH into the pi.  I'm going to try and drop some roms into the roms folder and then type "arcademode" at the command prompt and see if it works...

EDIT 2:  I dropped a few roms into the "roms" folder but they do not appear as "available".  I changed to read/write, moved the roms, changed back to read only and then typed "arcademode" at the command prompt.  The pi rebooted into the MAME GUI but there were no games "available".  I am using MAME .217 roms but I only tried moving Frogger, Pac-Man, Donkey Kong and Ms. Pac-Man so at least one of them should have shown up.. right?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 11, 2021, 06:14:10 pm
EDIT: OK, I'm in.  I was typing "-i" to get the IP address and I should have been typing "-I" instead.  So it looks like I can SSH into the pi.  I'm going to try and drop some roms into the roms folder and then type "arcademode" at the command prompt and see if it works...

You should execute the script named expand-data-partition.sh to expand the /data partition to use all the free space on your SD card.

EDIT 2:  I dropped a few roms into the "roms" folder but they do not appear as "available".  I changed to read/write, moved the roms, changed back to read only and then typed "arcademode" at the command prompt.  The pi rebooted into the MAME GUI but there were no games "available".  I am using MAME .217 roms but I only tried moving Frogger, Pac-Man, Donkey Kong and Ms. Pac-Man so at least one of them should have shown up.. right?

As soon as you put roms in /data/roms folder (while in Service mode), the system should automatically download the related graphics (screen snapshots, etc.).

You are correct, MAME should see the roms and display the game name under the Available filter. You could try to add some more roms, just to make sure that the issue persist.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 11, 2021, 07:14:53 pm
You should execute the script named expand-data-partition.sh to expand the /data partition to use all the free space on your SD card.

I did this successfully - I have 109 GB on a 128GB card to work with.

As soon as you put roms in /data/roms folder (while in Service mode), the system should automatically download the related graphics (screen snapshots, etc.).

You are correct, MAME should see the roms and display the game name under the Available filter. You could try to add some more roms, just to make sure that the issue persist.

OK here is where I might have done something wrong.  I didn't really pay attention to where I put the roms other than in the rom folder under mame .230 like you would on a PC but maybe I missed something.  I do not remember going into a data folder... Next time I boot it up I'll see if that changes things.

Thanks!

EDIT: So I can't even get the pi to boot any more.  I selected Exit from the menu and shut down the pi about 2 hours ago.  But when I turned the pi back on (by unplugging it and plugging it back in) I saw the MAME logo for a split second and then it turned off and my monitor is saying no signal.  I can't SSH in either.  Hmmm...

Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 11, 2021, 08:53:46 pm
You should execute the script named expand-data-partition.sh to expand the /data partition to use all the free space on your SD card.

I did this successfully - I have 109 GB on a 128GB card to work with.

As soon as you put roms in /data/roms folder (while in Service mode), the system should automatically download the related graphics (screen snapshots, etc.).

You are correct, MAME should see the roms and display the game name under the Available filter. You could try to add some more roms, just to make sure that the issue persist.

OK here is where I might have done something wrong.  I didn't really pay attention to where I put the roms other than in the rom folder under mame .230 like you would on a PC but maybe I missed something.  I do not remember going into a data folder... Next time I boot it up I'll see if that changes things.

Thanks!

EDIT: So I can't even get the pi to boot any more.  I selected Exit from the menu and shut down the pi about 2 hours ago.  But when I turned the pi back on (by unplugging it and plugging it back in) I saw the MAME logo for a split second and then it turned off and my monitor is saying no signal.  I can't SSH in either.  Hmmm...

Hi, just unplug the Pi and plug it again. It should then boot normally. For an unknown reason, the system boot and immediately shutdown. It may be related to a race condition in the systemd units that start MAME and shutdown unit that is activated upon a clean exit of MAME.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 11, 2021, 09:23:19 pm
Hi, just unplug the Pi and plug it again. It should then boot normally. For an unknown reason, the system boot and immediately shutdown. It may be related to a race condition in the systemd units that start MAME and shutdown unit that is activated upon a clean exit of MAME.

Thanks - After a few tries it booted back up again and I was able to SSH in... I moved the roms to the data/roms folder and rebooted in arcade mode.  The games I added are listed and they work but just barely.  They all "work" but the frame rate has to be like 10fps.  Everything is moving in super slow motion.

After reading through the thread on github someone else had the same problem I think I'm having.  I am outputting to a 4K display.  Apparently to force 1080p, I have to set these values ​​in /boot/config.txt:

  hdmi_group=1
  hdmi_mode=16

But no matter what I do, I am not allowed to save changes.  I change to servicemode and change to read/write and nothing.  I always don't have permission to edit /boot/config.txt

I don't have any other HDMI monitors in my house to test with!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 11, 2021, 10:09:18 pm
After reading through the thread on github someone else had the same problem I think I'm having.  I am outputting to a 4K display.  Apparently to force 1080p, I have to set these values ​​in /boot/config.txt:

  hdmi_group=1
  hdmi_mode=16

But no matter what I do, I am not allowed to save changes.  I change to servicemode and change to read/write and nothing.  I always don't have permission to edit /boot/config.txt

I don't have any other HDMI monitors in my house to test with!

Yes, with a 4K resolution, you will get very poor performance, that's a known issue. You should force your Pi to use 1080p.

You should always edit /boot/config.txt with the prefix sudo (while in read/write mode), so:

Code: [Select]
rw
sudo nano /boot/config.txt

To force 1080p resolution on your 4K TV, in addition to these 2 lines in config.txt:

Code: [Select]
hdmi_group=1
hdmi_mode=16

You may also add (if necessary) this line:

Code: [Select]
hdmi_force_mode=1
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 12, 2021, 10:04:47 am
After reading through the thread on github someone else had the same problem I think I'm having.  I am outputting to a 4K display.  Apparently to force 1080p, I have to set these values ​​in /boot/config.txt:

  hdmi_group=1
  hdmi_mode=16

But no matter what I do, I am not allowed to save changes.  I change to servicemode and change to read/write and nothing.  I always don't have permission to edit /boot/config.txt

I don't have any other HDMI monitors in my house to test with!

Yes, with a 4K resolution, you will get very poor performance, that's a known issue. You should force your Pi to use 1080p.

You should always edit /boot/config.txt with the prefix sudo (while in read/write mode), so:

Code: [Select]
rw
sudo nano /boot/config.txt

To force 1080p resolution on your 4K TV, in addition to these 2 lines in config.txt:

Code: [Select]
hdmi_group=1
hdmi_mode=16

You may also add (if necessary) this line:

Code: [Select]
hdmi_force_mode=1

Got it - thanks!  I did not need hdmi_force_mode=1 to get it to work.  I tested Donkey Kong, DK Jr., Eyes, Frogger, Pac-Man, Ms. Pac-Man and Jr. Pac-man and they all work.  There is a small audio glitch when the games first start up (except for DK and Eyes) but I have a feeling that is because of the monitor frame rate not being right for the game.  Ultimately, I'll be connecting this to a regular old LCD via VGA.  Hopefully I'll be able to force native resolutions somehow but that's a ways off.

Next up is figuring out how to layer a front end on top of MAME... no idea how I'm going to sort that out LOL
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 12, 2021, 11:30:56 am
Next up is figuring out how to layer a front end on top of MAME... no idea how I'm going to sort that out LOL

For the front-end, you can use AdvanceMENU or AdvMenuPLUS (a fork of AdvanceMENU with theming support).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 12, 2021, 01:00:11 pm
Next up is figuring out how to layer a front end on top of MAME... no idea how I'm going to sort that out LOL

For the front-end, you can use AdvanceMENU or AdvMenuPLUS (a fork of AdvanceMENU with theming support).

Thanks.  I will read up on both today.  How simple is this?  I'm used to front ends where you install the program and then just point it at the MAME.exe.  Probably not that easy if I had to guess...  I really just want to boot straight to a simple game list with nothing else but your MAME image to run the games...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 12, 2021, 01:49:08 pm
To run AdvanceMENU as a frond-end, you simply have to download the .deb, extract the advmenu binary from it (open with an Archive Manager).

Download the .deb for Raspberry Pi:
https://github.com/amadvance/advancemame/releases/download/v3.9/advancemame_3.9-1_armhf.deb

Copy the advmenu binary to the Pi (with scp/WinSCP).

The documentation about AdvanceMENU is there:
https://www.advancemame.it/doc-advmenu

Setup AdvanceMENU (be sure to refer to the MAME binary with $MAMEBINPATH/mame) and make it replace the MAME binary at startup/boot-up (just edit /home/pi/mame-launcher.sh script).

I may publish a pre-built version of the SD image file with AdvanceMENU as the front-end and ready to use.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 12, 2021, 03:26:51 pm
To run AdvanceMENU as a frond-end, you simply have to download the .deb, extract the advmenu binary from it (open with an Archive Manager).

Download the .deb for Raspberry Pi:
https://github.com/amadvance/advancemame/releases/download/v3.9/advancemame_3.9-1_armhf.deb

Copy the advmenu binary to the Pi (with scp/WinSCP).

The documentation about AdvanceMENU is there:
https://www.advancemame.it/doc-advmenu

Setup AdvanceMENU (be sure to refer to the MAME binary with $MAMEBINPATH/mame) and make it replace the MAME binary at startup/boot-up (just edit /home/pi/mame-launcher.sh script).

Thanks for the help - really appreciate it.  Seems easy enough but I am not at all familiar with the linux environment so even copying and opening files is difficult for me right now.  I'll give it a shot - I definitely want to learn.

I may publish a pre-built version of the SD image file with AdvanceMENU as the front-end and ready to use.

Now this would be awesome!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 12, 2021, 09:48:05 pm
@javeryh:

I made several tests tonight with AdvanceMENU and I was able to run it successfully on the image I provide.

Unfortunately, I noticed that (for an unknown reason at this time), the emulation speed is considerably reduced. ROMs that were running at 100% speed now run at around 80%, wich is obviously unacceptable...

It reminded me as well that the user interface is aging and not so modern/actual. There is no theming support, so the hardcoded layouts are not customizable (except text/background colors).

I will wait for the sfml-pi component to work correctly with KMS/DRM on the Pi 4 to recommend the Attract Mode front-end. Once ready, I will provide a pre-configured image with Attract Mode.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 13, 2021, 09:22:24 am
@javeryh:

I made several tests tonight with AdvanceMENU and I was able to run it successfully on the image I provide.

Unfortunately, I noticed that (for an unknown reason at this time), the emulation speed is considerably reduced. ROMs that were running at 100% speed now run at around 80%, wich is obviously unacceptable...

It reminded me as well that the user interface is aging and not so modern/actual. There is no theming support, so the hardcoded layouts are not customizable (except text/background colors).

I will wait for the sfml-pi component to work correctly with KMS/DRM on the Pi 4 to recommend the Attract Mode front-end. Once ready, I will provide a pre-configured image with Attract Mode.

That's good to know -- thanks for trying.  I really think you've got something here with an image that runs recent MAME and doesn't have any other nonsense.  I'm going to keep playing with the pi and maybe I'll learn a thing or two...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 14, 2021, 04:23:04 pm
I got 2 very good news  :cheers:

First, I did some more testing yesterday and found the reason why MAME was slower under AdvanceMENU. It has nothing to do with AdvanceMENU. It is caused by the way I was calling the MAME binary. In the script file mame-launcher.sh, I set these environment variables:

Code: [Select]
export SDL_VIDEODRIVER=kmsdrm
export SDL_RENDER_DRIVER=opengles2
export SDL_RENDER_VSYNC=1
export SDL_GRAB_KEYBOARD=1
export SDL_VIDEO_GLES2=1

I was calling the MAME binary directly, so these variables were not set. I will fix that (I will move these variables assignments to /etc/environment, wich is executed at boot time).

Secondly, I successfully built the latest version of Attract Mode (and its dependency, sfml-pi). Attract Mode works nicely and perflectly in KMS/DRM mode.

As a result, I will publish a new version of the image wich will include AdvanceMENU and Attract Mode. The image will boot to AdvanceMENU, but Attract Mode will be selectable with just a quick edit of a configuration file.

Stay tuned  :cheers:
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 16, 2021, 09:57:32 am
I got 2 very good news  :cheers:

First, I did some more testing yesterday and found the reason why MAME was slower under AdvanceMENU. It has nothing to do with AdvanceMENU. It is caused by the way I was calling the MAME binary. In the script file mame-launcher.sh, I set these environment variables:

Code: [Select]
export SDL_VIDEODRIVER=kmsdrm
export SDL_RENDER_DRIVER=opengles2
export SDL_RENDER_VSYNC=1
export SDL_GRAB_KEYBOARD=1
export SDL_VIDEO_GLES2=1

I was calling the MAME binary directly, so these variables were not set. I will fix that (I will move these variables assignments to /etc/environment, wich is executed at boot time).

Secondly, I successfully built the latest version of Attract Mode (and its dependency, sfml-pi). Attract Mode works nicely and perflectly in KMS/DRM mode.

As a result, I will publish a new version of the image wich will include AdvanceMENU and Attract Mode. The image will boot to AdvanceMENU, but Attract Mode will be selectable with just a quick edit of a configuration file.

Stay tuned  :cheers:

This is VERY exciting news!  Can't wait to see the end result.   :cheers:
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: exonaax on April 19, 2021, 07:44:14 am
Hi,

First thank you very much for all the work you have done on this. It is amazing and a huge donnation to the community.  Realy appreciated and the best in return we can do, it is to contribute with you.

As far as understand, the PI 400 use the same architecture as the PI 4 or at leat organised arround the same CPU/GPU.

Do you think that the PI 400 will support the build image you posted in header of this topic?

Thank you.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 19, 2021, 10:25:42 am
Hi,

First thank you very much for all the work you have done on this. It is amazing and a huge donnation to the community.  Realy appreciated and the best in return we can do, it is to contribute with you.

As far as understand, the PI 400 use the same architecture as the PI 4 or at leat organised arround the same CPU/GPU.

Do you think that the PI 400 will support the build image you posted in header of this topic?

Thank you.

Thanks for your appreciation, it touches me a lot to realize that people like my contribution.

I did not tested the image on a Pi 400, but as it is the same exact hardware as the Pi 4 (chipset, CPU, devices), it should work perfectly.  :)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 24, 2021, 05:28:38 pm
ANNOUNCEMENT :cheers:

Here it is, a first version of the Front-end Edition of the MAME image for Raspberry Pi 4.

You can select the UI/front-end that will start automatically at boot from one of these 3 choices (Arcade Mode):

To select, just type:

Code: [Select]
sudo nano /etc/environment
And ajust the value of the FRONTEND variable (see comment from the file).

Let me know of your appreciation, or if you find any issue.

https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing (https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 24, 2021, 06:55:47 pm
I will be trying to get this to work tomorrow!  I’m psyched - thanks for all of your hard work on this.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 27, 2021, 09:27:28 am
I will be trying to get this to work tomorrow!  I’m psyched - thanks for all of your hard work on this.

Hi javeryh,

I am wondering if you had any chance to test the image (I call it the Front-end Edition) yet?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Grasshopper on April 27, 2021, 10:06:32 am
If you haven't already done so, would it be possible to add an option to make the root filesystem read-only, and overlaid with a RAM disk?

If you do that, then there will be no danger of corrupting the SD card if you cut the power without doing a clean shutdown.

As a starting point, check out the following link:

https://github.com/janztec/empc-arpi-linux-readonly

A few years ago, I applied the above changes to an old Retropie image, and I can confirm it worked.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Grasshopper on April 27, 2021, 10:09:37 am
Please ignore my previous post. I've just re-read the first post in the thread, and see you've already made the filesystem readonly.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 27, 2021, 11:03:02 am
I will be trying to get this to work tomorrow!  I’m psyched - thanks for all of your hard work on this.

Hi javeryh,

I am wondering if you had any chance to test the image (I call it the Front-end Edition) yet?
Not yet!  I downloaded the image but haven’t had a chance to mess around with it yet.  Work has been busy and I haven’t been able to goof off yet this week...  I will post updates once I do (or more likely dumb questions haha)...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: kegga on April 27, 2021, 11:19:22 am
I tried it last night Mame works just fine but when I try and use Attract Mode it launches in vertical mode with just a Mame 1/0 down in the bottom right corner I can hit tab and get into the configuration but kind of stuck after that. Also I don't think your artwork scripts are working I looked at them and you are calling the other scripts from the /home/pi when they are actually in /home/pi/scripts/. I didn't try AdvanceMenu yet.

OK went in and conf file for Attract and generated a list and now I see my games but they will not launch.

Here is what my mame.cfg looks like in /data/attract/emulators/

# Generated by Attract-Mode v2.6.1
#
executable           /home/pi/mame230/mame
args                 [name]
rompath              $HOME/.mame/roms/
romext               .zip;.7z
system               Arcade
info_source          thegamesdb.net
artwork    marquee         $HOME/.mame/marquee
artwork    snap            $HOME/mame/video;$HOME/.mame/snap
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 27, 2021, 05:13:49 pm
I tried it last night Mame works just fine but when I try and use Attract Mode it launches in vertical mode with just a Mame 1/0 down in the bottom right corner I can hit tab and get into the configuration but kind of stuck after that. Also I don't think your artwork scripts are working I looked at them and you are calling the other scripts from the /home/pi when they are actually in /home/pi/scripts/. I didn't try AdvanceMenu yet.

Oh, thanks for the input, I will ajust the artwork scripts with the new paths.

For the rotated screen, I forgot to set enabled to no in this section of /data/attract/attract.cfg :

Code: [Select]
plugin RotationControl
enabled              yes
param                auto_rot 270
param                default_rot 90
param                preserve_aspect_ratio Default


OK went in and conf file for Attract and generated a list and now I see my games but they will not launch.

Here is what my mame.cfg looks like in /data/attract/emulators/

Code: [Select]
# Generated by Attract-Mode v2.6.1
#
executable           /home/pi/mame230/mame
args                 [name]
rompath              $HOME/.mame/roms/
romext               .zip;.7z
system               Arcade
info_source          thegamesdb.net
artwork    marquee         $HOME/.mame/marquee
artwork    snap            $HOME/mame/video;$HOME/.mame/snap

Your games will not launch, because of the incorrect path of the MAME binary (mame230, instead of mame0230). Use the path with the symlink:

Code: [Select]
executable           /home/pi/mame/mame
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: kegga on April 27, 2021, 06:30:57 pm
OK games are launching, now I need to get attract looking nice. This is great thanks for all the work you have put into this.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 28, 2021, 09:42:09 pm
Just to let you know that I now fixed the incorrect paths from the scripts provided in the image file.

The new/updated download link is:

https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing (https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing)
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 29, 2021, 04:53:21 pm
Just to let you know that I now fixed the incorrect paths from the scripts provided in the image file.

The new/updated download link is:

https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing (https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing)

Downloaded... here goes nothing!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 29, 2021, 05:40:05 pm
Just to let you know that I now fixed the incorrect paths from the scripts provided in the image file.

The new/updated download link is:

https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing (https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing)

Downloaded... here goes nothing!

What do you mean?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: Gilrock on April 29, 2021, 05:45:04 pm
Just to let you know that I now fixed the incorrect paths from the scripts provided in the image file.

The new/updated download link is:

https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing (https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing)

Downloaded... here goes nothing!

What do you mean?

"here goes nothing" means "I'm about to try something with fingers crossed"
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on April 29, 2021, 06:16:07 pm
Just to let you know that I now fixed the incorrect paths from the scripts provided in the image file.

The new/updated download link is:

https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing (https://drive.google.com/file/d/1gt3qrtnvEf7N4aBoGVwswhXjEeYLsVzT/view?usp=sharing)

Downloaded... here goes nothing!

What do you mean?
Yeah - like Gilrock said, “Here goes nothing” just means “I’m about to try something unfamiliar and I hope it all goes well!”
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 29, 2021, 06:31:36 pm
Thanks, guys (for the translation)!  :D :D
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on April 30, 2021, 09:58:06 pm
Just to let you know the availability of the NEW disk image file with MAME 0.231 (please see the original post of this thread for the download link).   :cheers:

This image and onwards will include 2 Front-ends: Attract Mode and AdvanceMENU.

To select them, while in Service Mode:

Code: [Select]
sudo nano /etc/environment
And set the FRONTEND variable (see comments from the file).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 04, 2021, 09:54:49 pm
I'm just wondering if you guys had a chance to test drive the new image?
If so, how do you like (or not) the new image?

Thanks in advance for your comments/appreciation.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on May 05, 2021, 07:14:21 am
I'm just wondering if you guys had a chance to test drive the new image?
If so, how do you like (or not) the new image?

Thanks in advance for your comments/appreciation.
I have the image burned, WiFi working, forced 1080p, and now I’m trying to figure out how select the front end.  Should be able to tinker with it more today and I’ll report back.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on May 05, 2021, 04:07:59 pm
I'm just wondering if you guys had a chance to test drive the new image?
If so, how do you like (or not) the new image?

Thanks in advance for your comments/appreciation.
I have the image burned, WiFi working, forced 1080p, and now I’m trying to figure out how select the front end.  Should be able to tinker with it more today and I’ll report back.

I spoke too soon.  I keep getting an error message saying "No wireless interface found" when I'm in the raspi-config menu trying to set up WiFi. 

If I type hostname -I at the command prompt to get the IP address there is none.  I don't get an error but nothing happens.  Is WiFi diasbled somehow with this new image?

EDIT: every time I create the wpa_supplicant.conf file with my WiFi information inside, it gets deleted as soon as I move it over to the pi.  On the memory card connected to my PC it shows and I save it and I've even popped the card in and out of the PC multiple times just to be sure it is still there but when I bring it to the pi and boot up, it is gone.  I cannot figure out why and this wasn't happening with an earlier image I was using.

Also, when I insert the memory card into my PC, it shows the "boot" drive as D:\ but it also shows "Removeable Drive" for E:\ and "Removeable Drive" for F:\ which doesn't seem right either.

Any ideas?

EDIT#2: I connected via ethernet and could find an IP address so I can use WinSCP to move files around.  Weird.  I'd like to figure out the WiFi but I guess this isn't too bad.  Presumably I'll tinker with the image to get it just how I want and when it goes into an arcade cabinet I won't need to connect to WiFi or anything.

EDIT#3:  So I'm back in Service Mode... How do I select the front end from the command prompt?  I'm at pi@arcade(rw):

The instructions above say: 

Quote
To select, just type:

Code: [Select]
sudo nano /etc/environment
And ajust the value of the FRONTEND variable (see comment from the file).

But I am not sure what to do.  When you say, "see comment from the file" what file am I supposed to be looking at?

Thanks!!   :cheers:
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 05, 2021, 09:48:23 pm
The content of /etc/environment is:

Code: [Select]
MAMEVER=0231

# FRONTEND accept one of these values:
# attract, advance, mame
FRONTEND=mame

SDL_VIDEODRIVER=kmsdrm
SDL_RENDER_DRIVER=opengles2
SDL_RENDER_VSYNC=1
SDL_GRAB_KEYBOARD=1
SDL_VIDEO_GLES2=1

To select the front-end of your choice, just set the related value to the FRONTEND variable.

For example:

If you want to use Attract Mode, the line would be:

Code: [Select]
FRONTEND=attract
If you want to use AdvanceMENU, the line would be:

Code: [Select]
FRONTEND=advance
If you want to use MAME GUI, the line would be:

Code: [Select]
FRONTEND=mame
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on May 06, 2021, 01:14:07 pm
The content of /etc/environment is:

Code: [Select]
MAMEVER=0231

# FRONTEND accept one of these values:
# attract, advance, mame
FRONTEND=mame

SDL_VIDEODRIVER=kmsdrm
SDL_RENDER_DRIVER=opengles2
SDL_RENDER_VSYNC=1
SDL_GRAB_KEYBOARD=1
SDL_VIDEO_GLES2=1

To select the front-end of your choice, just set the related value to the FRONTEND variable.

For example:

If you want to use Attract Mode, the line would be:

Code: [Select]
FRONTEND=attract
If you want to use AdvanceMENU, the line would be:

Code: [Select]
FRONTEND=advance
If you want to use MAME GUI, the line would be:

Code: [Select]
FRONTEND=mame

Ahhh.... OK.  I was trying commands from the command prompt.  Typing "sudo nano /etc/environment" does open the file and I was able to make changes and save.  However, I changed to "arcademode" and rebooted and all I'm getting is a black screen with the word "MAME 1/0" displaying in the bottom right corner of the screen.  I assume I screwed something up?  MAME GUI was working fine before I switched to "attract" in the /etc/environment file.

Editing the file back to say FRONTEND=mame does get the MAME GUI working just fine again. 

EDIT: When I tried "FRONTEND=advance"  I get an error saying my display sucks.  It says try setting it to be "-display_size 1280x1024" but I didn't know what that meant.  Maybe my stupid 4K TV is causing issues.  I'm going to see if I can connect to another display in the house...
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 06, 2021, 05:19:22 pm
Ahhh.... OK.  I was trying commands from the command prompt.  Typing "sudo nano /etc/environment" does open the file and I was able to make changes and save.  However, I changed to "arcademode" and rebooted and all I'm getting is a black screen with the word "MAME 1/0" displaying in the bottom right corner of the screen.  I assume I screwed something up?  MAME GUI was working fine before I switched to "attract" in the /etc/environment file.

Editing the file back to say FRONTEND=mame does get the MAME GUI working just fine again. 

EDIT: When I tried "FRONTEND=advance"  I get an error saying my display sucks.  It says try setting it to be "-display_size 1280x1024" but I didn't know what that meant.  Maybe my stupid 4K TV is causing issues.  I'm going to see if I can connect to another display in the house...

To set the corret video mode with AdvanceMENU, you should run the AdvCfg binary and set the resolution to the one EDID has detected:

Code: [Select]
./frontend/advance/advcfg
If you want to switch the desired Front-end more easily, just add this line in /home/pi/.bash_alias:   :)

Code: [Select]
alias frontend='_frontend(){ if [[ "$1" =~ ^(mame|attract|advance)$ ]]; then sudo sed -i "s/FRONTEND=.*$/FRONTEND="$1"/g" /etc/environment && echo "Frontend set to: "$1" (reboot to apply)."; else echo "Invalid or missing argument. Try: mame, attract or advance"; fi;}; _frontend'
Then, logoff/logon and now you just have to issue one of these 3 commands to switch the Front-end:

Code: [Select]
frontend mame
frontend advance
frontend attract
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 06, 2021, 08:43:12 pm
Hi javeryh,

Just to let you know that I uploaded a new revision with the Wi-Fi fixed (including the new alias definition, named frontend).

Sorry for the Wi-Fi issue (my mistake).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on May 07, 2021, 01:10:17 pm
Hi javeryh,

Just to let you know that I uploaded a new revision with the Wi-Fi fixed (including the new alias definition, named frontend).

Sorry for the Wi-Fi issue (my mistake).

Sweet.  I will download this new version and see if I can get it working.  Thanks!!   :cheers:
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: javeryh on May 07, 2021, 04:23:50 pm
Hi javeryh,

Just to let you know that I uploaded a new revision with the Wi-Fi fixed (including the new alias definition, named frontend).

Sorry for the Wi-Fi issue (my mistake).

OK - I'm using the new image and WiFi seems to be working again - thank you!  MAME GUI works fine but there are a few issues I'm running into with Attract Mode and AdvanceMENU.

When booting into Attract Mode the screen just displays "MAME I/O" in the lower right corner.  Not sure how to fix that.

When booting into AdvanceMENU, I am getting a video display error (no video mode available for your configuration) and when I go into ./frontend/advance/advcfg and set it to what EDID detects it doesn't work.  I'm sure this is because I am using a 4K TLC TV for this right now.  I really need to buy a small HDMI enabled monitor for testing, which I am doing now.

Also, how do I force downloading of artwork (screen shots, etc.)?  In the MAME GUI there is a blank area on the right that says "No image Available" but on the previous build I was messing with yesterday this was all automatically populated.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: rizel67 on May 08, 2021, 05:47:59 pm
Hi.
First of all. Good job.  :applaud: :applaud:

I think i'm kind of dumb because i'm not able to make your sd card image working. I'm using balena etcher and when i want to flash with your image it send me a pop up telling me "missing partition table. It looks like this is not a bootable image. The image does not appear to contain a partition table, and might not be recognized or bootable by your device."
I continue and then when i put my card inside my Pi. It tell me "unable to read partition as FAT"
Should i change the format of the card to FAT or FAT 32 or even ExtFat ? it's a 32gb sd card by the way.
Thanks for your time.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on May 09, 2021, 02:30:01 pm
@rizel67,

I just uploaded a new version of the image file that should fix the FAT partition/partition table issue. The download link is the same.

@javeryh

The automatic artwork management service should be taking care of the automatic download of the snapshots. Just make sure it is running by issuing the following command:

Code: [Select]
systemctl status mame-artwork-mgmt.service
Title: Re: How to make a dedicated MAME 0.231 Appliance on a Raspberry Pi 4B
Post by: Nelviticus on May 22, 2021, 06:00:05 pm
Hi there, I just registered to say thank you for all your hard work. I've been using your image for a couple of days now on my new Pi400 and it works great.

Awesome stuff!

Nelviticus
Title: Re: How to make a dedicated MAME 0.231 Appliance on a Raspberry Pi 4B
Post by: bbegin on May 24, 2021, 06:42:47 pm
Thank you very much, Nelviticus!

Very glad you appreciate the system!  :cheers:
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 01, 2021, 12:12:59 pm
Just to let you know the availability of the NEW disk image file with MAME 0.232 (please see the original post of this thread for the download link).   :cheers:

As with the previous release, this image (and onwards) include 2 Front-ends: Attract Mode and AdvanceMENU.

To select one of them, just issue one of the following commands:

Code: [Select]
# To use Attract Mode:
frontend attract

# To use AdvanceMENU:
frontend advance

# To use the MAME GUI (default):
frontend mame

Reboot the system (sudo reboot).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: beernite on June 03, 2021, 03:19:12 pm
Sorry for the total noob question here. I was able to download your image and expand the file system. I'm not able to connect to my wifi however. I know you said that wifi isn't disabled in the image, but it seems like the OS doesn't even find the interface. Trying to set things up with raspi-config gives me a "No wireless interfaces found" message. Is that something I screwed up?

Thanks for all the work

Hi jhummel,

I forgot a little ajustment (in my staging process) when I published the image of 0.227 and it has to do with Wi-Fi.

You will need to reinstall wpasupplicant with the following command and reboot:

Code: [Select]
sudo apt-get install wpasupplicant -y
Sorry for the mistake.

Hi, bbegin -

First off, thank you for this wonderful thread and for sharing your image file. I built a MAME cabinet powered by a PC many years ago. I am now replacing the CRT display with a flat screen, and the PC with a raspberry pi 4. I have installed the June 1st 2021 image and am now experiencing the same issue that jhummel was encountering. Any advice as to how to proceed would be greatly appreciated. I tried some of the steps you suggested to him, but with no luck.

update: I should add that changing the password upon initial start did not work. The system replied "passwd: Authentication token manipulation error". Perhaps this issue is related to the "cannot lock /etc/password" reply when I tried the command sudo usermod -a -G render pi

Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on June 03, 2021, 11:11:36 pm
Hi, bbegin -

First off, thank you for this wonderful thread and for sharing your image file. I built a MAME cabinet powered by a PC many years ago. I am now replacing the CRT display with a flat screen, and the PC with a raspberry pi 4. I have installed the June 1st 2021 image and am now experiencing the same issue that jhummel was encountering. Any advice as to how to proceed would be greatly appreciated. I tried some of the steps you suggested to him, but with no luck.

update: I should add that changing the password upon initial start did not work. The system replied "passwd: Authentication token manipulation error". Perhaps this issue is related to the "cannot lock /etc/password" reply when I tried the command sudo usermod -a -G render pi

Hi beernite, thanks! :)

You mean when you run raspi-config, you get "No wireless interfaces found" message? If so, it may be caused by the fact I forgot to remove some lines from a file.

To check, issue this command:
Code: [Select]
cat /etc/modprobe.d/raspi-blacklist.conf
Make sure the lines below are NOT in the file (remove them, if they are there):

Code: [Select]
# WiFi
blacklist brcmfmac
blacklist brcmutil

EDIT: I double-checked on the image I provide and the lines are not there, so the Wi-Fi interface should work (be detected/enabled).

The second issue you are experiencing is because the root filesystem is kept in read-only mode, by default. To put it in read/write mode, so you can make changes to the system (in this case, configuration changes), you should type this command, prior:

Code: [Select]
rw

The prompt suffix will then change to (rw). Then, you can make your changes and they will be persistent.

To put the system back in read-only mode, just type:

Code: [Select]
ro

The prompt suffix will be back to (ro).
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: beernite on June 05, 2021, 10:51:51 am
You mean when you run raspi-config, you get "No wireless interfaces found" message?

What is happening is that when I run raspi-config to set up my network, it says "Could not communicate with wpa_supplicant". After hitting Ok it says "There was an error running  option S1 Wireless LAN". I then reviewed the contents of wpa_supplicant by typing 'sudo cat /etc/wpa_supplicant/wpa_supplicant.conf' :

Code: [Select]
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config==1

Is there anything incorrect about this file? I apologize in advance if this is a basic Linux problem/question and is inappropriate for this thread. I will not take it personally if I am told that is indeed the case :)

Finally, thank you for the information about read/write mode. I had forgotten that from your README file.
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on June 05, 2021, 12:50:00 pm
You mean when you run raspi-config, you get "No wireless interfaces found" message?

What is happening is that when I run raspi-config to set up my network, it says "Could not communicate with wpa_supplicant". After hitting Ok it says "There was an error running  option S1 Wireless LAN". I then reviewed the contents of wpa_supplicant by typing 'sudo cat /etc/wpa_supplicant/wpa_supplicant.conf' :

Code: [Select]
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config==1

Is there anything incorrect about this file? I apologize in advance if this is a basic Linux problem/question and is inappropriate for this thread. I will not take it personally if I am told that is indeed the case :)

Finally, thank you for the information about read/write mode. I had forgotten that from your README file.

You should configure the Wi-Fi interface according to your Access Point's SSID and associated security settings.

You can do this offline from another computer, just plug the SD card in a reader and access the "boot" partition and follow these steps:

https://linuxhint.com/rasperberry_pi_wifi_wpa_supplicant/
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: beernite on June 05, 2021, 03:10:59 pm
I didn't have any luck with that either. I ended up reimaging the SD card and am now having no problems. Thanks for your patience with me!
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 05, 2021, 05:59:17 pm
I didn't have any luck with that either. I ended up reimaging the SD card and am now having no problems. Thanks for your patience with me!

Good to know that all is working OK! :D

It is a pleasure for me to help, if I can!

Happy gaming!
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: j3rk on June 19, 2021, 07:51:08 pm
I just got this set up today, made a few tweaks, did a slight overclock, and it works SO well!

Nice!!!

I registered so I could thank you.
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 20, 2021, 01:17:02 pm
I just got this set up today, made a few tweaks, did a slight overclock, and it works SO well!

Nice!!!

I registered so I could thank you.

Thanks to you, I'm very glad you appreciate the system!  :D
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: sboultbee on June 21, 2021, 10:51:11 pm
Thank you for creating this image.  I've been using it for the last week or so (with the latest MAME 0.232 version), but have been coming across a few issues that others have described in this thread.

The first is that when I switch the frontend to AttractMode, it boots to a solid black screen with 'MAME 0/1' in the lower right and goes no further.  At least one other poster had the exact same issue, but if they resolved it, I didn't see the solution.  SSH'ing back into the system and changing the frontend back to 'mame' gets everything going again.

My second issue is that I've had to overclock my Pi4 (4GB version) to get some games to run smoothly without exhibiting choppy audio.  At the default settings, Mario Bros. (1983) has very choppy audio on the first animation screen before the first level.  Ms. Pac Man also had a few minor instances of an audio breakup, but nowhere near as bad as Mario Bros.  Overclocking fixed the issue, but elsewhere in the thread, it's stated that 1980s games should run at full speed on the Pi4 without the need to overclock.

My third and final issue is that during setup my WiFi doesn't work and I can't connect to my network - it throws errors on the raspi-config screen where I would connect to the network. I've had to resort to the wpa_supplicant manual method to get it to work.  My understanding was that this issue was fixed in earlier versions of the image, so I shouldn't be experiencing this problem.  I've been able to fix it, but any ideas of why I'm running into this issue?

Again, thanks for the image.  It's well put together and simple to use.
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 22, 2021, 12:06:17 pm
Thank you for creating this image.  I've been using it for the last week or so (with the latest MAME 0.232 version), but have been coming across a few issues that others have described in this thread.

The first is that when I switch the frontend to AttractMode, it boots to a solid black screen with 'MAME 0/1' in the lower right and goes no further.  At least one other poster had the exact same issue, but if they resolved it, I didn't see the solution.  SSH'ing back into the system and changing the frontend back to 'mame' gets everything going again.

You should first build your Romlist for any games to appear in Attract Mode. You then have to scrape your Romlist to get the graphic material associated with your ROMs. You all do this from the menu with the Tab key. Please refer to the Attract Mode documentation for all the details.

My second issue is that I've had to overclock my Pi4 (4GB version) to get some games to run smoothly without exhibiting choppy audio.  At the default settings, Mario Bros. (1983) has very choppy audio on the first animation screen before the first level.  Ms. Pac Man also had a few minor instances of an audio breakup, but nowhere near as bad as Mario Bros.  Overclocking fixed the issue, but elsewhere in the thread, it's stated that 1980s games should run at full speed on the Pi4 without the need to overclock.

My mistake: I should have stated virtually all 80's games run at full speed. The problem is that some system/platforms are poorly supported in MAME via an old or poorly written driver and thus is not optimized, resulting in a lot of CPU consumption. The only solution is to file an issue on mametesters.org and wait for a newer version of MAME with updated driver code.

My third and final issue is that during setup my WiFi doesn't work and I can't connect to my network - it throws errors on the raspi-config screen where I would connect to the network. I've had to resort to the wpa_supplicant manual method to get it to work.  My understanding was that this issue was fixed in earlier versions of the image, so I shouldn't be experiencing this problem.  I've been able to fix it, but any ideas of why I'm running into this issue?

Again, thanks for the image.  It's well put together and simple to use.

I have not investigated yet the Wi-Fi issue using raspi-config. It may have to do with the fact that the root filesystem is kept in read-only mode. Can you tell me what steps/options you are doing in raspi-config, what behavior and error messages you get? Thanks very much in advance!
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: sboultbee on June 22, 2021, 06:02:43 pm
Thank you for creating this image.  I've been using it for the last week or so (with the latest MAME 0.232 version), but have been coming across a few issues that others have described in this thread.

The first is that when I switch the frontend to AttractMode, it boots to a solid black screen with 'MAME 0/1' in the lower right and goes no further.  At least one other poster had the exact same issue, but if they resolved it, I didn't see the solution.  SSH'ing back into the system and changing the frontend back to 'mame' gets everything going again.

You should first build your Romlist for any games to appear in Attract Mode. You then have to scrape your Romlist to get the graphic material associated with your ROMs. You all do this from the menu with the Tab key. Please refer to the Attract Mode documentation for all the details.

My second issue is that I've had to overclock my Pi4 (4GB version) to get some games to run smoothly without exhibiting choppy audio.  At the default settings, Mario Bros. (1983) has very choppy audio on the first animation screen before the first level.  Ms. Pac Man also had a few minor instances of an audio breakup, but nowhere near as bad as Mario Bros.  Overclocking fixed the issue, but elsewhere in the thread, it's stated that 1980s games should run at full speed on the Pi4 without the need to overclock.

My mistake: I should have stated virtually all 80's games run at full speed. The problem is that some system/platforms are poorly supported in MAME via an old or poorly written driver and thus is not optimized, resulting in a lot of CPU consumption. The only solution is to file an issue on mametesters.org and wait for a newer version of MAME with updated driver code.

My third and final issue is that during setup my WiFi doesn't work and I can't connect to my network - it throws errors on the raspi-config screen where I would connect to the network. I've had to resort to the wpa_supplicant manual method to get it to work.  My understanding was that this issue was fixed in earlier versions of the image, so I shouldn't be experiencing this problem.  I've been able to fix it, but any ideas of why I'm running into this issue?

Again, thanks for the image.  It's well put together and simple to use.

I have not investigated yet the Wi-Fi issue using raspi-config. It may have to do with the fact that the root filesystem is kept in read-only mode. Can you tell me what steps/options you are doing in raspi-config, what behavior and error messages you get? Thanks very much in advance!

From the documentation of AttractMode, I was under the impression that upon its first use I'd get a menu from where I could generate the ROMs list and handle other matters.  I don't get a menu at all, just the black screen with the 'MAME 0/1' in the corner.  I was able to get it running on a very basic level by using the command-line option to generate the ROMs list.

With overclocking the Pi4, Mario Bros. does appear to run at full speed with good sound, so at least that's an option.  I feel that the old Nintendo games are often the ones that will have issues as I believe that many still use sound samples rather than emulating the audio chips.

Raspi-config is the only option that a Linux novice like myself was aware of for setting up the WiFi.  I get the errors regardless of whether I'm in read-only or read-write mode.  I tried both as I suspected that read-only mode might be the cause - it's not.  The first message I get when configuring the WiFi is 'Could not communicate with wpa_supplicant' with 'OK' being the only button.  Pressing 'OK' brings up another message saying "There was an error running option S1 Wireless LAN' also with an OK button.  Pressing 'OK' this time just takes me back to the main raspi-config screen.
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 22, 2021, 10:13:06 pm
Raspi-config is the only option that a Linux novice like myself was aware of for setting up the WiFi.  I get the errors regardless of whether I'm in read-only or read-write mode.  I tried both as I suspected that read-only mode might be the cause - it's not.  The first message I get when configuring the WiFi is 'Could not communicate with wpa_supplicant' with 'OK' being the only button.  Pressing 'OK' brings up another message saying "There was an error running option S1 Wireless LAN' also with an OK button.  Pressing 'OK' this time just takes me back to the main raspi-config screen.


Could you make a test for me?

Reset your Wi-Fi configuration (re-flash the image to a new SD-card, if you have an extra one)
Put the system in read/write mode by typing:  rw
Run sudo raspi-config and set the wifi country code by going to:

Code: [Select]
5 Localisation Options
Then:

Code: [Select]
L4. WLAN Country
Then select your country code from the list.

Then try to go to and setup your Wi-Fi interface (as you tried earlier):

Code: [Select]
S1 Wireless Lan
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 22, 2021, 10:16:38 pm
From the documentation of AttractMode, I was under the impression that upon its first use I'd get a menu from where I could generate the ROMs list and handle other matters.  I don't get a menu at all, just the black screen with the 'MAME 0/1' in the corner.  I was able to get it running on a very basic level by using the command-line option to generate the ROMs list.

The reason you get a black screen is because I kind of pre-configured Attract Mode with an emulator called MAME. I did this because I wanted to pre-configure the MAME binary path ($HOME/mame/mame). To remove this, just delete this emulator and start from scratch. Sorry, I think this cause more confusion than I was expecting... :\

Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: sboultbee on June 22, 2021, 11:18:12 pm

Could you make a test for me?

Reset your Wi-Fi configuration (re-flash the image to a new SD-card, if you have an extra one)
Put the system in read/write mode by typing:  rw
Run sudo raspi-config and set the wifi country code by going to:

Code: [Select]
5 Localisation Options
Then:

Code: [Select]
L4. WLAN Country
Then select your country code from the list.

Then try to go to and setup your Wi-Fi interface (as you tried earlier):

Code: [Select]
S1 Wireless Lan

No luck - I get the 'Could not communicate with wpa_supplicant' when I select the L4 option to set the WiFi country.  The next screen then says 'There was an error running option L4 WLAN Country'.

I'd just used an article online about how to set up the wpa_supplicant.conf file manually, so that's what I've done to get WiFi working.
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: sboultbee on June 23, 2021, 10:59:29 am
From the documentation of AttractMode, I was under the impression that upon its first use I'd get a menu from where I could generate the ROMs list and handle other matters.  I don't get a menu at all, just the black screen with the 'MAME 0/1' in the corner.  I was able to get it running on a very basic level by using the command-line option to generate the ROMs list.

The reason you get a black screen is because I kind of pre-configured Attract Mode with an emulator called MAME. I did this because I wanted to pre-configure the MAME binary path ($HOME/mame/mame). To remove this, just delete this emulator and start from scratch. Sorry, I think this cause more confusion than I was expecting... :\

The pre-configuring of AttractMode is what confused me. I was expecting it to boot into a menu where I’d generate the ROMs list and take care of other matters. It never occurred to me that AM was working but that I needed to press the ‘Tab’ key to get into the menu system to continue the setup. It just looked like something had broken.

I think it would help to add a line to the first post that says something like “If using AttractMode, you’ll need to press Tab at the black screen to open the menus and complete set up.”
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 23, 2021, 11:11:10 am
The pre-configuring of AttractMode is what confused me. I was expecting it to boot into a menu where I’d generate the ROMs list and take care of other matters. It never occurred to me that AM was working but that I needed to press the ‘Tab’ key to get into the menu system to continue the setup. It just looked like something had broken.

I think it would help to add a line to the first post that says something like “If using AttractMode, you’ll need to press Tab at the black screen to open the menus and complete set up.”

You're right. I will add information in the first post to specify that Attract Mode is pre-configured with an emulator called "MAME" and use the Tab key to complete the setup (generate the Romlist, etc.).
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on June 23, 2021, 11:16:19 am
No luck - I get the 'Could not communicate with wpa_supplicant' when I select the L4 option to set the WiFi country.  The next screen then says 'There was an error running option L4 WLAN Country'.

Can you try this:

Code: [Select]
systemctl status wpa_supplicant.service
rfkill unblock all
sudo systemctl restart wpa_supplicant.service
sudo raspi-config

And try again (with first setup the country code)?

I'd just used an article online about how to set up the wpa_supplicant.conf file manually, so that's what I've done to get WiFi working.

Yes, there is a neat offline method of pre-configuring the Wi-Fi on on Raspbian/RaspiOS (creating and configuring the wpa_supplicant.conf file in the boot partition).
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: sboultbee on June 24, 2021, 01:39:14 am
No luck - I get the 'Could not communicate with wpa_supplicant' when I select the L4 option to set the WiFi country.  The next screen then says 'There was an error running option L4 WLAN Country'.

Can you try this:

Code: [Select]
systemctl status wpa_supplicant.service
rfkill unblock all
sudo systemctl restart wpa_supplicant.service
sudo raspi-config

And try again (with first setup the country code)?

I'd just used an article online about how to set up the wpa_supplicant.conf file manually, so that's what I've done to get WiFi working.

Yes, there is a neat offline method of pre-configuring the Wi-Fi on on Raspbian/RaspiOS (creating and configuring the wpa_supplicant.conf file in the boot partition).

Yep, preparing the offline version of the wpa_supplicant.conf file is basically what I did to get WiFi working.

Went through the steps in your last post from a freshly flashed image with the same error messages.
Title: Re: How to make a dedicated MAME 0.232 Appliance on a Raspberry Pi 4B
Post by: bbegin on July 05, 2021, 12:18:59 pm
Just to let you know the availability of the NEW disk image file with MAME 0.233 (please see the original post of this thread for the download link).   :cheers:

As with the previous releases, this image (and onwards) include 2 Front-ends: Attract Mode and AdvanceMENU.

To select one of them, just issue one of the following commands:

Code: [Select]
# To use Attract Mode:
frontend attract

# To use AdvanceMENU:
frontend advance

# To use the MAME GUI (default):
frontend mame

Reboot the system (sudo reboot).
Title: Re: How to make a dedicated MAME 0.233 Appliance on a Raspberry Pi 4B
Post by: exonaax on July 12, 2021, 12:14:39 pm
Hi @bbegin,

Once again, thank you very much for all the time you offered to the community, to make this project alive and fully functional! It is a unique chance for us to learn from you, your passion and how MAME works.

Concerning about performances, I was reading this article on the excellent site RetroRGB : https://www.retrorgb.com/raspberry-pi-mame-benchmarks.html

Unfortunately, It is not detailed on how the benches have been performed (from X11 ?), but it shows how clearly the RPI4 can be a solution for a short selection of great titles. In contrast,  it also shows, how the RPI4 is not the solution to play to all devices supported,  with more or less success, by MAME.

My final understanding is, if you know which games you want to play, and understand why it is important to keep MAME up-to-date, then YES, your approach here, getting a JeOS and MAME, is the best for all players who love accuracy, in memory of video games.

Thank you and keep playing!
Title: Re: How to make a dedicated MAME 0.235 Appliance on a Raspberry Pi 4B
Post by: bbegin on September 06, 2021, 04:18:21 pm
Just to let you know the availability of the NEW disk image file with MAME 0.235 (please see the original post of this thread for the download link).  :cheers:

Enjoy!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on September 30, 2021, 07:43:22 am
Just to let you know the availability of the NEW disk image file with MAME 0.236 (please see the original post of this thread for the download link).  :cheers:

Enjoy!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on September 30, 2021, 08:25:38 am
Just to let you know the availability of the NEW disk image file with MAME 0.236 (please see the original post of this thread for the download link).  :cheers:

Enjoy!
Thanks so much for continuing with this.  I’m finally back to working on my project after a break over the summer.

I’m going to try (again) to get this working so that when I press the power button, AttractMode will show up on screen with the list of MAME games and when I press the power button again everything shuts down safely.

My CP will consist of one 4-way joystick, 2 buttons, P1 Start, P2 Start and an Exit button.  Ideally, Exit will double as Pause (press to Pause/hold down for 2 seconds to Exit to game list).

My deadline is Christmas so I need to get moving!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on September 30, 2021, 06:21:08 pm
Just to let you know the availability of the NEW disk image file with MAME 0.236 (please see the original post of this thread for the download link).  :cheers:

Enjoy!
Thanks so much for continuing with this.  I’m finally back to working on my project after a break over the summer.

I’m going to try (again) to get this working so that when I press the power button, AttractMode will show up on screen with the list of MAME games and when I press the power button again everything shuts down safely.

My CP will consist of one 4-way joystick, 2 buttons, P1 Start, P2 Start and an Exit button.  Ideally, Exit will double as Pause (press to Pause/hold down for 2 seconds to Exit to game list).

My deadline is Christmas so I need to get moving!

Seems to be a very nice project! I guess you will use some form of relay for the power-on and power-off button (after a clean shutdown)? Alternatively, if the Pi is still powered-on, once in a shutdown state, you can wake it up by simply shorting 2 of the GPIO pins (see https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi (https://howchoo.com/g/mwnlytk3zmm/how-to-add-a-power-button-to-your-raspberry-pi)). Anyway, the behavior of the image is that once you quit the front-end, the system shuts itself automatically and cleanly.
Title: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 06, 2021, 07:20:04 pm
OK I've been messing around and I figured out how to get Attract Mode to at least display properly - there are a few people in this thread wondering what was happening when you typed "frontend attract" in rw mode and then "sudo reboot".  Attract Mode definitely works but it just says "MAME 0/1" in the bottom right corner.  This is because the default name for the Game List is "MAME" and the "0/1" means you have no games in this list.  So hit TAB and the Attract Mode menu will come up and you can play around with the settings, including populating the game list.

EDIT: I've made some progress on this.  Upon boot-up, Attract Mode launches and displays the "SDarcadeMod_v3f" theme in vertical orientation.  I got this theme off of the Attract Mode website.  It's pretty slick.  Looks exactly like the ArcadeSD menu.  I only have a keyboard connected but so far games are launching.  One thing I cannot figure out is why the menu doesn't recognize the vertical orientation - pressing left/right should scroll through the games but you still need to press up/down.  Not a huge deal but something I'd like to fix, if possible.

To make the games launch vertically, I had to go into the MAME settings ("frontend mame") and change the Advanced Configuration Options to turn on "Rotate Right".

I still have several things I need to figure out but I think this is going to be a great solution.
Title: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 07, 2021, 04:52:29 pm
bbegin - I was hoping you could help me with something.  I have your image up and running and it works great.  I made a little video of it running Attract Mode.

https://youtu.be/Cjjhl0m7fCM

After playing for a while, there is lots of text that appears on the screen when switching between games.  It looks like this:

(https://uploads.tapatalk-cdn.com/20211008/1811759de08cf1b56fc560113616383c.jpg)

Is there a way to not make this appear?  It's not a huge deal but I thought I'd ask in case there was a simple fix.

Thanks!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on October 09, 2021, 12:04:37 am
Hi Javeryh,

To answer your question, yes there is a way to suppress those messages, wich are produced by the MAME emulator.

What you need to do is to customize the command-line used to launch MAME (configured in Attract Mode under your Emulator menu). You need to add this below at the END of the command-line:

Code: [Select]
>/dev/null 2>/dev/null
EDIT (2021-10-10): in fact, you should append the line above to the "Command Arguments", from the properties of your MAME emulator definition in Attract Mode.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 10, 2021, 12:32:56 pm
Hi Javeryh,

To answer your question, yes there is a way to suppress those messages, wich are produced by the MAME emulator.

What you need to do is to customize the command-line used to launch MAME (configured in Attract Mode under your Emulator menu). You need to add this below at the END of the command-line:

Code: [Select]
>/dev/null 2>/dev/null
EDIT (2021-10-10): in fact, you should append the line above to the "Command Arguments", from the properties of your MAME emulator definition in Attract Mode.

Thanks for this.  I am not sure I am doing it correctly.  I hit "Tab" while in Attract Mode and select Emulators -> MAME -> Command Arguments and change the default "[name]" to ">/dev/null 2>/dev/null".  When I exit back to the Attract Mode game list and select a game to play, it launches the MAME GUI instead of the game.   I also tried "[name]>/dev/null 2>/dev/null" in that spot with the same result.

I'm sure I'm missing something simple...

Also, another question not really related to your application but I thought you might know the answer... I added a power button to the pi by modifying "sudo nano /boot/config.txt" and adding these two lines to the file at the end:

Code: [Select]
#shutdown button
dtoverlay=gpio-shutdown

Now bridging GPIO3 and Ground (pins 5 and 6) will shut the pi off.  Doing it again will turn it back on.  Is this a "safe shutdown"?  The shutdown is a little abrupt but it seems to be working.  I've powered on/off probably 20 times now with no issues.  It almost seems too easy!  Boots right into the Attract Mode game list.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on October 10, 2021, 01:10:12 pm
Thanks for this.  I am not sure I am doing it correctly.  I hit "Tab" while in Attract Mode and select Emulators -> MAME -> Command Arguments and change the default "[name]" to ">/dev/null 2>/dev/null".  When I exit back to the Attract Mode game list and select a game to play, it launches the MAME GUI instead of the game.   I also tried "[name]>/dev/null 2>/dev/null" in that spot with the same result.

I'm sure I'm missing something simple...

I suspect that Attract Mode is validating the input from the GUI and strip some characters (like the ">").

As an alternative way to do this, edit mame.cfg (if you called your emulator "mame"):

Code: [Select]
nano /data/attract/mame.cfg
From:

Code: [Select]
args                 [name]
To:

Code: [Select]
args                 [name] >/dev/null 2>/dev/null
Also, another question not really related to your application but I thought you might know the answer... I added a power button to the pi by modifying "sudo nano /boot/config.txt" and adding these two lines to the file at the end:

Code: [Select]
#shutdown button
dtoverlay=gpio-shutdown

Now bridging GPIO3 and Ground (pins 5 and 6) will shut the pi off.  Doing it again will turn it back on.  Is this a "safe shutdown"?  The shutdown is a little abrupt but it seems to be working.  I've powered on/off probably 20 times now with no issues.  It almost seems too easy!  Boots right into the Attract Mode game list.

Yes, I can confirm this method is good to safely shutdown the Raspberry Pi (clean unmount of the filesystem, including the read/write /data partition).
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 10, 2021, 01:44:17 pm
Thanks for this.  I am not sure I am doing it correctly.  I hit "Tab" while in Attract Mode and select Emulators -> MAME -> Command Arguments and change the default "[name]" to ">/dev/null 2>/dev/null".  When I exit back to the Attract Mode game list and select a game to play, it launches the MAME GUI instead of the game.   I also tried "[name]>/dev/null 2>/dev/null" in that spot with the same result.

I'm sure I'm missing something simple...

I suspect that Attract Mode is validating the input from the GUI and strip some characters (like the ">").

As an alternative way to do this, edit mame.cfg (if you called your emulator "mame"):

Code: [Select]
nano /data/attract/mame.cfg
From:

Code: [Select]
args                 [name]
To:

Code: [Select]
args                 [name] >/dev/null 2>/dev/null
Also, another question not really related to your application but I thought you might know the answer... I added a power button to the pi by modifying "sudo nano /boot/config.txt" and adding these two lines to the file at the end:

Code: [Select]
#shutdown button
dtoverlay=gpio-shutdown

Now bridging GPIO3 and Ground (pins 5 and 6) will shut the pi off.  Doing it again will turn it back on.  Is this a "safe shutdown"?  The shutdown is a little abrupt but it seems to be working.  I've powered on/off probably 20 times now with no issues.  It almost seems too easy!  Boots right into the Attract Mode game list.

Yes, I can confirm this method is good to safely shutdown the Raspberry Pi (clean unmount of the filesystem, including the read/write /data partition).
Thanks!  This made things better but not perfect.  Good enough for sure.  I am still getting a text readout of “average speed” between games.  Every time I exit it adds a line.

(https://uploads.tapatalk-cdn.com/20211010/57cbeb414520b24f57ca03ac6e464335.jpg)

Not a big deal at all.  Also good to know that my shutdown is “safe”.  I’m pretty much finished with co figuring this setup and it’s going to work out great.  Much much easier to not have to include a full Windows PC just to run some 80s arcade games!

Thanks!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on October 11, 2021, 12:48:22 am
Thanks!  This made things better but not perfect.  Good enough for sure.  I am still getting a text readout of “average speed” between games.  Every time I exit it adds a line.

(https://uploads.tapatalk-cdn.com/20211010/57cbeb414520b24f57ca03ac6e464335.jpg)

It's like the first redirection was not used by AM. I would suggest you put this variation (notice the 1 before the redirect character >):

Code: [Select]
args                 [name] 1>/dev/null 2>/dev/null
If it's not woking, you can at least rotate the console text output:

Code: [Select]
sudo nano /boot/cmdline.txt
Append the below text to the kernel command-line:

Code: [Select]
fbcon=rotate:1
Not a big deal at all.  Also good to know that my shutdown is “safe”.  I’m pretty much finished with co figuring this setup and it’s going to work out great.  Much much easier to not have to include a full Windows PC just to run some 80s arcade games!

Thanks!

Oh yes you're right, I think this solution is WAY simpler and more effective than a full-blown Windows PC in an arcade cabinet.  :D  Enjoy!  :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 11, 2021, 02:05:16 pm
No dice.  Oh well.  I can live with it.  The text is already rotated to the bottom left of the screen because I am running everything in portrait mode so I don't have to do anything else... I think haha.  I've had it running almost continuously during the day for the last 4 or 5 days and I've rebooted probably 25+ times now and no issues.

A few things to note:
- When I exit back to Attract Mode, the video snap is off center almost like it is between game selections.  This definitely seems like an Attract Mode issue.  Moving left or right fixes this so no big deal.
- Astro Blaster is unplayable, which was surprising to me.  There is synthesized speech in the game so maybe that is causing the slow down but it's a really old game so I expected it to run.  Everything else in my game list appears to be working great!

 :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 12, 2021, 09:30:25 am
It's like the first redirection was not used by AM. I would suggest you put this variation (notice the 1 before the redirect character >):

Code: [Select]
args                 [name] 1>/dev/null 2>/dev/null
bbegin - since this isn't working, Ond had an idea to make the text a different color (black or clear?) to make it blend into the blank screen.  Is this possible?
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on October 12, 2021, 10:21:31 am
It's like the first redirection was not used by AM. I would suggest you put this variation (notice the 1 before the redirect character >):

Code: [Select]
args                 [name] 1>/dev/null 2>/dev/null

bbegin - since this isn't working, Ond had an idea to make the text a different color (black or clear?) to make it blend into the blank screen.  Is this possible?

Maybe you could ajust the executable variable of Attract Mode to inject a foreground color change just prior to launch MAME:

Code: [Select]
nano /data/attract/emulators/mame.cfg
Change:
Code: [Select]
executable           /home/pi/mame/mame
To:
Code: [Select]
executable           setterm -foreground black;/home/pi/mame/mame
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: 10yard on October 12, 2021, 11:19:52 am
I use a combination of nohup and redirection to suppress output on Raspberry Pi.  Works for me.  Here's a simple example.

Code: [Select]
nohup mame dkong >/dev/null 2>&1
I figure this will work for your scenario by updating your executable line to be:

Code: [Select]
executable           nohup /home/pi/mame/mame
and your args line to be:

Code: [Select]
args                  [name] >/dev/null 2>&1
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 12, 2021, 11:56:55 am
Thanks guys - unfortunately, neither option is working.  I get an error trying to launch a game that brings me back to the game list.  I don't think it likes any instructions before the "/home/pi/mame/mame" executable. 

I'm good.  Really, this has worked out better than I thought it was going to.  If (ok... when) I build another cabinet down the road I might look to make some further tweaks but this is going inside of a Christmas gift to someone who won't know the difference at all.  They will just be happy to play Ms. Pac-Man again.   :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 13, 2021, 04:14:07 pm
OK.. I found this thread (http://forum.arcadecontrols.com/index.php?topic=157745.0) and the fix apparently works on Retropie but it involves changing autostart.sh and I'm a little afraid to mess with this... but maybe it's a solution?
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on October 13, 2021, 05:21:54 pm
OK.. I found this thread (http://forum.arcadecontrols.com/index.php?topic=157745.0) and the fix apparently works on Retropie but it involves changing autostart.sh and I'm a little afraid to mess with this... but maybe it's a solution?

Good finding! :)

To adapt the fix presented in the thread to the autostart.sh script:

Code: [Select]
nano ~/scripts/autostart.sh
Add the lines to get the following (partial shown):

Code: [Select]
if [ ! -z $FRONTEND ]; then
  while
    case ${FRONTEND,,} in
      attract)  # Attract Mode
        setterm -cursor off
        stty -echo
        /usr/local/bin/attract --loglevel silent 2>&1 | grep -o $'\033\[2J'
        ;;
      advance)  # AdvanceMENU

I tested and it works great! :)
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: Ond on October 13, 2021, 06:01:35 pm
Can you make this a part of a new build release?  If you address all the issues of a visible OS in the background you have a strong contender for an up-to-date alternative to other emulation platforms regardless of whether they are based in hardware or software.   :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 13, 2021, 07:31:48 pm
OK, just so I'm clear I need to:

1.  modify autostart.sh changing it from this:

Code: [Select]
#!/bin/bash

# This script launch the selected application (front-end or MAME emulator) and respawn it if quit unexpectedly.

if [ ! -z $FRONTEND ]; then
  while
    case ${FRONTEND,,} in
      attract)
        /usr/local/bin/attract --loglevel silent
        ;;
      advance)
        /home/pi/frontend/advance/advmenu
        ;;
      mame)
        /home/pi/mame/mame > /dev/null
        ;;
    esac
    (( $? != 0 ))
  do
    :
  done
else
    echo $0 - Variable FRONTEND is not defined!
    read -n 1 -s -r -p "Press any key to continue..."
    echo
fi

to this:

Code: [Select]
#!/bin/bash

# This script launch the selected application (front-end or MAME emulator) and respawn it if quit unexpectedly.

if [ ! -z $FRONTEND ]; then
  while
    case ${FRONTEND,,} in
      attract)  # Attract Mode
        setterm -cursor off
        stty -echo
        /usr/local/bin/attract --loglevel silent 2>&1 | grep -o $'\033\[2J'
        ;;
      advance)  # AdvanceMENU
        /home/pi/frontend/advance/advmenu
        ;;
      mame)
        /home/pi/mame/mame > /dev/null
        ;;
    esac
    (( $? != 0 ))
  do
    :
  done
else
    echo $0 - Variable FRONTEND is not defined!
    read -n 1 -s -r -p "Press any key to continue..."
    echo
fi

2.  Create a new file named runcommand-onstart.sh (create a .txt file first and change the file extension to .sh) that contains only:

Code: [Select]
printf "\033[H\033[2J"

3.  Create a new file named runcommand-onend.sh (create a .txt file first and change the file extension to .sh) that contains only:

Code: [Select]
printf "\033[H\033[2J"

4.  Put runcommand-onstart.sh and runcommand-onend.sh into /home/pi/scripts/

5.  sudo rebooot.

Is that correct?

Can you ​make this a part of a new build release?  If you address all the issues of a visible OS in the background you have a strong contender for an up-to-date alternative to other emulation platforms regardless of whether they are based in hardware or software.   :cheers:

I agree!  I've had to make several minor tweaks to get it to behave like I want (and I am as anal as they come on presentation).  Nothing major but I was going for as clean of an install as possible.  I'll have to make a list of everything I did after mounting the image on the microSD card...

I should be clear though - bbegin did an AMAZING job with this and has been wonderful answering very specific questions.  This is a game changer as far as I'm concerned for cabinets running the classics.  I've had my pi on for about 5 days straight (rebooting 30+ times by now) and everything is still working as expected.   :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on October 13, 2021, 09:25:48 pm
Hi javeryh ,

You just have to do step 1 and 5 (steps 2, 3, 4 are not applicable to the system I publish).

I will publish today a new version of the image file with these changes implemented.

The system is very stable, it was a condition for me in the first place to publish it. An arcade machine HAS to be very reliable. :)
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: bbegin on October 13, 2021, 09:47:19 pm
As promised, I just uploaded an UPDATED version of the image file incorporating the suppression of the output from MAME while using the Attract Mode frontend. Please refer to the original post of this thread (the download link remain the same).

Enjoy!  :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: Ond on October 14, 2021, 01:31:36 am

I should be clear though - bbegin did an AMAZING job with this and has been wonderful answering very specific questions.  This is a game changer as far as I'm concerned for cabinets running the classics.  I've had my pi on for about 5 days straight (rebooting 30+ times by now) and everything is still working as expected.   :cheers:

Agreed, without his work we wouldn't have an up-to-date, ready to go solution for Raspberry Pi 4.  It's early days, but certainly more desirable than RetroPie.   :applaud:  :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 14, 2021, 09:32:31 am
Hi javeryh ,

You just have to do step 1 and 5 (steps 2, 3, 4 are not applicable to the system I publish).

I will publish today a new version of the image file with these changes implemented.

The system is very stable, it was a condition for me in the first place to publish it. An arcade machine HAS to be very reliable. :)

It works!!!  It's so clean.  Looks absolutely commercial grade now.  Boots directly to front end -> after selecting a game it flashes to a black screen -> play the game -> press 'exit' and it flashes to a black screen -> back to the front end.  Repeat.  With the safe shutdown button script installed you get one button power on/off too.  So cool.

I'll post a video and a list of all the little tweaks I made when I get a chance (removing MAME logos, installing AM theme, fixing AM centering issue, configuring controls so no ESC from AM, adding skips to mame.ini, etc.).  This is behaving exactly like I envisioned.

EDIT: I also fixed the centering issue when exiting games back to the front end:

You just have to set the ResFix-Plugin in Attract Mode.

Start AM > press TAB key > Plug-Ins > ResFix > Enabled : Yes > Specific Emulators : your_Display_Name (or leave this blank for it to apply to all of them).

Once I did this, exiting a game goes back to the list and the snap is centered like it should be.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 14, 2021, 11:58:10 am
Here’s a quick video of it in action:

https://youtu.be/TuOSZZYpEZ8

It’s perfect!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: Ond on October 14, 2021, 04:07:10 pm
Excellent. Simple, clean and quick.  Your original criteria when we were discussing the options months ago have been met.  I felt strongly then that this was a great solution.  I think there's going to be some very happy people getting some cool arcade machines  ;)
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4B
Post by: javeryh on October 14, 2021, 07:31:15 pm
Excellent. Simple, clean and quick.  Your original criteria when we were discussing the options months ago have been met.  I felt strongly then that this was a great solution.  I think there's going to be some very happy people getting some cool arcade machines  ;)
Yeah - I can’t say enough good things about this.  When I find some time I’ll make a post on the main forum giving bbegin full credit of course.  I can also list my tweaks, theme, etc. if people are interested.  I think more people need to see this solution and I get the sense that not a lot of people are on this particular forum.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 20, 2021, 07:11:51 pm
How would you react if I told you that I successfully added a fully-working LaserDisc games emulator (formerly Daphne, the updated fork is named Hypseus) to the image, so you can play games like Dragon's Lair, Space Ace and many others?

I will make the updated image file (wich include Hypseus version 2.6.16) available in a couple of minutes. :)

Note that you must use a front-end to launch your LaserDisc games (Attract Mode and AdvanceMENU are available).

Cheers!  :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: Gilrock on October 21, 2021, 07:53:58 am
Ok now you got my attention adding one of my favorites. Awesome job!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 21, 2021, 01:34:07 pm
The updated image is now available (see original post, the download URL remain the same).

PLEASE NOTE: at this time, there is an issue (minor, cosmetic) when exiting Hypseus: I get this warning message:

Code: [Select]
WARN:

Assertion failure at SDL_DestroyTexture_REAL (/home/pi/SDL2-2.0.16/src/render/SDL_render.c:3349), triggered 1 time:
  'texture && texture->magic == &texture_magic'

Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] :

The gameplay is not affected and the emulator is 100% functionnal. I need to investigate further as to why this message is displayed and if there is a way to get rid of it.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on October 21, 2021, 02:50:42 pm
How would you react if I told you that I successfully added a fully-working LaserDisc games emulator (formerly Daphne, the updated fork is named Hypseus) to the image, so you can play games like Dragon's Lair, Space Ace and many others?

I will make the updated image file (wich include Hypseus version 2.6.16) available in a couple of minutes. :)

Note that you must use a front-end to launch your LaserDisc games (Attract Mode and AdvanceMENU are available).

Cheers!  :cheers:

Awesome!  Can the laserdisc games be merged into one gamelist with the MAME games or does it need to remain separate?

Also, I posted my setup on the Main Forum (http://forum.arcadecontrols.com/index.php/topic,165744.msg1746947.html#msg1746947) and there is some interest...
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 21, 2021, 08:51:35 pm
Awesome!  Can the laserdisc games be merged into one gamelist with the MAME games or does it need to remain separate?

Also, I posted my setup on the Main Forum (http://forum.arcadecontrols.com/index.php/topic,165744.msg1746947.html#msg1746947) and there is some interest...

I think you may be able (not tested) to run your laserdisc games with a single gamelist, although you will need to edit the laserdisc entries and customize the binary location to call the hypseus binary as well as the arguments to launch your specific LD game.

Thanks for the post on the main forum, I appreciate! :)
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: 10yard on October 22, 2021, 04:18:18 am
The updated image is now available (see original post, the download URL remain the same).

PLEASE NOTE: at this time, there is an issue (minor, cosmetic) when exiting Hypseus: I get this warning message:

Code: [Select]
WARN:

Assertion failure at SDL_DestroyTexture_REAL (/home/pi/SDL2-2.0.16/src/render/SDL_render.c:3349), triggered 1 time:
  'texture && texture->magic == &texture_magic'

Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] :

The gameplay is not affected and the emulator is 100% functionnal. I need to investigate further as to why this message is displayed and if there is a way to get rid of it.

As you are building SDL2 without X11 support you may as well suppress the output of SDL warning messages - since you should already have the source code sitting on your build machine.   You could suppress this one specific message by commenting out the "CHECK_TEXTURE_MAGIC" code at line 3349 in src/render/SDL_render.c

Code: [Select]
// ** Suppress error message output **
//    CHECK_TEXTURE_MAGIC(texture, );

or you could suppress output of ALL error messages by updating /src/SDL_error.c around line 40 i.e.:

Code: [Select]
       
// ** Suppress error message output **
//va_start(ap, fmt);
//SDL_vsnprintf(error->str, ERR_MAX_STRLEN, fmt, ap);
//va_end(ap);

Compile it and install it.  Done.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 22, 2021, 03:54:27 pm
PLEASE NOTE: at this time, there is an issue (minor, cosmetic) when exiting Hypseus: I get this warning message:

Code: [Select]
WARN:

Assertion failure at SDL_DestroyTexture_REAL (/home/pi/SDL2-2.0.16/src/render/SDL_render.c:3349), triggered 1 time:
  'texture && texture->magic == &texture_magic'

Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] :


Hi,

Hypseus developer here.

I have downloaded the image from the first post, and have it running on a Pi 4.

Can you give me a quick run down, either here or PM, on how/where I would run hypseus from in 'arcademode'

Where do I place roms/m2v/ogg and framefiles in the standard setup and more importantly how I would compile and install the binary to match the default setup.

I assume you are using the 'RetroPie' branch from the hypseus repo as it's using the system libmpeg2.so.0

Also, how and where do I see the output of the logs and be able to see the assertion errors above ?

Thanks.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 22, 2021, 06:09:54 pm
PLEASE NOTE: at this time, there is an issue (minor, cosmetic) when exiting Hypseus: I get this warning message:

Code: [Select]
WARN:

Assertion failure at SDL_DestroyTexture_REAL (/home/pi/SDL2-2.0.16/src/render/SDL_render.c:3349), triggered 1 time:
  'texture && texture->magic == &texture_magic'

Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] :


Hi,

Hypseus developer here.

I have downloaded the image from the first post, and have it running on a Pi 4.

Can you give me a quick run down, either here or PM, on how/where I would run hypseus from in 'arcademode'

Where do I place roms/m2v/ogg and framefiles in the standard setup and more importantly how I would compile and install the binary to match the default setup.

I assume you are using the 'RetroPie' branch from the hypseus repo as it's using the system libmpeg2.so.0

Also, how and where do I see the output of the logs and be able to see the assertion errors above ?

Thanks.

Hi DirtBagXon,

I think I can answer your questions:
1. For now, to manually launch Hypseus and be able to see the log output, you have to switch to Service Mode (just type servicemode from an SSH session).
2. You have to expand the /data partition with the execution of ./expand-data-partition.sh
3. Place the video/audio files under /data/hypseus/framefile/<your-game>
4. Place the ROMs files (unzipped) under /data/hypseus/roms/<your-game>
5. Run Hypseus from the /home/pi/hypseus location. Take a look at the 2 launch scripts already there (Dragon's Lair and Space Ace).
6. I use the v2.6.16-RPi realease (wget https://github.com/DirtBagXon/hypseus-singe/archive/refs/tags/v2.6.16-RPi.zip)
7. Launch Hypseus in Service Mode from a SSH session, you will see the log output and the video will play on the console output of the Pi.
8. I compiled the Hypseus binary simply by following your instructions (mkdir build; cd build; cmake ../src; make -j4) - note that you may need to install cmake and build-essential packages with apt-get install.

Thanks very much for your great help!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: Vocalitus on October 22, 2021, 07:18:44 pm
PLEASE NOTE: at this time, there is an issue (minor, cosmetic) when exiting Hypseus: I get this warning message:

Code: [Select]
WARN:

Assertion failure at SDL_DestroyTexture_REAL (/home/pi/SDL2-2.0.16/src/render/SDL_render.c:3349), triggered 1 time:
  'texture && texture->magic == &texture_magic'

Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] :


Hi,

Hypseus developer here.

I have downloaded the image from the first post, and have it running on a Pi 4.

Can you give me a quick run down, either here or PM, on how/where I would run hypseus from in 'arcademode'

Where do I place roms/m2v/ogg and framefiles in the standard setup and more importantly how I would compile and install the binary to match the default setup.

I assume you are using the 'RetroPie' branch from the hypseus repo as it's using the system libmpeg2.so.0

Also, how and where do I see the output of the logs and be able to see the assertion errors above ?

Thanks.

Sorry to thread Hijack.

Hi can you fix the bug that is stopping Daphne and Hypseus from detecting the Dragonrise encoder?

No matter how you change the daphinput file, the controls are reversed for left and right and up and down does not work.

It has been a pain to get working for like ever.  Works fine on Xbox controller and keyboard so it could be a mapping issue.

Thanks.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 22, 2021, 08:26:08 pm
Hi DirtBagXon,

I think I can answer your questions:
1. For now, to manually launch Hypseus and be able to see the log output, you have to switch to Service Mode (just type servicemode from an SSH session).
2. You have to expand the /data partition with the execution of ./expand-data-partition.sh
3. Place the video/audio files under /data/hypseus/framefile/<your-game>
4. Place the ROMs files (unzipped) under /data/hypseus/roms/<your-game>
5. Run Hypseus from the /home/pi/hypseus location. Take a look at the 2 launch scripts already there (Dragon's Lair and Space Ace).
6. I use the v2.6.16-RPi realease (wget https://github.com/DirtBagXon/hypseus-singe/archive/refs/tags/v2.6.16-RPi.zip)
7. Launch Hypseus in Service Mode from a SSH session, you will see the log output and the video will play on the console output of the Pi.
8. I compiled the Hypseus binary simply by following your instructions (mkdir build; cd build; cmake ../src; make -j4) - note that you may need to install cmake and build-essential packages with apt-get install.

Thanks very much for your great help!

Hi, thanks that made it fairly straightforward. I also somehow managed to delete the repo discussion, but will put the patch here that fixes the assertions:

Code: [Select]
diff --git a/src/hypseus.cpp b/src/hypseus.cpp
index a939731..82e82ed 100644
--- a/src/hypseus.cpp
+++ b/src/hypseus.cpp
@@ -290,7 +290,7 @@ int main(int argc, char **argv)
     restore_leds(); // sets keyboard leds back how they were (this is safe even
                     // if we have the led's disabled)
 
-    SDL_Quit();
+    //SDL_Quit();
     exit(result_code);
 }
 
diff --git a/src/video/video.cpp b/src/video/video.cpp
index eed7c43..63fa1e8 100644
--- a/src/video/video.cpp
+++ b/src/video/video.cpp
@@ -440,14 +440,26 @@ void vid_free_yuv_overlay () {
 // returns true if successful, false if failure
 bool deinit_display()
 {
-    SDL_FreeSurface(g_screen_blitter);
-    SDL_FreeSurface(g_leds_surface);
 
-    SDL_DestroyTexture(g_overlay_texture);
-    SDL_DestroyTexture(g_sb_texture);
+    if (g_screen_blitter)
+        SDL_FreeSurface(g_screen_blitter);
 
-    SDL_DestroyRenderer(g_sb_renderer);
-    SDL_DestroyRenderer(g_renderer);
+    if (g_leds_surface)
+        SDL_FreeSurface(g_leds_surface);
+
+    if (g_overlay_texture)
+        SDL_DestroyTexture(g_overlay_texture);
+
+    if (g_sb_texture)
+        SDL_DestroyTexture(g_sb_texture);
+
+    if (g_sb_renderer)
+        SDL_DestroyRenderer(g_sb_renderer);
+
+/*
+    if (g_renderer)
+        SDL_DestroyRenderer(g_renderer);
+*/
 
     return (true);
 }

This is a broken display environment as far as I can currently see.

Checks to detect if the main SDL renderer is present, return that it is there, but then a subsequent attempt to remove it asserts.
Don't use `-software_scoreboard` that is within your script, it seems to leave the display in an unrecoverable state.

Also `SDL_Quit()` asserts, which is just bizzare.

The above patch should allow the emulator to exit cleanly from testing with `ace`.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 22, 2021, 08:34:52 pm
Sorry to thread Hijack.

Hi can you fix the bug that is stopping Daphne and Hypseus from detecting the Dragonrise encoder?

No matter how you change the daphinput file, the controls are reversed for left and right and up and down does not work.

It has been a pain to get working for like ever.  Works fine on Xbox controller and keyboard so it could be a mapping issue.

Thanks.

Hi,

Not certain what you are seeing here, I have an Arcade1Up with two DragonRise controllers that map fine.

Reports from RetroPie users have also successfully used DragonRise controllers without issues I am aware of.

Are you seeing the axis changes and button pushes with `jstest` ?

Are you doing the appropriate transposition of the controller number definitions in config ?

I would post my DR config, but would probably not correlate to anything like you have.

Edit: Noticed you stated "daphinput file" - Hypseus will ignore that.
It uses the hypinput,ini file and SDL2 scancode values as per the example: https://github.com/DirtBagXon/hypseus-singe/blob/master/doc/hypinput.ini
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 22, 2021, 09:11:10 pm
Hi, thanks that made it fairly straightforward. I also somehow managed to delete the repo discussion, but will put the patch here that fixes the assertions:

Code: [Select]
diff --git a/src/hypseus.cpp b/src/hypseus.cpp
index a939731..82e82ed 100644
--- a/src/hypseus.cpp
+++ b/src/hypseus.cpp
@@ -290,7 +290,7 @@ int main(int argc, char **argv)
     restore_leds(); // sets keyboard leds back how they were (this is safe even
                     // if we have the led's disabled)
 
-    SDL_Quit();
+    //SDL_Quit();
     exit(result_code);
 }
 
diff --git a/src/video/video.cpp b/src/video/video.cpp
index eed7c43..63fa1e8 100644
--- a/src/video/video.cpp
+++ b/src/video/video.cpp
@@ -440,14 +440,26 @@ void vid_free_yuv_overlay () {
 // returns true if successful, false if failure
 bool deinit_display()
 {
-    SDL_FreeSurface(g_screen_blitter);
-    SDL_FreeSurface(g_leds_surface);
 
-    SDL_DestroyTexture(g_overlay_texture);
-    SDL_DestroyTexture(g_sb_texture);
+    if (g_screen_blitter)
+        SDL_FreeSurface(g_screen_blitter);
 
-    SDL_DestroyRenderer(g_sb_renderer);
-    SDL_DestroyRenderer(g_renderer);
+    if (g_leds_surface)
+        SDL_FreeSurface(g_leds_surface);
+
+    if (g_overlay_texture)
+        SDL_DestroyTexture(g_overlay_texture);
+
+    if (g_sb_texture)
+        SDL_DestroyTexture(g_sb_texture);
+
+    if (g_sb_renderer)
+        SDL_DestroyRenderer(g_sb_renderer);
+
+/*
+    if (g_renderer)
+        SDL_DestroyRenderer(g_renderer);
+*/
 
     return (true);
 }

This is a broken display environment as far as I can currently see.

Checks to detect if the main SDL renderer is present, return that it is there, but then a subsequent attempt to remove it asserts.
Don't use `-software_scoreboard` that is within your script, it seems to leave the display in an unrecoverable state.

Also `SDL_Quit()` asserts, which is just bizzare.

The above patch should allow the emulator to exit cleanly from testing with `ace`.

Thanks very much for your help, it solved the assertion problem.

If your assumption is true about the broken display environment, then I'm wondering why MAME, Attract Mode or AdvanceMENU do not complain when exiting, I guess these will free the allocated resources before exiting?

Anyway thanks a lot, I will try to double check my video stack to make sure I did'nt introduced weird configs or incompatibilities between components.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 22, 2021, 09:18:35 pm
Hi, thanks that made it fairly straightforward. I also somehow managed to delete the repo discussion, but will put the patch here that fixes the assertions:

Code: [Select]
diff --git a/src/hypseus.cpp b/src/hypseus.cpp
index a939731..82e82ed 100644
--- a/src/hypseus.cpp
+++ b/src/hypseus.cpp
@@ -290,7 +290,7 @@ int main(int argc, char **argv)
     restore_leds(); // sets keyboard leds back how they were (this is safe even
                     // if we have the led's disabled)
 
-    SDL_Quit();
+    //SDL_Quit();
     exit(result_code);
 }
 
diff --git a/src/video/video.cpp b/src/video/video.cpp
index eed7c43..63fa1e8 100644
--- a/src/video/video.cpp
+++ b/src/video/video.cpp
@@ -440,14 +440,26 @@ void vid_free_yuv_overlay () {
 // returns true if successful, false if failure
 bool deinit_display()
 {
-    SDL_FreeSurface(g_screen_blitter);
-    SDL_FreeSurface(g_leds_surface);
 
-    SDL_DestroyTexture(g_overlay_texture);
-    SDL_DestroyTexture(g_sb_texture);
+    if (g_screen_blitter)
+        SDL_FreeSurface(g_screen_blitter);
 
-    SDL_DestroyRenderer(g_sb_renderer);
-    SDL_DestroyRenderer(g_renderer);
+    if (g_leds_surface)
+        SDL_FreeSurface(g_leds_surface);
+
+    if (g_overlay_texture)
+        SDL_DestroyTexture(g_overlay_texture);
+
+    if (g_sb_texture)
+        SDL_DestroyTexture(g_sb_texture);
+
+    if (g_sb_renderer)
+        SDL_DestroyRenderer(g_sb_renderer);
+
+/*
+    if (g_renderer)
+        SDL_DestroyRenderer(g_renderer);
+*/
 
     return (true);
 }

This is a broken display environment as far as I can currently see.

Checks to detect if the main SDL renderer is present, return that it is there, but then a subsequent attempt to remove it asserts.
Don't use `-software_scoreboard` that is within your script, it seems to leave the display in an unrecoverable state.

Also `SDL_Quit()` asserts, which is just bizzare.

The above patch should allow the emulator to exit cleanly from testing with `ace`.

Thanks very much for your help, it solved the assertion problem.  :notworthy:  :applaud:

If your assumption is true about the broken display environment, then I'm wondering why MAME, Attract Mode or AdvanceMENU do not complain when exiting, I guess these will free the allocated resources before exiting...   :dizzy:  Maybe that's because I maintain the boot splash (I use fim and it uses SDL) even after the boot is complete... I will validate if this could be the cause or not.

Anyway thanks a lot, I will try to double check my video stack to make sure I did'nt introduced weird configs or incompatibilities between components.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bobbyb13 on October 22, 2021, 10:27:41 pm
Can't wait to try this. Thank you everyone for your work on this project!
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 23, 2021, 04:28:38 am
Maybe that's because I maintain the boot splash (I use fim and it uses SDL) even after the boot is complete... I will validate if this could be the cause or not.

Yeah, that might explain why the SDL_Quit() call was having some difficulty too.

I suspect you are gonna need to patch it by default, to run and maintain, your custom environment.

All the best with this.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 23, 2021, 05:46:49 am
Sorry to thread Hijack.

Hi can you fix the bug that is stopping Daphne and Hypseus from detecting the Dragonrise encoder?

No matter how you change the daphinput file, the controls are reversed for left and right and up and down does not work.

It has been a pain to get working for like ever.  Works fine on Xbox controller and keyboard so it could be a mapping issue.

Thanks.

This may be also of interest, if the encoder is disconnecting:

https://retropie.org.uk/forum/topic/31488/solved-repeated-disconnect-of-zero-delay-usb-encoder-dragonrise/4

Hope it helps.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: Vocalitus on October 23, 2021, 07:02:31 am
Sorry to thread Hijack.

Hi can you fix the bug that is stopping Daphne and Hypseus from detecting the Dragonrise encoder?

No matter how you change the daphinput file, the controls are reversed for left and right and up and down does not work.

It has been a pain to get working for like ever.  Works fine on Xbox controller and keyboard so it could be a mapping issue.

Thanks.

Hi,

Not certain what you are seeing here, I have an Arcade1Up with two DragonRise controllers that map fine.

Reports from RetroPie users have also successfully used DragonRise controllers without issues I am aware of.

Are you seeing the axis changes and button pushes with `jstest` ?

Are you doing the appropriate transposition of the controller number definitions in config ?

I would post my DR config, but would probably not correlate to anything like you have.

Edit: Noticed you stated "daphinput file" - Hypseus will ignore that.
It uses the hypinput,ini file and SDL2 scancode values as per the example: https://github.com/DirtBagXon/hypseus-singe/blob/master/doc/hypinput.ini

Hijacking again.

I could not install Hypseus with my current installation as I was running Jessie on the Pi3.
I wiped the card and installed Buster.
Installed Daphne which went perfectly.

Visited: https://github.com/DirtBagXon/hypseus-singe/blob/master/src/3rdparty/retropie/RETROPIE.md

Followed the tut.  Installation failed with errors after cmake ../src

Quote
-- Detected 32bit: Compiling with -D_FILE_OFFSET_BITS=64
-- Checking for one of the modules 'SDL2_ttf'
CMake Error at /usr/share/cmake-3.13/Modules/FindPkgConfig.cmake:679 (message):
  None of the required 'SDL2_ttf' found
Call Stack (most recent call first):
  CMakeLists.txt:54 (PKG_SEARCH_MODULE)


-- Checking for one of the modules 'SDL2_image'
CMake Error at /usr/share/cmake-3.13/Modules/FindPkgConfig.cmake:679 (message):
  None of the required 'SDL2_image' found
Call Stack (most recent call first):
  CMakeLists.txt:55 (PKG_SEARCH_MODULE)


-- Checking for one of the modules 'libmpeg2'
CMake Error at /usr/share/cmake-3.13/Modules/FindPkgConfig.cmake:679 (message):
  None of the required 'libmpeg2' found
Call Stack (most recent call first):
  CMakeLists.txt:56 (PKG_SEARCH_MODULE)


-- Target: Linux armv6
-- Version: v2.6.16-RPi-1
-- Configuring incomplete, errors occurred!

So this is for the Pi4 only?  Just noticed the last line.  PizeroW has the arm6.  Have I compiled the wrong version?
 
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 23, 2021, 08:04:34 am

Hijacking again.

I could not install Hypseus with my current installation as I was running Jessie on the Pi3.
I wiped the card and installed Buster.
Installed Daphne which went perfectly.

Visited: https://github.com/DirtBagXon/hypseus-singe/blob/master/src/3rdparty/retropie/RETROPIE.md

Followed the tut.  Installation failed with errors after cmake ../src

Quote
-- Detected 32bit: Compiling with -D_FILE_OFFSET_BITS=64
-- Checking for one of the modules 'SDL2_ttf'
CMake Error at /usr/share/cmake-3.13/Modules/FindPkgConfig.cmake:679 (message):
  None of the required 'SDL2_ttf' found
Call Stack (most recent call first):
  CMakeLists.txt:54 (PKG_SEARCH_MODULE)


-- Checking for one of the modules 'SDL2_image'
CMake Error at /usr/share/cmake-3.13/Modules/FindPkgConfig.cmake:679 (message):
  None of the required 'SDL2_image' found
Call Stack (most recent call first):
  CMakeLists.txt:55 (PKG_SEARCH_MODULE)


-- Checking for one of the modules 'libmpeg2'
CMake Error at /usr/share/cmake-3.13/Modules/FindPkgConfig.cmake:679 (message):
  None of the required 'libmpeg2' found
Call Stack (most recent call first):
  CMakeLists.txt:56 (PKG_SEARCH_MODULE)


-- Target: Linux armv6
-- Version: v2.6.16-RPi-1
-- Configuring incomplete, errors occurred!

So this is for the Pi4 only?  Just noticed the last line.  PizeroW has the arm6.  Have I compiled the wrong version?


I think you missed the first line of that tutorial:

Code: [Select]
sudo apt-get install libmpeg2-4-dev libsdl2-image-dev libsdl2-ttf-dev
The errors do tell you what's missing.

However, assuming you are using RetroPie:  You would be better using the RetroPie-Setup script currently in a pull request detailed here:

https://retropie.org.uk/forum/topic/31155/integrate-daphne-emulator-back-into-the-retropie-script-for-ubuntu/14?_=1634990585290

arm6/arm7 is fine, I have it running on a Pi Zero:

https://www.youtube.com/watch?v=4vbcd5EfRkE&list=PLRLuhkf2c3OeRoXydn0upKyIBUXNMK13x&index=13


Note: You will need to keep (recode) the bitrate low on those m2v files for the zero (640/720x480 only)

Also note, that the Zero doesn't have enough RAM to compile some of the assembly routines by default.
The RetroPie-Setup script should take care of that for you, otherwise you will have to set some swap for successful compilation.


Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: Vocalitus on October 23, 2021, 09:55:32 am
Thanks.

Reminds me when I tried to run Daphne on a P2 64mb.

Mpeg 1 if I remember correctly.   :)
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 23, 2021, 11:31:26 am
Thanks.

Reminds me when I tried to run Daphne on a P2 64mb.

Mpeg 1 if I remember correctly.   :)

MPEG-2 actually but yeah.

Also to confirm, the swap is only needed for the compilation on the Pi Zero, not to run. Although there are better choices of Pi model for resources....


Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: Vocalitus on October 23, 2021, 07:49:18 pm
Thanks for the help.

Singe is installed and working.

Cool video showing the pizero in action.

Are you restricted to hand held screen sizes or will it display in 640x480?

Nice work!  :applaud:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 23, 2021, 08:44:15 pm
Thanks for the help.

Singe is installed and working.

Cool video showing the pizero in action.

Are you restricted to hand held screen sizes or will it display in 640x480?

Nice work!  :applaud:

For the Pi Zero, the resolution remains at 640x480 (for the overlays) but I reduced the bitrate with ffmpeg. The .ogg files were unchanged.

I should also note that Hypseus will play upscaled, and enhanced, 4k m2v files (they are out there) with the Daphne ROMS.

Even the Pi4 will struggle at that resolution, but Linux Desktops, or the Windows Port, will handle them with any reasonable CPU.

e.g.

(https://snoopimages.com/images/2021/08/05/hypseus-36.png)

(https://snoopimages.com/images/2021/09/08/sdq-2.png)





Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 23, 2021, 11:22:29 pm
Just to let you know the availability of the updated image file wich includes the patched Hypseus binary, now fully functionnal. Big thanks to DirtBagXon for his great help!

The download link remain the same, please see original post of this thread.

Some quick informations:

Enjoy!  :cheers:
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: Vocalitus on October 24, 2021, 03:24:45 am
Thanks for the help.

Singe is installed and working.

Cool video showing the pizero in action.

Are you restricted to hand held screen sizes or will it display in 640x480?

Nice work!  :applaud:

For the Pi Zero, the resolution remains at 640x480 (for the overlays) but I reduced the bitrate with ffmpeg. The .ogg files were unchanged.

I should also note that Hypseus will play upscaled, and enhanced, 4k m2v files (they are out there) with the Daphne ROMS.

Even the Pi4 will struggle at that resolution, but Linux Desktops, or the Windows Port, will handle them with any reasonable CPU.

e.g.

(https://snoopimages.com/images/2021/08/05/hypseus-36.png)

(https://snoopimages.com/images/2021/09/08/sdq-2.png)

I didn't know there was a windows port. 

Is there an executable or do I have to compile it myself?

I have the old Singe 2.0 installed already.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on October 24, 2021, 08:06:28 am
I didn't know there was a windows port. 

Is t an executable or do I have to compile it myself?

I have the old Singe 2.0 installed already.

There are compiled Windows executables on the main repo: https://github.com/DirtBagXon/hypseus-singe (https://github.com/DirtBagXon/hypseus-singe)

Also it should compile on Mac OSX

There is no frontend for the Windows port (happy to accept contributions here), it is run from .bat files or could use Windows Frontends like Launchbox I suspect.

So you will need to construct the .bat files to your preference, I put a zip with example defaults in the repo as a starting point.

The 'extended' argument list for all versions of Hypseus are here: https://github.com/DirtBagXon/hypseus-singe#extended-arguments-and-keys

This is getting all very off-topic for the thread now, so will leave it there.

Thanks to @bbegin for the inclusion in this image.  :applaud:

Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: nitrogen_widget on October 25, 2021, 06:34:30 pm
not sure if mentioned yet but, there was a recent bios update for the rpi4 and rp400 that lets you boot and run the OS from an SSD using a cheap usb3 to SSD adaptor.
no extra power needed.
no Sdcard to tell it to boot off usb needed either.

I have my 2gb rpi4 hooked up now and it's fast to boot and load stuff.
not doing arcade with it (amiga 500 stuff).
I imagine compile times for something like this would go noticeably faster.
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 26, 2021, 04:57:17 pm
I was able to pick up a PI4 today and I got this installed. It works really great. BUT...I need to use RGB Commander for the U360 joystick (unless you have a way to set the mode for each game). I cannot install because the main part of the card is read only (I'm assuming that is the problem). Any ideas on how to make that work so it will set the joystick mode for each game?

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 26, 2021, 07:59:49 pm
I was able to pick up a PI4 today and I got this installed. It works really great. BUT...I need to use RGB Commander for the U360 joystick (unless you have a way to set the mode for each game). I cannot install because the main part of the card is read only (I'm assuming that is the problem). Any ideas on how to make that work so it will set the joystick mode for each game?

J_K_M_A_N

Hi J_K_M_A_N,

I don't know what RGB Commander is, but if you want to make changes to the root filesystem (the partition kept in read-only mode), you just have to issue the "rw" command, from a shell. You make your changes and once done, to go back to read-only mode, either logout, reboot or issue the "ro" command.

If you want to configure a particular joystick mapping, you do not need to put the root filesystem in read/write mode. Instead, just make sure you put the .cfg file of your U360 joystick under /data/mame/ctrlr and tell MAME to use this mapping, by default by editing /data/mame/ini/mame.ini and specifying your .cfg file under the "ctrlr" directive (no need to put the .cfg extension). If you only want specific games to use your U360 joystick, just put a file with the name of the romname of the game under /data/mame/ini with the .ini extension and put the "ctrlr" directive in there. Do this for each game you want to use your U360 joystick.

I hope this helps,

Benoit
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 26, 2021, 08:59:03 pm
Do you know how the U360 works? You can "upload" a configuration to the joystick so it will act like a 4 way or 8 way or even 2 way or diagonal 4 way (for Q*Bert). RGB commander is mostly used for LED buttons and lights but it also handles the U360 configurations and it automatically loads them for each game you want to play. It uses an XML file that has things like this.

Code: [Select]
ULTRASTIK 360s (These are the different settings you can use)
###################
Valid values:
   4 4-Way
   8 8-Way
   10 2-Way, Left & Right
   11 2-Way, Up & Down
   12 4-Way, Diagonals Only (Qbert, Zaxxon, Congo Bongo)
   13 4-Way, No Sticky, Up-Down bias (no joystick play in the center. Good for fast movements)
   20 8-Way Easy Diagonals (fighting games)
   21 Analog (Sinistar, Arch Rivals, Pigskin 621 AD)
   22 Mouse Pointer
Any invalid value greater than 4 will default to 8-way

Then you can add entries for each game like so.

Code: [Select]
        <rom id="dkong" way="13">
<control name="P1_COIN" colour="Blue"/>
<control name="P1_START" colour="Blue"/>
<control name="P1_BUTTON1" colour="Orange"/>
<control name="P1_JOYSTICK" colour="Black"/>
<control name="P2_COIN" colour="Blue"/>
<control name="P2_START" colour="Blue"/>
<control name="P2_BUTTON1" colour="Orange"/>
<control name="P2_JOYSTICK" colour="Black"/>
</rom>
<rom id="dkongx" way="13">

</rom>
        <rom id="qbert" way="12">
<control name="P1_COIN" colour="Red"/>
<control name="P1_START" colour="Red"/>
<control name="P1_JOYSTICK" colour="Black"/>
<control name="P2_COIN" colour="Red"/>
<control name="P2_START" colour="Red"/>
<control name="P2_JOYSTICK" colour="Black"/>
</rom>

The control name and color is for the LEDs (that I don't use) but the "way=" is for which setting the U360 should use.

So I think I need to make the root file system read-write, at least to load RGB Commander. Do I just type "rw" in SSH in a certain directory? Sorry, I don't know much about Linux at all. Thanks for the help.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 26, 2021, 09:49:58 pm
Hi J_K_M_A_N,

I read your post on RGB Commander to better understand how it is working under the hood. The setup script basically create a systemd unit (a service in the Windows world) to upload the config files to the hardware.

http://forum.arcadecontrols.com/index.php?topic=165288.0

The problem is see with the details I read is about the logging of the daemon to this location:

/usr/sbin/rgbcommander/rgbcmdd.log

This location is read-only, so the daemon will not be able to create this file, per se. We can overcome this with a symlink (a pointer to another location).

I suggest you create the symlink this way (once the installation is done, but with the daemon stopped):

Code: [Select]
rw                                      # This alias can be executed from any location
cd /home/pi/RGBInstall        # Provided you unzipped RGB Commander files at this location
sudo ./setup.sh install
sudo systemctl stop rgbcommander
if [ -f /usr/sbin/rgbcommander/rgbcmdd.log ]; then sudo rm /usr/sbin/rgbcommander/rgbcmdd.log; fi
ln -s /var/log/rgbcmdd.log /usr/sbin/rgbcommander/rgbcmdd.log
sudo systemctl start rgbcommander
sudo systemctl status rgbcommander
cat /var/log/rgbcmdd.log    # To make sure the symlink is working as expected and to troubleshoot RGB Commander.
ro                                      # This alias can be executed from any location

Everytime you have to modify your config files (xml files), you should:

Code: [Select]
rw         # This alias can be executed from any location
nano /<location of your rgbcmdd.xml file>/rgbcmdd.xml
ro          # This alias can be executed from any location
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 26, 2021, 10:10:15 pm
Fantastic. Thank you so much for looking into that.  :cheers: I will try it tomorrow as soon as I can and let you know how it goes.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 27, 2021, 08:56:14 am
I gave it a shot but I cannot get it to work. I think it was made with Retropie in mind. I took out the retropie="1" in the mame entries but the log shows a socket failed error.

Code: [Select]
17/04/21 12:37:52 [DEBUG] [processMonitorWorker] starting processMonitorWorker
17/04/21 12:37:52 [INFO] [startListening] selectserver: listening on IP 0.0.0.0, socket 11
17/04/21 12:37:52 [WARNING] [startListening] selectserver: socket failed, error: 97

I do not know Linux and RGB Commander enough to figure out how to make it hook this version of Mame. I am going to keep trying though. I will probably switch to attract mode and see if I can't figure that out somehow. Thanks again for the help.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 27, 2021, 10:27:11 am
Hi J_K_M_A_N,

I suspect that the rgbcommander service unit needs to write something somewhere while starting/initializing. We can overcome this on a read-only root filesystem with a systemd drop-in file (a customization of a service, if you will).

To do this:

Code: [Select]
rw
sudo mkdir /etc/systemd/system/rgbcommander.service.d
sudo nano /etc/systemd/system/rgbcommander.service.d/readonlyfs-fixup.conf

Paste those lines below and save:

Code: [Select]
[Service]
ExecStartPre=/bin/sh  -c "mount -o remount,rw /"
ExecStartPost=/bin/sh -c "mount -o remount,ro /"

Then, restart rgbcommander service unit and show status:

Code: [Select]
ro
sudo systemctl restart rgbcommander.service
systemctl status rgbcommander.service

Can you please include the output of the last command (systemctl status rgbcommander.service) here?
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 27, 2021, 11:06:02 am
Here you go.

Code: [Select]
pi@arcade(rw):~/RGBCommander$ systemctl status rgbcommander.service
● rgbcommander.service - RGBcommander arcade led and joystick daemon
   Loaded: loaded (/etc/systemd/system/rgbcommander.service; enabled; vendor pre
  Drop-In: /etc/systemd/system/rgbcommander.service.d
           └─readonlyfs-fixup.conf
   Active: active (running) since Wed 2021-10-27 11:04:23 EDT; 33s ago
 Main PID: 910 (rgbcmdd)
    Tasks: 8 (limit: 4915)
   CGroup: /system.slice/rgbcommander.service
           └─910 /usr/sbin/rgbcommander/rgbcmdd

Oct 27 11:04:23 arcade systemd[1]: Starting RGBcommander arcade led and joystick
Oct 27 11:04:23 arcade systemd[1]: Started RGBcommander arcade led and joystick
Oct 27 11:04:26 arcade rgbcmdd[909]: sh: 1: /usr/sbin/rgbcommander/scripts/OnDae

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 27, 2021, 11:15:05 am
Here you go.

Code: [Select]
pi@arcade(rw):~/RGBCommander$ systemctl status rgbcommander.service
● rgbcommander.service - RGBcommander arcade led and joystick daemon
   Loaded: loaded (/etc/systemd/system/rgbcommander.service; enabled; vendor pre
  Drop-In: /etc/systemd/system/rgbcommander.service.d
           └─readonlyfs-fixup.conf
   Active: active (running) since Wed 2021-10-27 11:04:23 EDT; 33s ago
 Main PID: 910 (rgbcmdd)
    Tasks: 8 (limit: 4915)
   CGroup: /system.slice/rgbcommander.service
           └─910 /usr/sbin/rgbcommander/rgbcmdd

Oct 27 11:04:23 arcade systemd[1]: Starting RGBcommander arcade led and joystick
Oct 27 11:04:23 arcade systemd[1]: Started RGBcommander arcade led and joystick
Oct 27 11:04:26 arcade rgbcmdd[909]: sh: 1: /usr/sbin/rgbcommander/scripts/OnDae

J_K_M_A_N

Ok, I see that the daemon/service is at state "active (running)", si it is a good start.

Did you issue the "ro" command to switch back to read-only (I see the Bash prompt is indicating we are in read/write mode)?

Is RGB Commander leds are now working? Is your U360 joystick is wirking as expected?
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 27, 2021, 11:19:17 am
I am still getting the socket failed error. Here is the whole log after a reboot and launching a game.

Code: [Select]
17/04/21 12:37:49  _____ _____ _____                               _         
17/04/21 12:37:49 | __  |   __| __  |___ ___ _____ _____ ___ ___ _| |___ ___
17/04/21 12:37:49 |    -|  |  | __ -|  _| . |     |     | .'|   | . | -_|  _|
17/04/21 12:37:49 |__|__|_____|_____|___|___|_|_|_|_|_|_|__,|_|_|___|___|_| 0.4.0.5
17/04/21 12:37:49 Copyright 2015-2018 Gijsbrecht De Waegeneer
17/04/21 12:37:49 RGBcommander 0.4.0.5 linux
17/04/21 12:37:49 a *nix arcade cabinet led and joystick driver
17/04/21 12:37:49 
17/04/21 12:37:49 compilation date Dec 23 2017 18:53:06
17/04/21 12:37:49 
17/04/21 12:37:49 [INFO] [Init] installation directory -> /usr/sbin/rgbcommander/
17/04/21 12:37:49 [INFO] [Init] daemon binary -> rgbcmdd
17/04/21 12:37:49 [INFO] [Init] working directory set to -> /usr/sbin/rgbcommander/
17/04/21 12:37:49 [INFO] [Init] minimame binary build source -> 0.187 (mame0187) -> processed 38098 structures
17/04/21 12:37:49 [INFO] [Init] processed 0 buttons
17/04/21 12:37:50 [DEBUG] [Hardware] constructed U360_1 hwthrottle -> 417
17/04/21 12:37:50 [INFO] [create360Maps] U360_1 -> physical restrictor absent (default)
17/04/21 12:37:50 [INFO] [Init] processed Joystick U360_1
17/04/21 12:37:50 [INFO] [Init] daemon listening port number 2724
17/04/21 12:37:50 [INFO] [Init] blinking mame led mappings : led 0 -> P1_START led 1 -> P2_START led 2 -> P1_BUTTON1
17/04/21 12:37:50 [INFO] [Init] joystick way override insertion for rom entry arcade -> dkong -> 10
17/04/21 12:37:50 [INFO] [Init] joystick way override insertion for rom entry arcade -> dkongx -> 13
17/04/21 12:37:50 [INFO] [Init] joystick way override insertion for rom entry arcade -> galaga -> 10
17/04/21 12:37:50 [INFO] [Init] joystick way override insertion for rom entry arcade -> galagamf -> 10
17/04/21 12:37:50 [INFO] [Init] joystick way override insertion for rom entry arcade -> joust -> 10
17/04/21 12:37:50 [WARNING] [Init] likely incorrect rom name detected -> machridr -> arcade
17/04/21 12:37:50 [WARNING] [Init] likely incorrect rom name detected -> mightybj -> arcade
17/04/21 12:37:50 [WARNING] [Init] likely incorrect rom name detected -> platoon -> arcade
17/04/21 12:37:50 [INFO] [Init] joystick way override insertion for rom entry arcade -> qbert -> 12
17/04/21 12:37:51 [INFO] [Init] joystick way override insertion for rom entry arcade -> sinistar -> 21
17/04/21 12:37:52 [INFO] [Init] static maps defined -> true
17/04/21 12:37:52 [INFO] [Init] # defined emulators in data structure -> 7
17/04/21 12:37:52 [INFO] [Init] -> arcade
17/04/21 12:37:52 [INFO] [Init] -> mame
17/04/21 12:37:52 [INFO] [Init] -> mame-advmame
17/04/21 12:37:52 [INFO] [Init] -> megadrive
17/04/21 12:37:52 [INFO] [Init] -> n64
17/04/21 12:37:52 [INFO] [Init] -> psx
17/04/21 12:37:52 [INFO] [Init] -> snes
17/04/21 12:37:52 [INFO] [Init] # defined process to watch -> 4
17/04/21 12:37:52 [INFO] [Init] -> mame-advmame
17/04/21 12:37:52 [INFO] [Init] -> mame
17/04/21 12:37:52 [INFO] [Init] -> arcade
17/04/21 12:37:52 [INFO] [Init] -> retroarch
17/04/21 12:37:52 [INFO] [Init] # emulators defined as retropie (retroarch cores and/or normal processes) -> 4
17/04/21 12:37:52 [INFO] [Init] -> megadrive
17/04/21 12:37:52 [INFO] [Init] -> snes
17/04/21 12:37:52 [INFO] [Init] -> n64
17/04/21 12:37:52 [INFO] [Init] -> psx
17/04/21 12:37:52 [INFO] [Init] # emulators defined as arcade (mame derivates) -> 3
17/04/21 12:37:52 [INFO] [Init] -> mame-advmame
17/04/21 12:37:52 [INFO] [Init] -> mame
17/04/21 12:37:52 [INFO] [Init] -> arcade
17/04/21 12:37:52 [INFO] [Init] # retropie folder to process mappings -> 4
17/04/21 12:37:52 [INFO] [Init] psx -> retroarch
17/04/21 12:37:52 [INFO] [Init] n64 -> retroarch
17/04/21 12:37:52 [INFO] [Init] snes -> retroarch
17/04/21 12:37:52 [INFO] [Init] megadrive -> retroarch
17/04/21 12:37:52 [INFO] [Init] processed 3 flash animations
17/04/21 12:37:52 [INFO] [Init] processed 80 animations
17/04/21 12:37:52 [INFO] [Init] total Init processing time -> 2.88101s
17/04/21 12:37:52 [DEBUG] [ControlPanel] constructed ControlPanel
17/04/21 12:37:52 [INFO] [execOutputHook] exec hook -> "/usr/sbin/rgbcommander/scripts/OnDaemonStart.sh"
17/04/21 12:37:52 [INFO] [main] successfully created ControlPanel abstraction
17/04/21 12:37:52 [INFO] [rgbcmddMsgQueue] starting rgbcmdd message queue thread
17/04/21 12:37:52 [INFO] [mamefifo] starting sdlmame monitoring thread
17/04/21 12:37:52 [INFO] [mameNetworkCommunicator] mameNetworkCommunicator started
17/04/21 12:37:52 [INFO] [processMonitor] awaiting FrontEnd (emulationstatio) start...
17/04/21 12:37:52 [DEBUG] [processMonitorWorker] starting processMonitorWorker
17/04/21 12:37:52 [INFO] [startListening] selectserver: listening on IP 0.0.0.0, socket 10
17/04/21 12:37:52 [WARNING] [startListening] selectserver: socket failed, error: 97

Not sure if any of that helps. :( I am not sure if I have the xml file set correctly either. So it could be that it is not, and that is the cause of the error. I just don't know enough about RGB Commander or Linux to know for sure. It looks like it can be used in Linux WITHOUT retropie but I may not have it set correctly. Sorry I cannot be more help.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 27, 2021, 11:52:55 am
I just tested the RGB software to see if it would set the stick into different modes and that part does work (not surprised).

Code: [Select]
27/10/21 11:36:40 [INFO] [startListening] selectserver: new connection from 127.0.0.1, socket 13
27/10/21 11:36:54 [INFO] [startListening] eot detected on socket - clearing socket buffer 13
27/10/21 11:36:54 [INFO] [startListening] processing command  set,stick,10
27/10/21 11:36:54 [INFO] [processCmd] #args is 3
27/10/21 11:36:54 [INFO] [processCmd] set
27/10/21 11:36:54 [INFO] [processCmd] stick
27/10/21 11:36:54 [INFO] [processCmd] 10
27/10/21 11:36:54 [INFO] [setStick] committing state to joystick hardware -> U360_1
27/10/21 11:36:54 [INFO] [setWay] setting U360_1 to 10 (2-Way, Left & Right)  success
27/10/21 11:38:14 [INFO] [startListening] eot detected on socket - clearing socket buffer 13
27/10/21 11:38:14 [INFO] [startListening] processing command  set,stick,13
27/10/21 11:38:14 [INFO] [processCmd] #args is 3
27/10/21 11:38:14 [INFO] [processCmd] set
27/10/21 11:38:14 [INFO] [processCmd] stick
27/10/21 11:38:14 [INFO] [processCmd] 13
27/10/21 11:38:14 [INFO] [setStick] committing state to joystick hardware -> U360_1
27/10/21 11:38:14 [INFO] [setWay] setting U360_1 to 13 (4-Way, No Sticky (UD Bias))  success
27/10/21 11:49:20 [INFO] [startListening] eot detected on socket - clearing socket buffer 13
27/10/21 11:49:20 [INFO] [startListening] processing command  exit
27/10/21 11:49:20 [INFO] [processCmd] #args is 1
27/10/21 11:49:20 [INFO] [processCmd] exit
27/10/21 11:49:26 [INFO] [startListening] eot detected on socket - clearing socket buffer 13
27/10/21 11:49:26 [INFO] [startListening] processing command  disconnect
27/10/21 11:49:26 [INFO] [processCmd] #args is 1
27/10/21 11:49:26 [INFO] [processCmd] disconnect
27/10/21 11:49:26 [INFO] [startListening] selectserver: socket 13 gracefully disconnected

I just don't see how to make it hook into MAME and work.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 27, 2021, 12:16:53 pm
@J_K_M_A_N,

If you want to hook it up to MAME, you need to use the current version MAME binary, wich is located under /home/pi/mame. The configuration file (mame.ini) of this binary MAME is located under /home/pi/.mame/ini.

I read on the RGB Commander website (http://users.telenet.be/rgbcommander/) that MAME up to version 0.199 is working OK with the daemon's communication system, but starting from 0.200, it's broken:

Quote
Linux : ? <-> 0.200 <-> ? - Mame's communication system has been fixed but it functions differently then before rendering the daemon's communication system useless.

So, to recap, the new communication system functions from 0.188 up to maximum 0.192....
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 27, 2021, 12:58:39 pm
@J_K_M_A_N,

If you want to hook it up to MAME, you need to use the current version MAME binary, wich is located under /home/pi/mame. The configuration file (mame.ini) of this binary MAME is located under /home/pi/.mame/ini.

I read on the RGB Commander website (http://users.telenet.be/rgbcommander/) that MAME up to version 0.199 is working OK with the daemon's communication system, but starting from 0.200, it's broken:

Quote
Linux : ? <-> 0.200 <-> ? - Mame's communication system has been fixed but it functions differently then before rendering the daemon's communication system useless.

So, to recap, the new communication system functions from 0.188 up to maximum 0.192....

Well, that is a bummer. :( I guess I will have to figure something else out. Thanks again for all your help. I really like the build. I like using the newest version of Mame. The emulation is really nice (and no sound samples for Donkey Kong). I also really like how simple it is. No extra clutter. Oh well.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 27, 2021, 03:51:09 pm
So I was able to make separate INI files for each game and I can use the joystick_map in those INI files. I think this will work.  :applaud:

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on October 27, 2021, 05:20:25 pm
One last question. Can I make the sound come out of the 3.5 jack instead of HDMI? I have a small amp hooked up to some speakers. The monitor doesn't have audio out. Thanks.

EDIT: Never mind. I found it.

In case anyone else needs the info, SSH into the PI and use the following commands:
Code: [Select]
rw
sudo raspi-config
     Then go into the main settings and then audio and change it from HDMI to Audio Jack (whatever that option was)
ro
exit

Then it should be working. You may have to reboot for the setting to be set.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.236 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on October 31, 2021, 10:08:57 am
Awesome - glad to see someone else using this! 

Thanks for the note on how to get audio out of the headphone jack.  I will definitely need to do this for my final build.
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on October 31, 2021, 01:46:08 pm
Just to let you know the availability of the NEW disk image file with MAME 0.237 (please see the original post of this thread for the download link).  :cheers:

The Hypseus binary has been updated to v2.6.17-RPi, wich fix the SDL assertion problem I had previously, so no more patching is required prior to build.  :D

Please note that you will need to move your High-Scores files from /data/mame/hi to /data/mame/lua/hiscore, or alternatively make a symlink like this (prior to the first execution of MAME 0.237):

Code: [Select]
ln -s /data/mame/hi /data/mame/lua/hiscore
Enjoy!
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: Samson on October 31, 2021, 01:49:31 pm
Just want to add another big thanks for all the work that went in to this.   I built a bartop using this image with Attract Mode and the Nevato theme and it turned out great!
Thanks again :)
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on November 01, 2021, 02:39:28 pm
I want to take the time to thank everyone of you who helped me and supported me with this custom Raspberry Pi 4 MAME/arcade image.

Your kind words and appreciation is a great payback for me.

Thanks again, everyone! :cheers:
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: DirtBagXon on November 01, 2021, 09:04:21 pm
The Hypseus binary has been updated to v2.6.17-RPi, wich fix the SDL assertion problem I had previously, so no more patching is required prior to build.  :D

Excellent news to know it fixed the assertions on this image too, sorry I didn't catch it first time :)

DBX
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on November 02, 2021, 09:00:30 pm
GPIOnext works on this as well. I recommend that for admin buttons (especially if they are attached to the box and not the CP). Here are some quick instructions for installing that.

First, you need to wire at least one button to the GPIO pins. Use a ground and one of the open pins (I start with green but you can usually use the yellow also).

(http://forum.arcadecontrols.com/index.php?action=dlattach;topic=164992.0;attach=389254;image)

Then SSH into the PI (putty or whatever).

Code: [Select]
rw
cd ~
git clone https://github.com/mholgatem/GPIOnext.git
bash GPIOnext/install.sh

After it gets installed (takes a few minutes), hit 'y' to go into the setup. I set mine up as a keyboard as they are admin buttons. It then gives you a list of pretty much all the keys on the keyboard and you scroll down to each that you want to set up and hit SPACE (it will show an 'X' for that key). Once you select all the keys you want to set up, hit ENTER and it will ask you to hold down the button for each key you selected to set up. Hold it down until it says to release the button (and even a second or two longer), then it should go to the next key. Once you are done, you can go to EXIT. Once you exit, you can reboot or just type 'gpionext start'.

If you need to reconfigure the keys (or add some keys), you can stop the service by typing 'gpionext stop' and then 'gpionext config'. Just be sure to start it again after you are done (or reboot).

One thing I also do. When the service is stopped, I use this command.

Code: [Select]
gpionext set debounce 1
That will lower the debounce value which seems to work better for me. The default is 20 (I think for combo buttons..look it up if you want).

Thanks again for the build. I like it. The newer MAME has the joystick maps that work with the U360 so I don't need to mess with RGBCommander. I just leave my U360 in analog mode and use INI files for the joystick maps.  :applaud:

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: Samson on November 04, 2021, 01:34:50 pm
GPIOnext works on this as well.

Can confirm,  made a two player bartop with total of 2 joys, 12 player buttons, 2 player start and 2 coin buttons using just GPIO and it worked perfectly. ( no specific admin buttons, just combos for escape and shutdown. )

I really like this image!
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on November 05, 2021, 12:08:10 pm
GPIOnext works on this as well. I recommend that for admin buttons (especially if they are attached to the box and not the CP).

So no keyboard encoder or joystick encoder is required?  I'm only going to use a 4-way, 2 action buttons and 4 admin buttons (P1 start, P2 start, Pause and P1 Coin with Exit being set up as a P1 start + Pause combo).  10 total inputs although maybe 11 with P2 Coin since I have a 2P coin door.  Is this doable with just the GPIO pins on the pi4?
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: PL1 on November 05, 2021, 01:24:50 pm
10 total inputs although maybe 11 with P2 Coin since I have a 2P coin door.  Is this doable with just the GPIO pins on the pi4?
There are 12 "green" pins available so yes, it is easily doable.

(http://forum.arcadecontrols.com/index.php?action=dlattach;topic=164992.0;attach=389254;image)


Scott
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on November 05, 2021, 01:40:51 pm
You can also use the yellow if you are not using a PiTFT, I2C, Serial or I2S (you COULD be using the PiTFT for a project like this but probably not the other 3).

There is also a program called Retrogame that works with the GPIO pins. I have used both. I like GPIOnext just because it is easier to set up. Retrogame uses cfg files that look something like this.

Code: [Select]
# Sample configuration file for retrogame.
# Really minimal syntax, typically two elements per line w/space delimiter:
# 1) a key name (from keyTable.h; shortened from /usr/include/linux/input.h).
# 2) a GPIO pin number; when grounded, will simulate corresponding keypress.
# Uses Broadcom pin numbers for GPIO.
# If first element is GND, the corresponding pin (or pins, multiple can be
# given) is a LOW-level output; an extra ground pin for connecting buttons.
# A '#' character indicates a comment to end-of-line.
# File can be edited "live," no need to restart retrogame!

# Here's a 6-button configuration:

UP         4  # '4 WAY UP' button/direction
DOWN      17  # '4 WAY DOWN' button/direction
LEFT      27  # '4 WAY LEFT' button/direction
RIGHT     22  # '4 WAY RIGHT' button/direction
A         18  # 'A' button
S         23  # 'B' button
C         24  # 'C' button
P         25  # 'PAUSE' button
L          8  # 'SPEED UP' button
W          7  # 'COIN' button
ESC       12  # 'EXIT' button - ESCAPE
X         20  # 'PLAYER 2 START' button - SELECT
Z         21  # 'PLAYER 1 START' button - START
UP         5  # '8 WAY UP' button/direction
DOWN       6  # '8 WAY DOWN' button/direction
LEFT      13  # '8 WAY LEFT' button/direction
RIGHT     19  # '8 WAY RIGHT' button/direction
F4   16  # Load State Button
F2   26  # Save State Button
ENTER  20 21  # Hold Start+Select to hit ENTER

# For configurations with few buttons (e.g. Cupcade), a key can be followed
# by multiple pin numbers.  When those pins are all held for a few seconds,
# this will generate the corresponding keypress (e.g. ESC to exit ROM).
# Only ONE such combo is supported within the file though; later entries
# will override earlier.

And I think it only acts like a joystick. The nice thing about it is the ability to have a kind of hotkey (see "ENTER" above).

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: Samson on November 07, 2021, 11:10:50 am
For anyone interested, I put together a list of roms for the pi 4 build I recently made. To create the list,  I started with the 'all killer no filler' lists, and cross checked them against the pi4 benchmarks from here : https://www.retrorgb.com/raspberry-pi-mame-benchmarks.html (https://www.retrorgb.com/raspberry-pi-mame-benchmarks.html). 

Anything that ran under about 115% was removed.    The benchmarks were on a slightly older mame, so I manually removed a few games that seemed to be unplayable, like Astroblaster.  Asteroids deluxe, Star Castle and a few other games also ran poorly and were removed.  I didn't have time to extensively play all the games in the list, but I did at least start them all and in general see if they seemed to be working correctly.   I did try to remove obvious clones and dupes, favoring US versions of games.   At the end, there were about 465 games total.  ( Games using two joysticks like Robotron are included, so if you have a single player cab you might want to remove )

Romlists.7z contains several romlists generated for attract mode, broken into a few categories.  Hopefully the categories are self explanatory.  ( Classic arcade is just a personal list and not meant to be comprehensive. )  I did my best to remove clones and dupes from the lists, and place them in alphabetic order.  ( games that start with 'the' are listed under the first letter of the game name, not under 't' for example )

Romnames.txt contain the names of the roms needed to launch all the games in these lists.


Here is a link to the artwork files for Attract Mode for all the roms in these lists.  This should include the marquees, vids, flyer art, and 'wheel' art for all the games in the rom lists.  I had to create a few wheel and marquee images as I couldn't seem to find a complete art set - maybe you had better luck :) 
https://drive.google.com/file/d/1jSObAt-xrPtZE3ekeuQEa3iP5QXCfSRZ/view?usp=sharing (https://drive.google.com/file/d/1jSObAt-xrPtZE3ekeuQEa3iP5QXCfSRZ/view?usp=sharing)

Attract.7z is the zipped attract mode folder from my build, minus the art.  It uses the Nevato theme ( slightly modified to display the text of the game name and the game category ) with a display set up for each rom list category, so you can change lists easily.  The Nevato theme is set up to display the marquee, the game vid snaps, shaded flyer art as a background, and wheel images for the game select 'wheel'.  If you want to try this you will need to re-map the attract mode key/control bindings to whatever you are using.  If you want to use the Attract Mode theme linked above, unzip the artwork directories into the 'MAME' directory that is inside the 'scraper' directory in the attract mode zip.

It was a few versions of mame ago on this image when I put this together, so you may want to verify the roms if running on .237

I'm not claiming this is any kind of definitive game list, but maybe could be a place to start for someone looking to use a pi :)

If anyone looks at this, I'd love to know what I omitted, miss categorized etc!






 
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: Nelviticus on November 07, 2021, 06:10:52 pm
For anyone interested, I put together a list of roms for the pi 4 build I recently made.

I just want to say thanks for this. As a newbie to the Pi and MAME this has been really helpful in filtering the 13,464 ROMs that I have down to a far more sensible 644 (I added a couple of ones that I like but you'd removed, such as Spy Hunter).
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: mallard on November 11, 2021, 08:20:35 pm
Hello,

I've been trying to use this image, and I'm very appreciative that you've created it, but I do have a couple questions:

Is the BGFX graphics mode not available in this image? I believe I was using it when running Mame on top of raspbian normally, but with this image, any option other than "accel" causes games to straight-up not load.

Is that intentional behaviour?

Also, is there a trick to setting the resolution of the display? I have my pi plugged into a 1440p display, but rendering at that resolution makes these games impossible to play, and very slow. In Raspbian, I used the regular display configure settings, but using raspi-config through SSH here doesn't seem to be doing anything... am I missing something?
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on November 12, 2021, 10:48:41 am
Hello,

I've been trying to use this image, and I'm very appreciative that you've created it, but I do have a couple questions:

Is the BGFX graphics mode not available in this image? I believe I was using it when running Mame on top of raspbian normally, but with this image, any option other than "accel" causes games to straight-up not load.

Is that intentional behaviour?

Hi, I will try to answer your questions. FYI, I am the author of this image, but people like Samson are creating great value-added work that he then shares with everyone.  :applaud:

BGFX is not available on this image. The reason is that a specific file the source code (drawbgfx.cpp) is making a reference to X11, wich is (volontarily) not available/not installed on this image.

EDIT: FYI, I already filed a bug for this issue: https://mametesters.org/view.php?id=7738

Also, is there a trick to setting the resolution of the display? I have my pi plugged into a 1440p display, but rendering at that resolution makes these games impossible to play, and very slow. In Raspbian, I used the regular display configure settings, but using raspi-config through SSH here doesn't seem to be doing anything... am I missing something?

To modify the resolution, you should modify /boot/config.txt with hdmi_mode=.

Please refer to:
https://www.raspberrypi.com/documentation/computers/config_txt.html
https://www.shellhacks.com/raspberry-pi-force-hdmi-hotplug/
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: Samson on November 13, 2021, 05:34:39 pm
I just want to say thanks for this.


Hi, I will try to answer your questions. FYI, I am the author of this image, but people like Samson are creating great value-added work that he then shares with everyone.  :applaud:


Hey thanks, I'm glad you found this useful!


Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: LuckyTiger on December 01, 2021, 09:39:34 am
Thank you for this project bbegin! I've always wanted to run recent version of MAME on my Pi4. Bravo!  :applaud:
Title: Re: How to make a dedicated MAME 0.237 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on December 02, 2021, 08:29:25 pm
Thank you for this project bbegin! I've always wanted to run recent version of MAME on my Pi4. Bravo!  :applaud:

Thanks LuckyTiger!  :)
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on December 02, 2021, 08:29:52 pm
Just to let you know the availability of the NEW disk image file with MAME 0.238 (please see the original post of this thread for the download link).  :cheers:
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on December 09, 2021, 06:59:58 pm
Question… I finally got everything set up exactly how I want and it’s running great.  I used a 128GB memory card but do not need all that space.  Is there a way to compress the image somehow so I can copy it over to a 32GB card?  My current setup uses much less than 32GB.

When I did the initial installation I remember having to expand the image to account for the extra space in the memory card - so I guess now I want to reverse this process.  As usual assume I know nothing LOL.

Thanks!
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: 10yard on December 10, 2021, 07:49:26 am
Question… I finally got everything set up exactly how I want and it’s running great.  I used a 128GB memory card but do not need all that space.  Is there a way to compress the image somehow so I can copy it over to a 32GB card?  My current setup uses much less than 32GB.

When I did the initial installation I remember having to expand the image to account for the extra space in the memory card - so I guess now I want to reverse this process.  As usual assume I know nothing LOL.

Thanks!
I've done this a bunch of times so will chime in to assist.

You can use the "pishrink" utility from https://github.com/Drewsif/PiShrink
You will need a USB storage device of greater capacity than the used space on the SD card you are attempting to shrink.  EDIT: We will copy over the used space to an external USB storage device and then shrink it down as small as possible.

Steps to prepare the USB flash drive.  It will be mounted to pi as a working area for performing the shrink.

* Format your USB flash drive as NTFS (assuming you are on Windows). Give the volume the name "USB".  It will help us to identify the device when we mount it to the pi.

* Connect USB drive to your pi.

* Boot pi with SD card you want to shrink inserted

* Verify USB mounted.  Your USB drive should be automatically mounted at /media/pi/USB.  I don't have the appliance at the moment so can't be 100%.  Give it a try.

Code: [Select]
dir /media/pi/USB

* if not found then you can query mount points using command

Code: [Select]
lsblk


Steps for the shrinking.

* Install pishrink utility

Code: [Select]
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin

* We now make a copy of the used allocation of your SD card.  You should specify a slightly larger size to be safe,  so if you've used 7.5GB of space I would round to 8GB (8000 blocks).  Set the count= argument accordingly.

Code: [Select]
sudo dd if=/dev/mmcblk0 of=/media/pi/USB/shrunk_my_junk.img bs=1M count=8000

* All being well an image file was created on the USB drive.  If the above command returns an error then increase the count and try again.

Code: [Select]
cd /media/pi/USB
dir

* Now we can shrinkify that image

Code: [Select]
sudo pishrink.sh -z shrunk_my_junk.img

That's it.
You should now have a shrunken image on your USB drive which you can copy to your PC and write to a smaller SD card.
Hope if works out for you.
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on December 10, 2021, 12:22:32 pm
This is great info.  I will give this a shot this afternoon or tomorrow (stupid work calls are going to kill the rest of my day...).

For the USB drive that needs to be larger than the SD card I'm trying to shrink, it sounds like it only has to be larger than the USED space.  So, for example, I have a 128GB microSD card but only using about 12GB of that space if I had to guess.  So you are saying that I could use a 32GB USB drive to make this work, which is larger than the USED space on my 128GB microSD card?  It doesn't need to be 256GB or something larger than my 128GB microSD card)?

Also, I assume I can use an external HDD or memory card for this (doesn't have to be a USB stick)?

Thanks!!
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: 10yard on December 10, 2021, 02:36:25 pm
For the USB drive that needs to be larger than the SD card I'm trying to shrink, it sounds like it only has to be larger than the USED space.  So, for example, I have a 128GB microSD card but only using about 12GB of that space if I had to guess.  So you are saying that I could use a 32GB USB drive to make this work, which is larger than the USED space on my 128GB microSD card?  It doesn't need to be 256GB or something larger than my 128GB microSD card)?

Also, I assume I can use an external HDD or memory card for this (doesn't have to be a USB stick)?

Thanks!!
The USB needs to be larger than the USED space,  not larger than the SD card.   Yes,  in your scenario,  a 16GB or 32GB drive should work.  Basically,  we are copying over the used space to an external device (USB storage) and then shrinking it down.

Any external USB memory should work if NTFS formatted.  I use a 16GB USB stick,  overkill for my 3GB of USED space on the card.  I was able to shrink that down to 1.2GB image.   Note that the image will be automatically packed into a tar.gz file to further reduce size.  That file works directly with Rasp Pi Imager software.
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on December 10, 2021, 02:57:42 pm
Excellent.  Thanks.  I just ran a check on my card and it looks like I'm using less than 10GB.  Am I reading this right even though Use% for /dev/root/ is 52% and /dev/mmcblk0p1 is 22%.  I assume this is Use% of the different partitions, not the entire card (or the numbers wouldn't add up).
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on December 10, 2021, 03:10:32 pm
You may want to use disk Win32 Disk imager (or whatever you have to make an image of the card) to make a backup JUST IN CASE. :) I am not saying it will not work (VERY likely it will work) but if there is some kind of malfunction, you could at least load it back on the 128 and try again. Unfortunately, I am speaking from experience. :( I have rebuilt a few pi builds.

J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.238 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on December 11, 2021, 04:26:41 pm
Question… I finally got everything set up exactly how I want and it’s running great.  I used a 128GB memory card but do not need all that space.  Is there a way to compress the image somehow so I can copy it over to a 32GB card?  My current setup uses much less than 32GB.

When I did the initial installation I remember having to expand the image to account for the extra space in the memory card - so I guess now I want to reverse this process.  As usual assume I know nothing LOL.

Thanks!

This can be done, but we have to take some steps, as the data partition cannot be shrinked (current limitation of the F2FS filesystem). Please note that I did not tested these steps, they are given to the best of my knowledge, but should normally work.

From your Raspberry Pi, with original SD card:
Code: [Select]
# Log in SSH (or from the console, if a keyboard is attached) to the Pi
# Put the system in Service Mode
servicemode
# Shutdown the system
sudo poweroff
# Remove the original SD card from your Raspberry Pi

From a Linux host/PC:
Code: [Select]
# Insert your original SD card
# Dump content to an image-file (assuming your SD card is allocated to /dev/sdd)
sudo dd if=/dev/sdd of=raspios.mame.img status=progress bs=4M
sync
# Switch the SD card, insert your 32GB card
# Write the first 32GB of the image-file to the 32GB SD card (assuming your SD card is allocated to /dev/sdd)
sudo dd if=raspios.mame.img of=/dev/sdd status=progress bs=1M count=32000
sync
rm raspios.mame.img
# Unplug the SD card from your host/PC and insert it in your Raspberry Pi

From the Raspberry Pi in Service Mode:
Code: [Select]
# Log in SSH (or from the console, if a keyboard is attached) to the Pi
# You should be in Service Mode
sudo umount /data
sudo fdisk /dev/mmcblk0p3
# Print the current partition table
p
# Delete the 3rd partition
d, 3
# Set the new size of the partition
First sector: specify previous Start value for the 3rd partition (see the partition table, above)
Last sector: accept the default (to use all remaining free space)
Do you want to remove the signature?   # Answer with Y
# Write the modified partition table
w

# Recreate the F2FS filesystem on the 3rd partition
sudo mkfs.f2fs -l data /dev/mmcblk0p3
# Mount the partition to /data mountpoint
sudo mount -t f2fs -o rw /dev/mmcblk0p3 /data

From your Linux host/PC:
Code: [Select]
# Insert the original SD card
# Identify the device allocated to your SD card
lsblk
# We will use /dev/sdd as an example of your SD card
# Find the mountpoint of the 3rd partition of your SD card
findmnt -S /dev/sdd3
# We use /mnt/data as an example mountpoint
# Copy the content of data partition recursively to your Raspberry Pi
scp -r /mnt/data/* pi@IP.ADDRESS.OF.YOUR.PI/data

From the Raspberry Pi (still in Service Mode):
Code: [Select]
# Make sure everything is there
ls -la /data
# Switch to Arcade Mode
arcademode
# Reboot
sudo reboot

Enjoy! :)
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on December 31, 2021, 05:39:01 pm
Just to let you know the availability of the NEW disk image file with MAME 0.239 (please see the original post of this thread for the download link).  :cheers:

Also included in this release:
 - The Hypseus-Singe binary (for LaserDisc games emulation) has been updated to v2.6.21-RPi
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: wimpie3 on January 03, 2022, 09:44:29 am
I've tried to install the latest version with MAME 0.239.

First thing I wanted to do was to activate the WIFI with raspi-config. Got the famous "could not communicate with wpa_suppliant" message. I thought this was an old bug that already has been fixed? When I wanted do install wpasupplicant with atp-get, the answer was that this module is already installed.

There also is a bug in mame-versionscheck.sh in line 10: [: -qt: unary operator expected
This error is shown after login.
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on January 04, 2022, 09:14:43 pm
I've tried to install the latest version with MAME 0.239.

There also is a bug in mame-versionscheck.sh in line 10: [: -qt: unary operator expected
This error is shown after login.

I fixed the script in the new version of the image. Upload to Google Drive in progress. Stay tuned. I will post once the upload is completed. Sorry about that.

First thing I wanted to do was to activate the WIFI with raspi-config. Got the famous "could not communicate with wpa_suppliant" message. I thought this was an old bug that already has been fixed? When I wanted do install wpasupplicant with atp-get, the answer was that this module is already installed.

Do you switch to read/write (just type: rw) mode before invvoking raspi-config?

Can you post me the result of those commands?

Code: [Select]
sudo iwlist wlan0 scan
sudo ifconfig
sudo rfkill

Thanks in advance!
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: wimpie3 on January 05, 2022, 10:58:39 am
Hi there, thanks for responding.

I managed to get the wifi up and running by putting the special config file in the root.

I got to the point until I fully configured Attract and MAME. Worked like a charm. Today I wanted to play some games and... as soon as I launch them with Attract, I see the MAME screen and everything hangs. So I've checked out the mame.ini file in the /data directory. 8000 bytes full of garbage. I deleted the file. Sudo reboot. File is there again!

OK, I open up a putty session. Asks me for my password, all seems okay. And that's it. The system hangs afterwards:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
Last login: Tue Jan  4 09:16:18 2022

I can press CTRL+C to abort, and I get a prompt, but typing things like "rw" or "servicemode" result in a "command not found". So I'm a bit stuck now. Obviously the system decided to do some mean things to the MAME file, but now I can't get into servicemode anymore since nothing happens after the prompt...
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on January 05, 2022, 05:41:06 pm
Hi there, thanks for responding.

I managed to get the wifi up and running by putting the special config file in the root.

I got to the point until I fully configured Attract and MAME. Worked like a charm. Today I wanted to play some games and... as soon as I launch them with Attract, I see the MAME screen and everything hangs. So I've checked out the mame.ini file in the /data directory. 8000 bytes full of garbage. I deleted the file. Sudo reboot. File is there again!

OK, I open up a putty session. Asks me for my password, all seems okay. And that's it. The system hangs afterwards:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
Last login: Tue Jan  4 09:16:18 2022

I can press CTRL+C to abort, and I get a prompt, but typing things like "rw" or "servicemode" result in a "command not found". So I'm a bit stuck now. Obviously the system decided to do some mean things to the MAME file, but now I can't get into servicemode anymore since nothing happens after the prompt...

Just to let you know, I completed the upload of the new image file with updated scripts. Can you download again, please?

On the first run, you have to expand the data partition with:

Code: [Select]
expand-data-partition.sh
Thanks in advance!
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: wimpie3 on January 07, 2022, 11:47:30 am
Edit: I just looked at your video - you really should try https://github.com/mgzme/MAME-PSGS as it looks stunning.

I agree, MAME-PSGS looks stunning! But how can we add this? I've tried modifying mame.ini. I've reset "effect" to "none" and I've pasted this at the bottom:

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         ".$HOME/.mame/roms/mame-psgs"

I've put mame-psgs.vsh and mame-psgs_rgb32_dir.fsh in the mame rom directory. But it doesn't seem to work. Am I overlooking something?
Title: Re: How to make a dedicated MAME Appliance on a Raspberry Pi 4B
Post by: bbegin on January 07, 2022, 03:24:55 pm
Edit: I just looked at your video - you really should try https://github.com/mgzme/MAME-PSGS as it looks stunning.

I agree, MAME-PSGS looks stunning! But how can we add this? I've tried modifying mame.ini. I've reset "effect" to "none" and I've pasted this at the bottom:

#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         ".$HOME/.mame/roms/mame-psgs"

I've put mame-psgs.vsh and mame-psgs_rgb32_dir.fsh in the mame rom directory. But it doesn't seem to work. Am I overlooking something?

I see 3 elements in your path:
1. You have an extra leading dot (.) just before $HOME
2. No need to use double quotes
3. You should use a dedicated folder for the GLSL shaders (for example: $HOME/.mame/glsl)

For example, you may use:

Code: [Select]
glsl_shader_mame0         $HOME/.mame/glsl/mame-psgs
Just create the glsl folder under /data/mame.
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: wimpie3 on January 08, 2022, 09:45:20 am
@bbegin Thanks for your help, unfortunately it's not working. What I have right now:

In mame.ini I've set effect to none
and added this at the end of mame.ini:
#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         $HOME/.mame/glsl/mame-psgs

I've created a directory /data/mame/glsl with these files:
custom_crt.vsh (contents: palette_emulation = 0.0;)
mame-psgs.vsh
mame-psgs_rgb32_dir.fsh

When I launch mame there is no filter effect present.

Could it be that glsl shaders only work when video=opengl?

Edit: google says that "GLSL requires OpenGL support", can I just change video to opengl and not use the current accel option? Or would that break my installation?
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on January 08, 2022, 01:13:01 pm
@bbegin Thanks for your help, unfortunately it's not working. What I have right now:

In mame.ini I've set effect to none
and added this at the end of mame.ini:
#
# OpenGL-SPECIFIC OPTIONS
#
gl_forcepow2texture       0
gl_notexturerect          0
gl_vbo                    1
gl_pbo                    1
gl_glsl                   1
gl_glsl_filter            1
glsl_shader_mame0         $HOME/.mame/glsl/mame-psgs

I've created a directory /data/mame/glsl with these files:
custom_crt.vsh (contents: palette_emulation = 0.0;)
mame-psgs.vsh
mame-psgs_rgb32_dir.fsh

When I launch mame there is no filter effect present.

Could it be that glsl shaders only work when video=opengl?

Edit: google says that "GLSL requires OpenGL support", can I just change video to opengl and not use the current accel option? Or would that break my installation?

Just to make sure, your files have to be located under /data/mame/glsl/mame-psgs, not directly under /data/mame/glsl
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: wimpie3 on January 08, 2022, 01:42:08 pm

Just to make sure, your files have to be located under /data/mame/glsl/mame-psgs, not directly under /data/mame/glsl

That wasn't the case. Created the directory, moved the files, still not working. I know this is a bit out-of-scope for your project, but I really wanted to get this working since GLSL can offer that unique CRT look.  :banghead:
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on January 08, 2022, 05:53:14 pm
I will take a look at this tonight and I will give you feedback.  :cheers:
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: wimpie3 on January 28, 2022, 12:25:41 pm
How can I edit boot.txt in servicemode?

This is what I get now:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
The system is currently in SERVICE mode (MAME 0.239), current Frontend is: Attract Mode.
Hypseus Singe v2.6.21-RPi.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@arcade(ro):~$ sudo nano /boot/config.txt

And when the file shows up, I see the message "[ File '/boot/config.txt' is unwritable ]"

How is this possible? I'm clearly in service mode so the filesystem should be writeable...
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: J_K_M_A_N on January 28, 2022, 01:38:31 pm
How can I edit boot.txt in servicemode?

This is what I get now:

Using username "pi".
pi@192.168.0.52's password:
Linux arcade 5.4.77-v7l+ #1371 SMP Tue Nov 17 13:35:27 GMT 2020 armv7l
The system is currently in SERVICE mode (MAME 0.239), current Frontend is: Attract Mode.
Hypseus Singe v2.6.21-RPi.

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

pi@arcade(ro):~$ sudo nano /boot/config.txt

And when the file shows up, I see the message "[ File '/boot/config.txt' is unwritable ]"

How is this possible? I'm clearly in service mode so the filesystem should be writeable...

You have to put it in read-write mode first.

Code: [Select]
rw
Then you can edit the file and put it back into read-only mode.

Code: [Select]
ro
J_K_M_A_N
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on February 01, 2022, 04:20:11 pm
Are you guys trying to get CRT shaders working with MAME?  Is there any way to do this without taking a massive hit in performance?  I finally have everything set up the way I want (it's awesome) and this would be the finishing touch.   :cheers:

EDIT: I can confirm changing "video" to "bgfx" does not work.  MAME won't even launch.
Title: Re: How to make a dedicated MAME 0.239 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on February 04, 2022, 04:52:30 pm
Yes, as javeryh said it, bgfx is unfortunately not working with the current MAME custom build.

The reason is because we do not use X11 (no window manager) and there is 2 references to X11 in src/osd/modules/render/drawbgfx.cpp, even if we tell the build that we are NOT using X11 (with NO_X11=1 on the "make" command-line).

At the current state, the code is not taking care completely of this directive (NO_X11=1) for our use case. I filed a bug to the MAME developers team (bug id is 07738) and can be viewed at: https://mametesters.org/view.php?id=7738
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on February 25, 2022, 02:42:56 pm
Just to let you know the availability of the NEW disk image file with MAME 0.241 (please see the original post of this thread for the download link).  :cheers:
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on March 03, 2022, 01:31:09 pm
Just to let you know the availability of the NEW disk image file with MAME 0.241 (please see the original post of this thread for the download link).  :cheers:

Thanks bbegin.  Anyone on the fence about this should definitely give it a try!

My cabinets are almost finished... I am having a hard time powering on and off with one button press because I think the pi still draws 70mA of power when "off" when you use the safe shutdown script.  Your image works brilliantly but when I shut down the pi, my smartstrip is still sensing a power draw so it does not turn off the marquee light or the amp.  I ordered a Mausberry Circuit that is supposed to completely cut power so hopefully that takes care of things.   :cheers:
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: Jaseguges on March 08, 2022, 08:49:43 pm
Hello, arcade and forum noob here.  I really love the idea of eliminating RetroPie and having just Mame with AttractMode on my Rpie 3 B+.  I've tried my best to get the image working on my pi but I cant manage to get to the AttractMode Menu.  Is there a guide with step by step instructions that I could refer to?  Really love what you're doing here, hope to get it running soon.  Thanks!
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 09, 2022, 08:34:34 am
Hello, arcade and forum noob here.  I really love the idea of eliminating RetroPie and having just Mame with AttractMode on my Rpie 3 B+.  I've tried my best to get the image working on my pi but I cant manage to get to the AttractMode Menu.  Is there a guide with step by step instructions that I could refer to?  Really love what you're doing here, hope to get it running soon.  Thanks!

Hello, yes I built a step-by-step guide to build the image. The only steps I need to add is how to build Attract Mode and Hypseus Singe (wich are incluses un the pre-built image).

The steps are un french, but you can translate Them (see 2nd link):

https://gist.github.com/sonicprod/f5a7bb10fb9ed1cc5124766831e120c4

Google Translation to English:

https://translate.google.ca/translate?hl=fr&tab=wT&sl=fr&tl=en&u=https%3A%2F%2Fgist.github.com%2Fsonicprod%2Ff5a7bb10fb9ed1cc5124766831e120c4
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: Jaseguges on March 09, 2022, 09:04:09 am
Thanks for getting back to me!  I downloaded the image from the link on the original post and flashed it to my SD card.  Do I still follow the instructions on GitHub?
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 09, 2022, 09:39:44 am
Thanks for getting back to me!  I downloaded the image from the link on the original post and flashed it to my SD card.  Do I still follow the instructions on GitHub?

No, you don't need to follow the instructions on Github for the pre-built images. Everything is in there.

The instructions on Github are there if you want to built the image for yourself, from scratch. This way, you may be able to adapt it for Raspberry Pi 3B+.

Enjoy!   :cheers:
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: Jaseguges on March 09, 2022, 10:58:08 am
Oh I see, the problem is I only have a Pi 3 B+.  Looking forward to getting a pi4 so I can use this awesome image, thanks!
 :cheers:
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: nts31180 on March 10, 2022, 10:54:10 am
Very large Raspberry Pi noob here.  I downloaded the image, used Etcher to install on an sd card. Plugged SD card into my new Raspberry Pi 4B. And when booting it is open to a black screen, with information at the bottom.  References a start4.elf: is not compatable ; This board requires newer software.
I apologize if this is a dumb question....
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 10, 2022, 10:08:04 pm
Very large Raspberry Pi noob here.  I downloaded the image, used Etcher to install on an sd card. Plugged SD card into my new Raspberry Pi 4B. And when booting it is open to a black screen, with information at the bottom.  References a start4.elf: is not compatable ; This board requires newer software.
I apologize if this is a dumb question....

Hi nts31180,

No, it's not a dumb question at all. The cause is that the firmware/boot loader is too old for the newer hardware revisions of Raspberry Pi 4. Sorry about that.

I will update the image file and re-publish it. Stay tuned.
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 12, 2022, 05:34:52 pm
Very large Raspberry Pi noob here.  I downloaded the image, used Etcher to install on an sd card. Plugged SD card into my new Raspberry Pi 4B. And when booting it is open to a black screen, with information at the bottom.  References a start4.elf: is not compatable ; This board requires newer software.
I apologize if this is a dumb question....

The image has been updated. See the original post of this thread for the new download link.

Let me know if this solves the issue you're experiencing. Thanks!
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: nts31180 on March 14, 2022, 01:47:24 pm
Thanks so much, this did fix the issue.
Now just to work on uploading ROMs. Is there any write up I missed in the comments of how to do that? Has to be done through Sambra i'm seeing?
I'll have to research Sambra.
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 14, 2022, 02:39:31 pm
Thanks so much, this did fix the issue.
Now just to work on uploading ROMs. Is there any write up I missed in the comments of how to do that? Has to be done through Sambra i'm seeing?
I'll have to research Sambra.

Hi nts31180,

You first need to expand the /data partition. To do so, execute this, once in a SSH session to the Raspberry Pi:

Code: [Select]
./expand-data-partition.sh
Please, refer to the README.txt file in the home folder (to viszualise the file, type: less README.txt). Refer to the "ROMS MANAGEMENT" section to know how to transfer ROM files to the system (and manage them).
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: nts31180 on March 14, 2022, 05:43:28 pm
Thanks, Used the expand data partition. And then using ethernet I was finally able to map the Sambra drive to be able to transfer roms!
Thanks for all the help.  Hopefully smooth sailing from here.
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: nts31180 on March 18, 2022, 03:31:29 pm
No clue if this is related to the program or if it’s the rom’s I’m using.
But getting a large red screen with a bunch of files missing, say (neogeo) after the file name.

Photo attached.
Any advice?
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 18, 2022, 03:41:41 pm
Hi nts31180,

That's because the ROM you want to launch needs (dependency) a BIOS. In this case, the BIOS it needs is neogeo. You need to get the BIOS file (neogeo.zip) and put it in the same folder as your ROM files (/data/mame/roms).

Hope it helps
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: itr4e on March 19, 2022, 09:46:11 am
Hi,
got a problem building mame on a Pi4B 4GB with your image
I am making a small 15 inch picade for the kids to play some games on it, especialy pacman  and i have used your image since the kids are small and prefer to be a ro mode.

Basically I have changed the source ui.cpp to have option to disable the warning (no nag) display, modified your mame-update script not do download the mame or extract and used that to build the image

After 5h 45m it fails, see attached picture for that but it doesn't contain any specific error info.

i have seen the make file and will try to enable debug and some other options to see why but was wondering if anyone has an idea as each build takes forever to be done and now with debug will be more.

I have not touched anything else and added only some option to change/cycle one game per day with a script and adding the game to load in the autostart script.
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 19, 2022, 06:41:04 pm
Hi itr4e,

At first view, it looks like a free-space problem: the root filesystem is a bit tight on space while building MAME. I would suggest you delete your .zip of the source code, once unzipped, as well as the original MAME (rm -R ~/mame0241). Try to continue the build, it should take where the issue was encountered.

Just let me know if this fix the issue. Thanks!
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: nts31180 on March 21, 2022, 06:10:57 pm
Hi nts31180,

That's because the ROM you want to launch needs (dependency) a BIOS. In this case, the BIOS it needs is neogeo. You need to get the BIOS file (neogeo.zip) and put it in the same folder as your ROM files (/data/mame/roms).

Hope it helps

Thanks again for all of the help! I've gotten to everything set up (for now), and even gotten to play some games that I haven't seen since I was a kid.
This is an awesome set up!
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on March 24, 2022, 03:17:17 pm
Thanks, nts31180!  :D

@itr4e,

To free some space before the build process, use these commands:

Code: [Select]
sudo apt-get clean
sudo apt-get autoclean

Did you were able to build MAME, yet?
Title: Re: How to make a dedicated MAME 0.242 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on April 06, 2022, 12:01:08 pm
Just to let you know the availability of the NEW disk image file with MAME 0.242 (please see the original post of this thread for the download link).  :cheers:
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on May 07, 2022, 03:16:45 pm
Just to let you know the availability of the NEW disk image file with MAME 0.243 (please see the original post of this thread for the download link).  :cheers:
Title: Re: How to make a dedicated MAME 0.241 Appliance on a Raspberry Pi 4/Pi 400
Post by: itr4e on May 10, 2022, 03:43:22 pm
Thanks, nts31180!  :D

@itr4e,

To free some space before the build process, use these commands:

Code: [Select]
sudo apt-get clean
sudo apt-get autoclean

Did you were able to build MAME, yet?


Hi sorry for the late reply been pretty busy and just noticed your post.
I did managed to fix it yes, don't recall what I did though.

I also made some changes on my own for simplicity, since it's for the kids and dont want to be complicated but easy enough to change games if needed without menus.
I added a script that reads some files from the boot volume and depending on that it starts the game and the relevant parameters with it, eg rotate, emulator and config.
So it starts only one game and no menu for kids to mess around with :)
Will do some changes some time this or next month in preparation of summer

thanks for your great work on that









Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: Bsachetti on May 22, 2022, 03:10:50 pm
So far, this is my favorite build for my arcade machine.  Very easy to use and works so much better with my I-PAC than Retropie or Batocera. 

Just a couple of items I've been struggling with.

1)  Performance of all vector games -- everything seems to run really well (speeds very close to 100%) except for vector games which are super slow with speeds from  15-25% typically.

2) Advmenu -- this won't run at all.  It seems to get the xml info from the Mame executable and then reports "No video mode available for your configuration.  Try selecting a specific resolution like with -display_size 1280x1024"

Hoping to have someone point me in the right direction on these!  Thanks in advance.
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on May 24, 2022, 08:32:58 pm
To set the correct video mode with AdvanceMENU, you should run the AdvCfg binary and set the resolution to the one EDID has detected:

Code: [Select]
./frontend/advance/advcfg
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: Bsachetti on May 25, 2022, 05:58:15 pm
Got advmenu working... thanks!

Any guidance on how to get acceptable performance from the vector games or is this a known issue?

Thanks!
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: Substring on May 30, 2022, 09:50:12 am
Just FYI, Mame 0.244 broke KMS output, I've made a temporary fix at https://gitlab.com/groovyarcade/packages/-/blob/master/package/groovymame/kms.patch until it's fixed upstream (see https://github.com/mamedev/mame/issues/9852)
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on June 16, 2022, 09:55:24 am
Just FYI, Mame 0.244 broke KMS output, I've made a temporary fix at https://gitlab.com/groovyarcade/packages/-/blob/master/package/groovymame/kms.patch until it's fixed upstream (see https://github.com/mamedev/mame/issues/9852)

Thanks for this patch, I will integrate it for the 0.244 build and hope it will be integrated in 0.245 version of MAME.
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: bobbyb13 on June 23, 2022, 10:06:25 pm
I have been waiting to try this since you first posted your project work!

Of course now that I open your github entry I find myself over my head immediately.

Is there any hope I can do this if I have never used Linux before and only have a Windows10 computer?

Maybe I can install virtualbox so I can follow your directions but my skill in dealing with computers and code is very limited!

Your very detailed directions look excellent- and also like a foreign (even when translated into English for me!) language.
 :lol
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: Substring on June 24, 2022, 01:54:30 pm
Just FYI, Mame 0.244 broke KMS output, I've made a temporary fix at https://gitlab.com/groovyarcade/packages/-/blob/master/package/groovymame/kms.patch until it's fixed upstream (see https://github.com/mamedev/mame/issues/9852)

Thanks for this patch, I will integrate it for the 0.244 build and hope it will be integrated in 0.245 version of MAME.
Considering 245 is about to be released and https://github.com/mamedev/mame/pull/9888is still open ... The fix is lame, the original commit that brought the bug is even worse ... I'll let you follow issues to understand why there was a commit that broke KMS. The various fix are totally absurd ...
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: PL1 on June 24, 2022, 02:14:30 pm
https://github.com/mamedev/mame/pull/9888is still open
Missed a space between the URL and "is".   :embarassed:
https://github.com/mamedev/mame/pull/9888 (https://github.com/mamedev/mame/pull/9888)


Scott
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on June 28, 2022, 01:21:02 pm
I have been waiting to try this since you first posted your project work!

Of course now that I open your github entry I find myself over my head immediately.

Is there any hope I can do this if I have never used Linux before and only have a Windows10 computer?

Maybe I can install virtualbox so I can follow your directions but my skill in dealing with computers and code is very limited!

Your very detailed directions look excellent- and also like a foreign (even when translated into English for me!) language.
 :lol

If I can figure this out, anyone can.  Saying I have third grade level computer knowledge would be an insult to third graders everywhere.  You don't need to compile anything - bbegin has done it all for you.  Just need to mount the image on a memory card and then boot up the pi.  You then should connect to wifi using the config file discussed in this thread like 2 years ago.  Everything else is in the instructions and it's trial and error and you can't mess anything up.  Worst you can do is have to delete the image and restart.  Just dive in!
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: Jt82 on July 31, 2022, 01:20:29 pm
Hi. I'm looking for help on how to get this working.
Here's where i am.

I have downloaded the file in the first post and installed it to the rPi4. I have booted the pi and got to the service menu. I am able to log in using the standard pi login details.
That's it. I have no idea where to go next. The step by step guide seems overly long for something everyone on here is saying is simple. Am i missing something? Am i supposed to follow each of the steps in the step by step guide? I think it would take me weeks to type in all the code in the guide.

I don't understand where i'm supposed to put the roms. In previous installs i've been able to find the folders if i put the sd card in my pc. When i do this now i don't see any of the usual folders.

There is mention of Samba share but all the tutorials i've looked at explaining this don't explain the error i get when i try to install it. (not using locking for ....etc)

javeryh. above you say connect to wifi using config discussed in the thread 2 years ago. Can you point me to the page on the thread this is discussed please? I've gone back and forth on the thread so many times i think im blind to see the actual helpful parts.

Any help on this would be gratefully received.
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: LuckyTiger on August 01, 2022, 11:18:49 pm
Hi. I'm looking for help on how to get this working.
Here's where i am.

I have downloaded the file in the first post and installed it to the rPi4. I have booted the pi and got to the service menu. I am able to log in using the standard pi login details.
That's it. I have no idea where to go next. The step by step guide seems overly long for something everyone on here is saying is simple. Am i missing something? Am i supposed to follow each of the steps in the step by step guide? I think it would take me weeks to type in all the code in the guide.

I don't understand where i'm supposed to put the roms. In previous installs i've been able to find the folders if i put the sd card in my pc. When i do this now i don't see any of the usual folders.

There is mention of Samba share but all the tutorials i've looked at explaining this don't explain the error i get when i try to install it. (not using locking for ....etc)

javeryh. above you say connect to wifi using config discussed in the thread 2 years ago. Can you point me to the page on the thread this is discussed please? I've gone back and forth on the thread so many times i think im blind to see the actual helpful parts.

Any help on this would be gratefully received.
Jt82, if you use bbegin's premade download, there is very little you need to do. You really don't need the step-by-step guide, just the first post.

After you login, you run the script mentioned in the first post to use the full size of your SD card. I would suggest using an ethernet cable until you are ready to setup WiFi using the information from the linuxhint.com instructions also in the first post. From there, you should be able to connect over the network and add roms without issue or even by physically putting the SD card into your PC.

I hope this helps you get started.
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: mallard on December 11, 2022, 10:52:36 pm
Does anyone have experience running this image with USB boot on a pi 4?

I've had lots of issues running on an SD card. Even when using safe shutdowns, the card seems to get corrupted over time and eventually refuses to boot unless I reflash the image.

Is this an inherent problem with SD cards? Or is it likely that my specific card has issues? Would USB booting fix this, and has anyone been able to flash and boot on a USB?

I'd really appreciate any help.
Title: Re: How to make a dedicated MAME 0.243 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on December 16, 2022, 06:20:22 pm
Does anyone have experience running this image with USB boot on a pi 4?

I've had lots of issues running on an SD card. Even when using safe shutdowns, the card seems to get corrupted over time and eventually refuses to boot unless I reflash the image.

Is this an inherent problem with SD cards? Or is it likely that my specific card has issues? Would USB booting fix this, and has anyone been able to flash and boot on a USB?

I'd really appreciate any help.

To answer your question, SD cards *do* wear over time as numerous write operations are done.

I took care of this problem, because the purpose of this image is to being used as an "appliance" style: power it on, use it (or not), power it off (or not, in use case of continuous operation). The SD card must *not*  wear over time. That's why I took care to put the system in read-only mode when in normal operation. Only the /data partition is in read/write mode, but the filesystem is adapted to flash (it uses the F2FS filesystem). Additionally, only the occasional writes operations requested by the emulator or the front-end are redirected to this partition. The whole Linux operating system is running in read-only mode. To make changes to Linux persistent (add, update or remove packages, for example), you first need to put the system in read/write mode, with the "rw" command.

Booting from a USB disk will only make it possible to use a magnetic hard disk, instead of flash.

I personally think your SD card is already worn-out, from previous uses or maybe defective.

I recommend use a new micro-SD card (avoid cheapest ones, if possible) and write the image file to it. You shouldn't run in any problem regarding the wear with this image.

I hope this helps.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on December 19, 2022, 09:19:51 pm
Hi all,

It's been a little while since I published a new updated disk image!

I'm happy to let you know the availability of the NEW disk image file with MAME 0.250 (please see the original post of this thread for the download link).

Three (3) new features in this release:
- Sound volume is persistent;
- Automatic single-ROM launch at boot (called AutoROM mode) for dedicated cabinet/game (configure with the "frontend" command);
- No more need to put the system in read/write mode when using the "frontend" command.

Happy holidays!  :cheers:
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: abispac on January 07, 2023, 01:35:26 am
Any chance you can make this 15khz compatible, with vga666 and groovymame? Thanks for reading.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Substring on January 13, 2023, 06:36:31 pm
If you go groovymame for 15kHz, please get in touch with me. You'd need some kernel patches + patched SDL2 for KMS modeswitching
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Toonces on January 14, 2023, 03:41:34 pm
That would be awesome! I recently used GroovyArcade 2022 iso to update my main MAME system in a Namco Cyberlead and love it. Being able to use this image with GroovyMame would be awesome. I am using a PJ Pi2JAMMA adapter from PCBJunkie that would be an awesome combo with this image. https://pcbjunkie.net/index.php/raspberry-pi-to-jamma-adapter/

I'm using it with a Pi3B and an older version of Retropie but this image and a Pi4 with the SDArcadeMod_v3f theme looks like it's a perfect match that will give me what I've been looking for.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: javeryh on January 20, 2023, 11:45:07 am
Hi all,

It's been a little while since I published a new updated disk image!

I'm happy to let you know the availability of the NEW disk image file with MAME 0.250 (please see the original post of this thread for the download link).

Three (3) new features in this release:
- Sound volume is persistent;
- Automatic single-ROM launch at boot (called AutoROM mode) for dedicated cabinet/game (configure with the "frontend" command);
- No more need to put the system in read/write mode when using the "frontend" command.

Happy holidays!  :cheers:

Thanks for keeping this going!  I'm about 1 year in using this solution and have had zero issues.  It boots, it plays and it powers down perfectly every time. :cheers:
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: TrevEB on July 17, 2023, 01:11:31 pm
A quick note for newbs like me.

This image will not work on a Pi 3.
The hardware is different. The software must be written for a Pi 3

FYI
Everything works except Mame.
Once in arcademode the pi reboots to the mame logo and nothing more.

Expansion works,
samba works,
Roms copied over to the roms folder works,
Artwork scrapping works, update works

I've got a pi 4B coming tomorrow so hopefully I'll join the rest of you in Pi4 Bliss

What would be involved in recoding for a Pi 3.
I am doing this for a dedicated warlords cabinet. The emulation is imperfect. Hoping running the current version of mame will solve that.

Thanks
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: TrevEB on August 09, 2023, 11:57:38 pm
No Sound in Mame
Using the current image, I have everything working perfectly, except sound.
The speakers have been tested and working from HDMI or Audio port out headphones, or a USB audio device (3D Sound)
Using speaker-test while in RW mode sound works perfectly.
When I switch to Arcademode all games have no sound.

Is everyone else able to get sound through via the HDMI cable or the audio jack?
There must be some setting in mame.ini or something that I am missing.

Also, while in servicemode. what exactly is the command to run Mame while in servicemode,
mame-launcher.sh = command not found.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: spedinfargo on August 22, 2023, 11:25:56 pm
Making great progress with this (unlike many other forays into Mame on Pi).

One quick question (typo?):  On my image there is no /data/roms folder and likewise, no \\arcade\data\roms in the Samba share.  When I created one and copied some roms to that folder, Attract Mode couldn't find them.

After tracking down how the .mame folder works, I'm wondering if this is a misprint?  When I copied my roms into \\arcade\data\mame\roms then things seemed to work fine.

Might be a step I missed or maybe this has changed in newer versions of the image?
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Crazy Cooter on October 22, 2023, 11:16:52 pm
Can you update MAME after using this on a PI4 or would you need to make a whole new image/start over if you needed a newer version of MAME?
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Th3T0ur15t on November 02, 2023, 03:11:40 pm
Just wanted to add... love this image. The attention to detail is great and 'it just works'.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Crazy Cooter on November 21, 2023, 10:46:21 pm
No Sound in Mame
Using the current image, I have everything working perfectly, except sound.
...
Is everyone else able to get sound through via the HDMI cable or the audio jack?
There must be some setting in mame.ini or something that I am missing.
...

Possible fix (solved my issue - I'm using the 3.5mm jack to an external 20w RMS stereo amplifier)
After enabling the 3.5mm output per J_K_M_A_N's post earlier in this very thread http://forum.arcadecontrols.com/index.php/topic,162889.msg1747478.html#msg1747478 (http://forum.arcadecontrols.com/index.php/topic,162889.msg1747478.html#msg1747478), if I cranked the volume I could hear sounds... barely.

from command line or SSH:
"alsamixer"
Then use up arrow to bring the dB gain to ~0
Initially when I ran alsamixer it showed my headphone (3.5mm) jack set to -57dB -> which is why I couldn't hear anything unless I cranked up to 100% volume.

NOTE: I was in "rw" mode when I did this, then changed to "ro" before a "sudo reboot".  Not sure if that's required or not but it kept the correct settings.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Thewick on December 30, 2023, 01:11:15 pm
This is amazing!  I think this might be what I need to justify reverting my arcade build back from PC to RPI, assuming I’m able to get AM plugins for ServoSticks and dual monitor working.  I’m also seeing great performance on some titles that were awful in lr-MAME.  Any plans to port this is RPi5?  Again, amazing work!
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: teller on January 07, 2024, 10:17:39 am
Hi, is there a new SD card image of your system with the latest MAME v0.261?
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: bbegin on February 05, 2024, 07:23:14 pm
Hi, is there a new SD card image of your system with the latest MAME v0.261?

I am currently building MAME 0.262. I will upload a fresh image once the build is successfully completed.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Ond on February 20, 2024, 09:48:52 pm
Hi, is there a new SD card image of your system with the latest MAME v0.261?

I am currently building MAME 0.262. I will upload a fresh image once the build is successfully completed.

Looking forward to the new build. I'm currently running the latest available version on a overclocked Pi 4 B.  Does the screen rotation of the Front End depend on the ROMS loaded? I'm using a monitor in landscape but MAME front end always comes up in portrait view? I must have missed something maybe?  :D  I can edit the mame.ini file for game rotation no problem but the FE not so sure...
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Steve S. on February 24, 2024, 04:06:51 pm
Also looking forward to the new build.

I have had issues with the 0.250 version and hope the update will help out.

Bbegin, thank you for all the fine work!
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Crazy Cooter on March 09, 2024, 12:37:03 pm
... Does the screen rotation of the Front End depend on the ROMS loaded? I'm using a monitor in landscape but MAME front end always comes up in portrait view? I must have missed something maybe?  :D  I can edit the mame.ini file for game rotation no problem but the FE not so sure...

Check in your attract.cfg and try changing to/from some of these:
   param                auto_rot 270
   param                default_rot 90
   param                rotate 90
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: Ond on March 10, 2024, 10:47:34 pm
... Does the screen rotation of the Front End depend on the ROMS loaded? I'm using a monitor in landscape but MAME front end always comes up in portrait view? I must have missed something maybe?  :D  I can edit the mame.ini file for game rotation no problem but the FE not so sure...

Check in your attract.cfg and try changing to/from some of these:
   param                auto_rot 270
   param                default_rot 90
   param                rotate 90

Thank you Crazy Cooter. adding this to my list of things to test out.  :cheers:
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: monsieurarcade on March 17, 2024, 04:23:18 pm
Hi,

Been through almost all the steps up to changing file system to read-only.
Created and executed the script:
~/scripts/read-only-rootfs.sh

After execution, Pi boots but stops at some point.
I don't have console access, neither directly with a keyboard or with putty.

Is there something I can do to correct this or revert back to rw so I don't have to start the whole process again ?
Thanks.
Title: Re: How to make a dedicated MAME 0.250 Appliance on a Raspberry Pi 4/Pi 400
Post by: 24-7-testing on March 22, 2024, 11:39:31 am
I am currently building MAME 0.262. I will upload a fresh image once the build is successfully completed.

Hi bbegin, just wondering if you have any progress you can share on the latest version of the prebuilt SD image? Any luck building the latest version yet?