Previous Thread
Next Thread
Print Thread
Page 5 of 7 1 2 3 4 5 6 7
Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116167 10/08/19 10:43 PM
Joined: Aug 2019
Posts: 33
S
Steve Bourg Offline OP
Member
OP Offline
Member
S
Joined: Aug 2019
Posts: 33
These results are from MAME compiled with default options, run in the Ubuntu MATE release shipped for the Odroid. Host display resolution is at 1920x1080.

Last edited by Steve Bourg; 10/08/19 10:44 PM.
Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116168 10/08/19 10:58 PM
Joined: Oct 2019
Posts: 21
R
Robert Hildinger Offline
Member
Offline
Member
R
Joined: Oct 2019
Posts: 21
Here's something you might find interesting. Based on the information here ( http://mameui.info/Bench.htm ), it appears that MAME in general suffered a pretty big performance setback with version 0.200. I think it was related to memory handlers, but not sure. Anyway, I compiled version 0.199 of mame to see if it made a difference in the maciici emulation, and it turns out it makes a fairly big difference:

Current mame:

Code
pi@raspberrypi:~/MAME/mame $ ./mamemac maciici -bench 60
Average speed: 143.10% (59 seconds)

Old mame 0.199:

Code
pi@raspberrypi:~/MAME/old/199/mame $ ./mamemac199 maciici -bench 60
Average speed: 180.19% (59 seconds)


For this specific case, mame v0.199 emulates the maciici 26% faster. If you want to try it yourself you'll have to recompile your mame from scratch, and do a "git checkout mame0199" in your repo before building.

-Robert

Re: MAME on ODROID-N2 (Linux) [Re: Robert Hildinger] #116169 10/08/19 11:08 PM
Joined: Aug 2019
Posts: 33
S
Steve Bourg Offline OP
Member
OP Offline
Member
S
Joined: Aug 2019
Posts: 33
That that stings, as I need a capability/fix as of 0201.. I'll definitely give it a try though.

Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116172 10/10/19 04:22 AM
Joined: Aug 2019
Posts: 33
S
Steve Bourg Offline OP
Member
OP Offline
Member
S
Joined: Aug 2019
Posts: 33
I've posted steps for building / running MAME on the odroid-n2 over at their forum https://forum.odroid.com/viewtopic.php?f=177&t=36521 crashovrd (irc name), is willing to reproduce the build and then see if there's anything that can be optimized.

Re: MAME on ODROID-N2 (Linux) [Re: belegdol] #116190 10/16/19 11:42 PM
Joined: Aug 2019
Posts: 33
S
Steve Bourg Offline OP
Member
OP Offline
Member
S
Joined: Aug 2019
Posts: 33
Originally Posted by belegdol
I might have found a solution less drastic than ripping out bgfx entirely: due to logic in 3rdparty/bgfx/config.h and 3rdparty/bgfx/renderer_gl.h, bgfx appears to default to glx under linux. I have now tested the following hack:
Code
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 4ec2084d0f..ea6fa2f506 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -1347,6 +1347,12 @@ end
                "__STDC_CONSTANT_MACROS",
                "BGFX_CONFIG_MAX_FRAME_BUFFERS=128",
        }
+       if _OPTIONS["NO_X11"]=="1" then
+               defines {
+               "BGFX_CONFIG_RENDERER_OPENGLES=1",
+               "BGFX_CONFIG_RENDERER_OPENGL=0",
+               }
+       end

With this change, mame can be built with
Code
$ make NO_X11=1 NOWERROR=1 NO_USE_XINPUT=1 NO_OPENGL=1

without hitting linking errors with bgfx. Bgfx uses OpenGL ES afterwards too which might be helpful as well.


Code
26a27
> # NO_OPENGL = 0
713a715,718
> endif
> 
> ifdef NO_OPENGL
> PARAMS += --NO_OPENGL='$(NO_OPENGL)'


Hi Belegdol -

Belmont's pixel format change allowed mame to run at console framebuffer, which is now in mame. The changes you provide above allowed me to compile mame without X / OpenGL on the odroid-n2. Is there any path forward to get this pulled into the mame?

As well, there's another patch provided by crashoverride in this thread that enabled framebuffered bgfx from console. Any chance of getting this into mame?

Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116192 10/17/19 06:08 AM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
The patch disabling bgfx entirely was not endorsed by upstream. We are thus left with 3 changes:
- Switching BGFX to OpenGL ES if NO_X11 is specified
- Allowing passing NO_OPENGL explicitly
- bgfx changes by crashoverride

The way to get those in would be via a pull request. I can make a PR with the two buildsystem changes later this week. The bgfx changes should ideally be submitted to bgfx upstream first (https://github.com/bkaradzic/bgfx).

Last edited by belegdol; 10/17/19 06:09 AM.
Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116193 10/17/19 07:17 AM
Joined: Aug 2019
Posts: 33
S
Steve Bourg Offline OP
Member
OP Offline
Member
S
Joined: Aug 2019
Posts: 33
I may have just encountered a problem with crashoverride's bgfx changes (whether it's something specific to crashoverride's code that enables the use of bgfx or it's some other problem with bgfx on odroid-n2, or just something else about that compiled binary, I don't know). The game I'm playing consistently locks up at a screen change that only happens with that bgfx binary. So I recommend handling that contribution separately.

I stopped using the patch you originally provided that completely disabled/stripped bgfx, and I have been using your second approach "BGFX to OpenGL ES if NO_X11". I believe it took both your "NO_OPENGL" and your "BGFX to OpenGL ES if no NO_X11" patches to get mame compiled on the odroid n2 without X. I would just mention that even with the second approach, running mame with "-video bgfx" did not work - I encounter the error:
Code
../../../../../3rdparty/bgfx/src/glcontext_egl.cpp (177): BGFX 0x00000002: Failed to create display 0x0
Aborted

Your second approach did enable me to get MAME compiled/linked, and MAME's performance with -video accel is just 2% less than -video bgfx from crashoverride's patch. This runs at ~ 90% emulation speed on the odroid n2. So your second approach is a big win even without a working -video bgfx option.

Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116198 10/17/19 02:37 PM
Joined: Aug 2019
Posts: 33
S
Steve Bourg Offline OP
Member
OP Offline
Member
S
Joined: Aug 2019
Posts: 33
Quote
belegdol: can you run a build with VERBOSE=1 and post what flags are being used?


Is this the output you're looking for?
Code
3rdparty/genie/bin/linux/genie --distro=generic --OPTIMIZE=3 --NOWERROR='1' --target='mame' --subtarget='mame' --build-dir='build' --NO_OPENGL='1' --NO_X11='1' --NO_USE_XINPUT='1' --SOURCES='src/mame/drivers/mac.cpp' --NOASM='1' --osd='sdl' --targetos='linux' --PLATFORM='arm64' --gcc=linux-gcc --gcc_version=7 gmake
..
Precompiling src/emu/emu.h...
g++    -MMD -MP -MP -DNDEBUG -DCRLF=2 -DLSB_FIRST -DFLAC__NO_DLL -DPUGIXML_HEADER_ONLY -DMAME_NOASM -DLUA_COMPAT_ALL -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DPTR64=1 -I"../../../../../src/osd" -I"../../../../../src/emu" -I"../../../../../src/lib/util"  -pipe -O3 -fno-strict-aliasing -Wno-unknown-pragmas -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -Wno-error=deprecated-declarations -Wno-unused-result -Wno-array-bounds -Wno-cast-align -x c++ -std=c++14 -Woverloaded-virtual -Wsuggest-override -flifetime-dse=1 -x c++-header -DNDEBUG -DCRLF=2 -DLSB_FIRST -DFLAC__NO_DLL -DPUGIXML_HEADER_ONLY -DMAME_NOASM -DLUA_COMPAT_ALL -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DPTR64=1 -I"../../../../../src/osd" -I"../../../../../src/emu" -I"../../../../../src/lib/util" -o "obj/Release/emu.h.gch" -c "../../../../../src/emu/emu.h"

Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116199 10/17/19 04:29 PM
Joined: Oct 2019
Posts: 21
R
Robert Hildinger Offline
Member
Offline
Member
R
Joined: Oct 2019
Posts: 21
Originally Posted by Steve Bourg
That that stings, as I need a capability/fix as of 0201.. I'll definitely give it a try though.


As it turns out, the maciici emulation doesn't suffer much of a performance hit from the memory system rewrite in 0.200. The actual point where the hit occurs is between 0.203 and 0.204, but I don't yet know which commit caused it. You could try compiling 0.203 and see if that gives you a performance boost.

Re: MAME on ODROID-N2 (Linux) [Re: Steve Bourg] #116200 10/17/19 04:45 PM
Joined: Mar 2004
Posts: 648
belegdol Offline
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 648
Originally Posted by Steve Bourg
Quote
belegdol: can you run a build with VERBOSE=1 and post what flags are being used?


Is this the output you're looking for?
Code
3rdparty/genie/bin/linux/genie --distro=generic --OPTIMIZE=3 --NOWERROR='1' --target='mame' --subtarget='mame' --build-dir='build' --NO_OPENGL='1' --NO_X11='1' --NO_USE_XINPUT='1' --SOURCES='src/mame/drivers/mac.cpp' --NOASM='1' --osd='sdl' --targetos='linux' --PLATFORM='arm64' --gcc=linux-gcc --gcc_version=7 gmake
..
Precompiling src/emu/emu.h...
g++    -MMD -MP -MP -DNDEBUG -DCRLF=2 -DLSB_FIRST -DFLAC__NO_DLL -DPUGIXML_HEADER_ONLY -DMAME_NOASM -DLUA_COMPAT_ALL -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DPTR64=1 -I"../../../../../src/osd" -I"../../../../../src/emu" -I"../../../../../src/lib/util"  -pipe -O3 -fno-strict-aliasing -Wno-unknown-pragmas -Wall -Wcast-align -Wundef -Wformat-security -Wwrite-strings -Wno-sign-compare -Wno-conversion -Wno-error=deprecated-declarations -Wno-unused-result -Wno-array-bounds -Wno-cast-align -x c++ -std=c++14 -Woverloaded-virtual -Wsuggest-override -flifetime-dse=1 -x c++-header -DNDEBUG -DCRLF=2 -DLSB_FIRST -DFLAC__NO_DLL -DPUGIXML_HEADER_ONLY -DMAME_NOASM -DLUA_COMPAT_ALL -DLUA_COMPAT_5_1 -DLUA_COMPAT_5_2 -DPTR64=1 -I"../../../../../src/osd" -I"../../../../../src/emu" -I"../../../../../src/lib/util" -o "obj/Release/emu.h.gch" -c "../../../../../src/emu/emu.h"

Yes, these are the droids I am looking for. You could try passing ARCHOPTS=-march=native to make (need to do REGENIE=1 for the change to take effect). Make sure the flag actually does anything by running
Code
$ gcc -march=native -E -v - </dev/null 2>&1 | grep cc1

Don't hold your breath, but if a couple percent speed bump is all you need this might just do the trick.

Page 5 of 7 1 2 3 4 5 6 7

Moderated by  R. Belmont 

Who's Online Now
2 registered members (2 invisible), 143 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,722
Posts114,651
Members4,873
Most Online510
Aug 26th, 2019
Powered by UBB.threads™ PHP Forum Software 7.7.3