Page 1 of 2

MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Thu Feb 01, 2018 1:55 pm
by wboy
Hi all, my first post... a big read too sorry! :P

I recently purchased a RaspberryJAMMA’s (or two) from the good man dee2eR and have been very impressed with the hardware he’s designed & manufactured, not forgetting ArPiCade which is without doubt the simplest & customisable method I’ve seen to multi-game your existing arcade cabinet. Just brilliant!

I’ve been a long time MAME/emulation enthusiast with two cabinets at home, one upright and one cocktail. Love them both. Even more so now as I installed my first RaspberryJAMMA in the upright earlier this week which has given it a new life (normally has my Tekken Tag PCB within).

Very impressed from the start with the solution combination, though I had mild concerns with the power of the RPi 3 and how well it could emulate like a real board. Especially as I’ve never used any RPi’s in existence in any way before this week.

My experience with the setup has been nothing short of positive. I’ve been testing and tweaking away to try improve the appearance of the end product on-screen which I’d thought I share with you all now so you call all get the best of your RaspberryJAMMA setup.

The first and only ArPiCade I have downloaded and used is 3.811. Though much of what you’ll read below should work fine in an earlier releases of ArPiCade with MAME 0.181 for example.

While performing these tests I used:
  • My Sega Astro City cabinet with its 29” Nanao monitor mounted horizontally,
  • a wireless keyboard & mouse connected to the RPi 3,
  • all while being Wi-Fi connected to ArPiCade via a secure shell (ssh pi@ipaddress) to allow me to make quick and easy configuration changes and reboot the Pi if required to scan new roms I decided to test.

### BENCHMARKING GAMES ###

Starting with the default ArPiCade mame.ini in either pi@ipaddress:~/mame172 or ~/mame192, change (disable) the following values from 1 to 0 using nano. Use ^X, then Y & [Enter] to exit and save the changes when done.

autoframeskip 0 # automatic frameskip selection
throttle 0 # throttling to keep game running in sync with real time
sleep 0 # sleeping, which gives time back to other applications when idle
rotate 0 # only if you are planning to also benchmark vertical games even on if your monitor like mine is horizontally mounted!

Now launch the game you want to benchmark from your cabinet. Once it has loaded press F11 on your wireless keyboard to toggle the speed display. Hopefully the games should run over 100% proving the RPi you have installed can emulate it adequately in that version of MAME. If its already under 100% (e.g. mk or mk2), don’t ever expect the game to run smooth in that version of MAME unless you gamble over-clocking your RPi (which even I have not yet personally tried).

Here are the results of a few of my own tests.

The % figures I recorded is the lowest value I noticed (with the speed display toggled on) while playing each game for 30 seconds or so within each version of MAME. It can obviously fluctuate a lot depending on enemies and/or level etc. on-screen.

Code: Select all

rom name   0.172  0.192   Slower
--------   -----  -----   ------  
demonwld    132%   104%   78.79%
ghoulsu     173%   133%   76.88%
mpatrol     348%   182%   52.30%
sf2         160%   132%   82.50%
sgemf       139%   110%   79.14%
snowbros    211%   155%   73.46%
suprmrio    167%   117%   70.06%
wardner     170%   114%   67.06%
wbmlb       134%   114%   85.07%
wboy        138%   115%   83.33%
wwfsstar    172%   137%   79.65%

I also tested the Mortal Kombat roms mk and mk2 in 0.172. Both emulated well under 80% so I didn’t bother testing them in 0.192 looking at the trend above.


## SYNC TWEAKS FOR YOUR ARCADE CRT! ##

Benchmarking aside, let’s now get your favorite games scrolling flawlessly smooth on your CRT!

Head back to the mame.ini in either pi@ipaddress:~/mame172 or ~/mame192 and change (enable) the following value from 0 to 1 using nano. Use ^X, then Y & [Enter] to exit and save the changes when done.

waitvsync 1 # enable waiting for the start of VBLANK before flipping screens; reduces tearing effects

While there, if paranoid (doesn’t seem to matter as games run in fullscreen mode) ensure the following settings are disabled...

window 0 # window mode; otherwise, full screen mode is assumed
maximize 0 # default to maximized windows; otherwise, windows will be minimized
syncrefresh 0 # using the start of VBLANK for throttling instead of the game time


Now head back to your cabinet and start testing some games to see if you can notice a difference!

Where do personally see improvements?
  • A fast scrolling games like Wonder Boy (rom name matching my member name wboy - my favorite) appears to slow down on occasion as I run or skateboard fast forward across the screen (not always, but it’s there.)
  • Pass a level on Snow Bros (snowbros), and the animation when you fly up to the next level is without it 2 or 3 apparent sync stutters. You notice a similar improvement on the Street Fighter 2 (sf2) intro when it scrolls up the building to the SFII advertising banner at the top.
  • Even less common resolution games likes Moon Patrol (mpatrol) horizontally scrolls smoother. Do not enable syncrefresh together with waitvsync as it only destroys it again (subtlety I’d admit, but it’s there)

For those running their ArPiCade in HDMI mode (HiRes mode) trying to achieve a similar smoothness, I’d recommend you try...

throttle 1
waitvsync 0
syncrefresh 1


I have not tried this myself with ArPiCade (and don’t plan too) but this is very similar to a mame.ini configuration I’ve used on a laptop’s LCD screens or PC connected TVs in the past to get an optimal look.

Anyone reading this using a Windows based device/mame compile should also mame.ini enable Triple Buffering.

triplebuffer 1


I hope all you fellow RaspberryJAMMA owner’s try it out soon and report back also noticing the scrolling and sync improvements.

Happy emulating!

wboy.

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Wed Feb 07, 2018 2:21 am
by dee2eR
Awesome first post, thankyou. I'll have to adjust the sync settings before the next release.

Very interesting to see the benchmarked numbers 172 v 192. Wonder if there's anything that runs faster on 192? I also wonder why the result for Moon Patrol is so different, maybe it was updated to be more accurate or something.

I know of at least one game that renders better in 192 than 172, the obscure Snowbros clone, Little Robbin. Also someone reported Donkey Kong sounded more correct in 181 than 172 so I also run that in 192. Otherwise I've been extremely impressed with 172s performance on Pi.

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Wed Feb 07, 2018 9:44 am
by wboy
Thanks dee2er. More than happy to share my findings and test methods to help the community here.

I'm a bit late to the RaspberryJAMMA ARpiCADE ride, but this such an awesome bit of kit that I'm just happy I tweaked and tested to find the crisp output when using waitvsync. Would be selfish/criminal not to share the find! :twisted:

Have downloaded 3.7 with the intension to test 0.181 for shits and giggles. Will test the same roms shortly.

Yes mpatrol drop was somewhat unexpected.

While 0.172 rocks in many ways it seems, I would love to see if we could get the earliest SDL 2.0 mame version going on a future arpicade (non retroarch core) to see how well it might perform for more cpu intensive roms.

Until soon.

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Wed Feb 07, 2018 12:06 pm
by wboy
Stock 3.7 image, update(s) not applied.

0.181 benchmark results added. 0.172 still king it seems.

Code: Select all

rom name   0.172   0.181   Diff A   0.192   Diff B
--------   -----   -----   ------   -----   ------
demonwld    132%    112%    84.8%    104%    78.8%
ghoulsu     173%    131%    75.7%    133%    76.9%
mpatrol     348%    224%    64.4%    182%    52.3%
sf2         160%    128%    80.0%    132%    82.5%
sgemf       139%    N/A      0.0%    110%    79.1%
snowbros    211%    151%    71.6%    155%    73.5%
suprmrio    167%    142%    85.0%    117%    70.1%
wardner     170%    134%    78.8%    114%    67.1%
wbmlb       134%    113%    84.3%    114%    85.1%
wboy        138%    118%    85.5%    115%    83.3%
wwfsstar    172%    134%    77.9%    137%    79.7%
littlerb    147%    132%    89.8%    112%    76.2%

Diff A = Slower 0.181 than 0.172
Diff B = Slower 0.192 than 0.172

sgemf didn't like me thus N/A.
littlerb seems to be attempt to load a different mode/timing for the required 338x288 res. It's the only rom so far where the image didn't lock on my Nanao (vertical rolling image - on 3.811 using either 0.172 or 0.192). Displays fine in 3.7 using 0.181. mame .sh launcher differences maybe?

P.S. you also left a 2 mil+ lvl36 snowbros hi score on 3.811 0.172 Mr DEE! :D

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Thu Feb 08, 2018 12:53 am
by dee2eR
3.7 may be the last version that didn't change resolution to 288p which is why you didn't have the sync issue with littlerb on the older version. If you tweak your vertical sync/hold pot on your chassis you should be able to find a spot where the 240p and 288p (and 256p) modes all sync ok, may take a couple of tries swapping between resolutions to get just right.

Snowbros is my goto game to test high score saving with as the default high score is easy to beat in the first level. I'm out of practice, my best is 3.8 mil. I was trying to chase the world record for a while, I think the record is just over 5 mil (or was at the time). I wish it was a more popular game, it's fun to play for points (except when you don't get the red powerup drop) thanks to the level design and scoring system making scoring well a bit of a puzzle.

Cool to see some stuff is actually running faster in 192 than 181.

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Thu Feb 08, 2018 7:02 am
by dee2eR
So I did a little more testing with Snowbros. The 57.5 frames per second refresh is a tricky one, with your suggested change to mame.ini it's still not actually smooth (transistions between screens)when running at 60 frames due to what appears to be mis-matched refresh causing the occational doubled frame (frame that displays for 2 frames), vs smoother scroll with frame tearing without the waitvsync on. In gameplay I prefer the original setting as the minor tearing between screens is less distracting than the occational doubled frame. Neither result is perfect.

So I tried making a custom modeline for 240@57.5, results not quite right - I'm not sure if the Pi is outputting the exact refresh as entered or the closest it can do. Tried 224 @ 57.5 just to check but the results are visually identical to 240 lines. Also tried the refreshspeed setting in mame.ini but still not perfect. I'm going to keep trying I think, I checked the original PCB and it's butter smooth as you would expect. Interestingly the picture out of the original PCB is quite a bit darker than the RaspberryJAMMAs, on other PCBs I've tried it's been similar levels at the same monitor settings (STV is a touch brighter, not that it emulates well on Pi).

I'll try some more modeline stuff and see if I can get it perfect, it's so close now but once you see it you can't unsee it... like noticing the paint on the plastic panels of your car doesn't quite perfectly match the metal panels.

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Thu Feb 08, 2018 12:21 pm
by wboy
Sorry but just to confirm you did set throttle 0 too?

I took your stock 172 lowResHori and only enabled waitvsync 1, and it too list staggered on the snowbros vertical scroll level jump (maybe 3-4 apparent frame staggers). It's not until I set throttle 0 it looks smooth/flawless (victory).

As a precaution (though seemingly not a necessity) also autoframeskip 0 & sleep 0 too.

advmame snowbrows seems to do 3 apparent frame staggers IMO with the stock setup.

Call me a mad pot smoking nut bag, but I swear the horizontal scroll of wboy (subtle) and mpatrol (more noticeable) seems less staggered too. Yet to try my smaller monitor second cab but may try do that tomorrow if I get a chance.

We are locals technically, you're welcome over to see it in person. I'll supply the beers and pizza too! :P

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Fri Feb 09, 2018 3:17 am
by dee2eR
right you are, that's a bit embarassing. Much better now. Makes the difference between AdvMAME and MAME172 noticable, they were basically the same before the change.

With the changes you suggested I see no noticable stagger in Moon Patrol, it's now running solidly on 256@56Hz mode, only .7Hz off from the original PCB. Plays great from what I can tell, not that I'm an expert - fun game though. Just noticed Moon Patrol spells continue wrong... countinue.

I'm running Wonderboy in AdvMAME seems ok to me but I'll defer to your knowledge of that game. Like Moon Patrol I enjoy the game but am no expert. When you find where it's best please let me know.

I'm going to check AdvMAME 1.2 v 1.4 as I've heard on DOS 1.2 works better, no idea if it will translate to better on Pi (especially running SDL).

EDIT:
1.2 was the same so I swapped back to 1.4 and tried some more stuff, I think I have it. In advmame.sdl.rc change vsync to yes and display_adjust to x (not sure if my change to to the launcher for 57.5Hz is crucial to it working though).

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Fri Feb 09, 2018 8:26 am
by wboy
Woo Hoo... just glad you're finally seeing it! :D

Yes correct, before the tweaks, no real noticeable difference between the two versions!

Yes I admit the horizontal thing I mentioned is super subtle, but I reckon I can recognize it easy enough on my 29" Nanao. Focus on the land pixels, not the vehicle. In AdvMame it's like it makes a minor pixel move/step every second or so. 172 doesn't do the same to my eye, though admittedly I guess it's 720 horizontally stretched, if that make a difference(?).

Wonder Boy is harder to notice, but I swear to my eye 172 is just a smoother horizontal transition... not that AdvMAME is bad, just not as smooth. I actually want to compare it to my official wboy PCB in the same cabinet on the same monitor (which will be my cocktail yet to have it's RaspberryJAMMA installed - soon).

So sweet and excited to read your edit/vsync tweaks to 1.4 seem to work! I know I fiddled with it days ago and seemingly made it better for the 60Hz games IIRC, but yeah, snowbros seemed no different. 172 as still the output king then.

EDIT: misread your 'x' change and made it as device_video x (ooops) though all good.

In quick testing...

snowbros seems same again scrolling up the level but then I don't have the extra mode you mention configured. Also tried wboy and good ole-anal me still thinks it's not as smooth side scrolling as 172. More to test though. The intro building up scroll on sf2 scrolls beautifully I admit!

EDIT2: Had a bit more of a play around testing most of not all of the display_adjust options, but still can't seem to get 1.4/106 vsync looking as good 172. Hmmm.

Re: MAME benchmarking and sync tweaks for your Arcade Cabinet’s CRT

Posted: Tue Feb 20, 2018 3:34 am
by cool_factor
Is this correct for 172 mame.ini file:

samplepath samples;home/pi/.advance/sample

in 192 its:

samplepath boot/sample

May explain why GORF seems to play with no sample sounds??? Sample file is in boot/sample on Arpicade side/drive/folder