graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Attempting to Build Mame 0.214 on RPI 4

Mon Oct 21, 2019 8:09 pm

I have been attempting to build Mame 0.214 on the RPI 4. I am able to get all the prerequisites for the build taken care of and the process starts without error. The build continues for an hour only to hard lock the system with the activity LED lit solid green. I am unable to move the mouse or perform any action on the system. The only way out of it is to cut power to the system.

I experimented to see if it had anything to do with overclocking. It does not, even at stock speed, the hard lock still occurs nearly and hour or so into the build process. I have not tried optimizations yet. I am simply running make -j4 from the build directory. I am wanting to see if I can even get it to build before trying to optimize for a72, NEON and etc.

My questions are: Has anybody gotten Mame 0.214 to successfully complete the build process on RPI 4? If you have, what were your steps?

If you are wondering the reason of why I am building 0.214, the answer is I use Pleasuredome for my ROM source. They only deal with the newest ROM sets. The 0.206 build in the repository works reasonably well with systems using ROMs, but most of the systems that are labeled working and use CHDs report that the CHD is improperly dumped. I have been able to nearly get Area 51 to run at full speed on the RPI 4 though it requires an overclock. I am now attempting to tweak things further by making sure I am using a Mame that matches the ROMs I have on hand and also wanting to attempt further optimizations during the build process to see how much performance can be squeezed out of an RPI 4.

User avatar
scruss
Posts: 2614
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: Attempting to Build Mame 0.214 on RPI 4

Mon Oct 21, 2019 10:28 pm

How much memory does your board have? You may be running out of RAM as MAME is quite a chunky build.
Try make without the '-j4'
Have you added swap?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Tue Oct 22, 2019 12:41 am

I have a 4 GB board. I will attempt without -J4 and see where that leads. I have not tried that yet. I have not enabled swap, but if I were too, I would prefer it to use one of the connected USB 3 hard drives rather than the SD card. The USB 3 hard drives more than double the speed of the SD card and nearly triple it actually.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Tue Oct 22, 2019 3:41 am

The build has begun. Without using -J4, RAM usage is so far staying under 1 GB. I do remember when using make -J4, RAM usage was close to 3 GB. Build speed is slower, but I will take that as long as it succeeds.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Tue Oct 22, 2019 4:28 pm

The build still failed, however, it did not take the system down with it this time. It actually neared the end of the build process as well. The following error occurred:

Code: Select all

Archiving libqtdbg_sdl.a...
Compiling src/lib/netlist/analog/nld_bjt.cpp...
In file included from ../../../../../src/lib/netlist/solver/nld_matrix_solver.h:16,
                 from ../../../../../src/lib/netlist/solver/nld_solver.h:12,
                 from ../../../../../src/lib/netlist/analog/nld_bjt.cpp:8:
../../../../../src/lib/netlist/plib/vector_ops.h: In function ‘T plib::vec_mult(std::size_t, const V1&, const V2&)’:
../../../../../src/lib/netlist/plib/vector_ops.h:48:27: error: requested alignment 64 is larger than 8 [-Werror=attributes]
   PALIGNAS_VECTOROPT() b8 value = {0};
                           ^~~~~
../../../../../src/lib/netlist/plib/vector_ops.h: In function ‘T plib::vec_mult2(std::size_t, const VT&)’:
../../../../../src/lib/netlist/plib/vector_ops.h:60:27: error: requested alignment 64 is larger than 8 [-Werror=attributes]
   PALIGNAS_VECTOROPT() b8 value = {0};
                           ^~~~~
../../../../../src/lib/netlist/plib/vector_ops.h: In function ‘T plib::vec_sum(std::size_t, const VT&)’:
../../../../../src/lib/netlist/plib/vector_ops.h:82:28: error: requested alignment 64 is larger than 8 [-Werror=attributes]
    PALIGNAS_VECTOROPT() b8 value = {0};
                            ^~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [netlist.make:764: obj/Release/src/lib/netlist/analog/nld_bjt.o] Error 1
make[1]: *** [Makefile:28: netlist] Error 2
make: *** [makefile:1301: linux] Error 2
I can likely get around this issue by editing the Make file so that it is not treated as an error that halts the build.

altharic
Posts: 30
Joined: Sun Apr 29, 2018 7:27 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Wed Oct 23, 2019 6:13 pm

Go into the mame source directory and do nano makefile then uncommemt REGENIE=1 and NOWERROR=1

Save and try again it should compile then look at ARCHOPS you can send Cflags to the compiler to set fpu mtune and march.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Sat Oct 26, 2019 9:03 pm

This is what I am going to shoot for on Archopts:

ARCHOPTS = -mcpu=cortex-a72 -mfpu=neon-vfpv4 -mfloat-abi=hard

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Sat Oct 26, 2019 9:24 pm

The build has been started. I set DEBUG to 0 as well. That usually gives an extra boost in performance.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Sun Oct 27, 2019 2:20 am

The build has been going on for several hours and I now have many executable programs showing up. It looks like it is actually going to succeed this time. I am also building out the mame tools as well which probably explains why it is taking so long.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Sun Oct 27, 2019 3:11 am

Build has succeeded. Mame 0.214 is now working on RPI 4. Thanks for all the help that you have given me in making this possible. I plan on creating an instruction thread so that others may build Mame 0.214 with optimizations as well.

peanutbutter71
Posts: 5
Joined: Mon Oct 21, 2019 2:15 am

Re: Attempting to Build Mame 0.214 on RPI 4

Sat Nov 16, 2019 8:15 pm

I was curious to compile mame .215 without x11. Did you compile it on raspbian without x11? or what OS did you compile it on? also what kind of performance are you getting?

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Sat Nov 16, 2019 11:54 pm

I have compiled .215 as well. The OS I compiled under was default Raspbian. I use the following ARCHOPTS:

ARCHOPTS = -mcpu=cortex-a72 -mtune=cortex-a72 -mfpu=neon-vfpv4 -mfloat-abi=hard -funsafe-math-optimizations -fexpensive-optimizations -fprefetch-loop-arrays

It performs quite well and plays all the Neo-Geo systems at full speed and titles like Area 51 at close to full speed.

To issue make -j4, you will need to increase your swap size by doing:

Code: Select all

sudo nano /etc/dphys-swapfile


Then change CONF_SWAPSIZE=100 to CONF_SWAPSIZE=2048.

Save it then issue the following commands:

Code: Select all

sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
Issue your make -j4. Failure to change swap size will result in the system running out of RAM and locking up.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Sun Nov 17, 2019 1:19 am

After build is done, revert your swap back to default. Issue the commands to stop and start service and enjoy mame.

peanutbutter71
Posts: 5
Joined: Mon Oct 21, 2019 2:15 am

Re: Attempting to Build Mame 0.214 on RPI 4

Sun Nov 17, 2019 6:33 pm

I was messing around with mame from the raspbian repository this morning and I was shocked that even it ran well. but you think it's compiled without neon? In the repository version there is some weird static in the audio, but for most games it ran pretty well, and I am not overclocking.

graphicw
Posts: 91
Joined: Mon Sep 09, 2019 5:04 pm

Re: Attempting to Build Mame 0.214 on RPI 4

Mon Nov 18, 2019 8:05 pm

Building mame on your own will result in better performance than the version in the repositories. You can also use the newer ROMs correctly as well. The only problem I have noticed when building on your own is that certain games will cause name to crash.

California Speed is one such game that will crash everytime when you compile Name on your own. The repository version of California Speed will run, but not well. Not much of a loss considering the RPI 4 has no hope of running California Speed or other games that cause self compiled Name to crash. It simply lacks the CPU power to emulate those games even with an overclock.

You will be able to run all the games that ran on RPI 3 marginally at full speed or close to it if you roll your own Mame and do an overclock of the CPU. Area 51 actually run decently and actually reaches full speed in some areas of the game.

peanutbutter71
Posts: 5
Joined: Mon Oct 21, 2019 2:15 am

Re: Attempting to Build Mame 0.214 on RPI 4

Sun Dec 01, 2019 2:32 am

I was able to compile 64-bit aarch64 mame .216 on Gentoo on top of this image:

https://github.com/sakaki-/gentoo-on-rpi-64bit

it runs really well as long as i invoke it with -video accel

I have the Raspberry PI 4B with 4GB ram.

Return to “Gaming”