Previous Thread
Next Thread
Print Thread
#118109 11/14/20 02:59 PM
Joined: Sep 2000
Posts: 231
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 231
Hello has anyone tried (SDL) MAME on Big Sur macOS 11.0.1 yet?

I get a blank gray screen. I can start the game and hear the sounds but the screen stays blank.
Switching to video=OpenGL or video=soft works. So it looks like an issue with bgfx.
I tried backend metal with no change. If I change the backend to OpenGL mame crashes with illegal video instruction.

Any solutions here? Thanks!


=will=
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
These are known issues. I meant to put out an advisory about it but I've been running the betas so long I missed the release day.

-video bgfx with backend metal will give a gray screen. MAME is running (you can hear the sounds), but no video draws. It's unclear if this is BGFX's fault or if SDL isn't properly setting up the view.

-video bgfx with backend OpenGL crashes due to a Clang compiler bug. I know this because the MAME subset that comes with the AMPLE Apple II-only frontend for macOS is built with an older compiler and BGFX with OpenGL works on Big Sur in that version.

I'll add something before the next freeze to revert the default to OpenGL on Big Sur.

Joined: Sep 2000
Posts: 231
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 231
Thanks RB! Also I tried compiling on Big Sur and have run into this error:

Compiling src/emu/xtal.cpp...
Compiling src/emu/rendfont.cpp...
Compiling src/emu/rendlay.cpp...
Archiving libemu.a...
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../../../../osx_clang/bin/x64/Release/libemu.a(rgbgen.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: ../../../../osx_clang/bin/x64/Release/libemu.a(rgbvmx.o) has no symbols
make: *** [macosx_x64_clang] Error 2

Is this a known bug with Clang too?


=will=
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
The part you show is not an error, that happened previously. MAME builds fine for me with Xcode 12.2 on Big Sur. I'll try a full tree build though.

Joined: Sep 2000
Posts: 231
W
will Offline OP
Senior Member
OP Offline
Senior Member
W
Joined: Sep 2000
Posts: 231
OK here's a couple of errors I found:

Code
Compiling src/emu/disound.cpp...
../../../../../src/mame/drivers/cmi.cpp:164:43: error: result of '10 ^ 7' is 13;
      did you mean '1e7'? [-Werror,-Wxor-used-as-pow]
        12 ^ 7, 8 ^ 7, 13 ^ 7, 9 ^ 7, 14 ^ 7, 10 ^ 7, 15 ^ 7, 11  ^ 7
                                              ~~~^~~
                                              1e7
../../../../../src/mame/drivers/cmi.cpp:164:43: note: replace expression with
      '0xA ^ 7' or use 'xor' instead of '^' to silence this warning
Compiling src/mame/video/antic.cpp...
1 error generated.
make[2]: *** [../../../../osx_clang/obj/x64/Release/src/mame/drivers/cmi.o] Error 1
make[1]: *** [fairlight] Error 2
make[1]: *** Waiting for unfinished jobs....


Compiling 3rdparty/libflac/src/libFLAC/float.c...
../../../../../src/mame/drivers/cmi.cpp:164:43: error: result of '10 ^ 7' is 13; did you mean '1e7'? [-Werror,-Wxor-used-as-pow]
        12 ^ 7, 8 ^ 7, 13 ^ 7, 9 ^ 7, 14 ^ 7, 10 ^ 7, 15 ^ 7, 11  ^ 7
                                              ~~~^~~
                                              1e7
../../../../../src/mame/drivers/cmi.cpp:164:43: note: replace expression with '0xA ^ 7' or use 'xor' instead of '^' to silence this warning


=will=
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
Ahh, ok. Yeah, that's a problem in the last release, it's been fixed since then in GitHub.

Joined: Sep 2010
Posts: 21
B
Member
Offline
Member
B
Joined: Sep 2010
Posts: 21
Originally Posted by R. Belmont
These are known issues. I meant to put out an advisory about it but I've been running the betas so long I missed the release day.

-video bgfx with backend metal will give a gray screen. MAME is running (you can hear the sounds), but no video draws. It's unclear if this is BGFX's fault or if SDL isn't properly setting up the view.

I'm not sure if this is due to Apple breakage or a bug in bgfx. Updating to latest bx/bgfx/bimg causes the problem to change to a deadlock instead. This deadlock can be mitigated by defining BGFX_CONFIG_MULTITHREADED=0. See https://github.com/bkaradzic/bgfx/issues/2036 for more details and a different workaround.

Originally Posted by R. Belmont
-video bgfx with backend OpenGL crashes due to a Clang compiler bug. I know this because the MAME subset that comes with the AMPLE Apple II-only frontend for macOS is built with an older compiler and BGFX with OpenGL works on Big Sur in that version.

This is not a Clang compiler bug. The likely reason that the version built with an older compiler works, is because it is also built with an older SDK, and Apple is likely using some workaround meant for older programs that cannot be patched and rebuilt.
As the crash log indicates, the crash happens because bgfx is trying to set up OpenGL on a thread that is not the main thread. macOS no longer allows this. This appears to be low priority for bgfx: see the comments at https://github.com/bkaradzic/bgfx/pull/2019 — this specific PR was immediately reverted. Setting BGFX_CONFIG_MULTITHREADED=0 mitigates this problem as well.

EDIT: I can confirm that setting BGFX_CONFIG_MULTITHREADED=0 (as a define in 3rdparty.lua) fixes the problem in the version of bgfx shipped with MAME.

Last edited by balrog; 11/17/20 02:53 AM. Reason: note that linked PR was reverted, add mitigation for second issue
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
Thanks Balrog! The next MAME release (or now, if you grab the source from GitHub) will work 100% with both Metal and OpenGL BGFX backends on Catalina and Big Sur.

For the other big question Mac users are going to have, yes I have ordered an Apple Silicon Mac (a Mac Mini with 16 GB of RAM, to be exact). Unfortunately 16 GB systems are backordered and my current shipping estimate is mid-December, so formal support may not make the next MAME release. I don't expect there to be significant issues compiling MAME for Apple Silicon, but I can't guarantee anything either.

Joined: Sep 2010
Posts: 21
B
Member
Offline
Member
B
Joined: Sep 2010
Posts: 21
There is a preliminary port to Apple Silicon (thanks Micko for the GENie updates!) at https://github.com/balr0g/mame/tree/apple-silicon-testing .

For now, one must build withUSE_BUNDLED_LIB_SDL2=1 NOWERROR=1, as the official SDL2.framework is Intel-only, and there are some warnings that I haven't yet fixed.

This tree has updated bgfx, bimg, and bx, as well as updated bundled SDL with some fixes.

Preliminary benchmarks (-bench 240) or -bench 90 (M1 MBP 16GB):
c64 (no software): 753.70%
pitfall [a2600]: 3086.07%
pacman: 18297.12%
dkong: 6182.86%
pong: 528.26%
pongf: 529.45%
tempest: 1649.45%
sf2: 3527.38%
sf: 3160.66%
tekken: 646.30%

Last edited by balrog; 11/18/20 05:12 PM. Reason: add more benchmarks

Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
1 members (Reznor007), 45 guests, and 2 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,835
Posts116,215
Members4,921
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.5