MAME v-sync/refresh/speed-up question

The place for all discussion on gaming hardware
User avatar
Fudoh
Posts: 13045
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

MAME v-sync/refresh/speed-up question

Post by Fudoh »

It's been a VERY long time since I last used MAME.

Back then it was no problem to run ANY game speed-adjusted with a perfect v-sync on a 60Hz LCD screen. DoDonPachi for example (which has an internal refresh rate 57.xx Hz) was automatically speed up to 104% to allow for perfectly smooth scrolling.

I'm obviously too stupid to get this done on a current MAME version. Right now I'm trying CaveUI, but it seems to be the same on other current MAME version. No matter which sync option I check (or uncheck) DDP (or Guwange) keeps running at 57.xx Hz and is framerate converted to the LCD's 60Hz which obviously causes choppy scrolling.

From the MAME docs, "syncrefresh" sounds what I'm looking for
-[no]syncrefresh
155
156 Enables speed throttling only to the refresh of your monitor. This
157 means that the game's actual refresh rate is ignored; however, the
158 sound code still attempts to keep up with the game's original refresh
159 rate, so you may encounter sound problems. This option is intended
160 mainly for those who have tweaked their video card's settings to
161 provide carefully matched refresh rate options. Note that this option
162 does not work with -video gdi mode.The default is OFF (-nosyncrefresh).
but it doesn't do anything here.

Any help on this would be highly appreciated !! Thanks!
fagin
Posts: 1654
Joined: Fri Mar 19, 2010 2:29 pm
Location: UK

Re: MAME v-sync/refresh/speed-up question

Post by fagin »

Getting a smooth framerate is easy..... getting a smooth framerate and no input lag is the problem (with the, shall I say, more recent versions of MAME) imo.
User avatar
lettuce
Posts: 1336
Joined: Wed Jun 22, 2011 7:10 pm
Location: Bedfordshire, England.

Re: MAME v-sync/refresh/speed-up question

Post by lettuce »

Try using groovyMAME, its this type of thing it's built for, or thought for its full blown features it is best used with an ati card and CRT display but does work on nvidia cards and LCD displays but you won't get the correctly smooth scrolling, Mortal Kombat title screen with the characters faces scrolling on either side of the screen, with groovyMAME, ati card and CRT this is 100% smooth just like the arcade anything else and the scrolling is choppy !. If your using an lcd display Make sure you have

Throttle. 1
Syncrefresh 0
Tripplebuffer 1

GroovyMAME features:

* Generate custom modelines and use them as game calls for them
* In Windows with ATI cards we can alter the refresh rate of existing modelines for game requirements
* Resolution change capability with modeline switching in Windows and Linux, PSX games and others
* Multithreaded mode and waitvsync work together in Windows without throttle
* MKChamp hi score patch compatible/ Works with Linux too (hiscore.dat goes in the \hi\ directory)
* Froger/Galaxian resolution fixes for Windows and Linux (so they look normal for arcade resolutions)
* Sound sync for Windows (not in Linux) triplebuffer, capable of being turned off (default)
* Clean stretch both Windows and Linux
* Redraw frames so 30Hz games run at 60Hz like Tron in Windows and Linux
* Most settings and features are automatically set as needed depending on the resolution used,
  like if throttling is necessary, or can use vsync instead, or fall back to triplebuffer.
* In Windows can use ArcadeVGA 3000 cards or others without any .ini files, picks best resolution automatically
User avatar
shmuppyLove
Posts: 3708
Joined: Thu Apr 07, 2011 1:44 pm
Location: Toronto

Re: MAME v-sync/refresh/speed-up question

Post by shmuppyLove »

There's another option in there to modify the game speed to sync to the refresh rate that I believe fixes this problem, but probably introduces a tiny bit of lag.

For many many years I had all the sync and buffer options enabled to get a nice smooth display. It wasn't until I really started seriously playing shmups like Batrider that I noticed it was an issue. Now I play with them all off and I deal with the tearing. Lesser of two evils if you ask me.
fagin
Posts: 1654
Joined: Fri Mar 19, 2010 2:29 pm
Location: UK

Re: MAME v-sync/refresh/speed-up question

Post by fagin »

shmuppyLove wrote:There's another option in there to modify the game speed to sync to the refresh rate that I believe fixes this problem, but probably introduces a tiny bit of lag.
That's the EXACT point.... there doesn't appear to be an option in the formal MAME build. Lag is slightly more than "tiny" trust me! lol You keep a direction button pressed and it will just keep moving in the direction seconds after you took your finger off!!

As already suggested.... using another build of XYZMAME appears to be the solution under current builds.
User avatar
Fudoh
Posts: 13045
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by Fudoh »

Getting a smooth framerate is easy..... getting a smooth framerate and no input lag is the problem (with the, shall I say, more recent versions of MAME) imo.
so let's for a moment assume I don't care about lag, how do I achieve what I want I a newer MAME version ? As I said, I tried enabling various options (sync to monitor refresh, syncrefresh etc) and it gets rid of the tearing, but I don't seem to be able to speed up the games to run on my monitor's refresh rate.
User avatar
shmuppyLove
Posts: 3708
Joined: Thu Apr 07, 2011 1:44 pm
Location: Toronto

Re: MAME v-sync/refresh/speed-up question

Post by shmuppyLove »

I'll check my INI when I get home. I use MameUI 143u9, so not sure where in the INI the setting is since I use the GUI to set all that up, but shouldn't be too hard to find. I'm pretty sure it's a core MAME option and not specific to MameUI
User avatar
Fudoh
Posts: 13045
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by Fudoh »

Ok, figured it out. The throttling was disabled on default and the switch wasn't available on one of the F buttons. Works now!
fagin
Posts: 1654
Joined: Fri Mar 19, 2010 2:29 pm
Location: UK

Re: MAME v-sync/refresh/speed-up question

Post by fagin »

Fudoh wrote:Ok, figured it out. The throttling was disabled on default and the switch wasn't available on one of the F buttons. Works now!
Out of interest are you experiencing a lag issue? If not could you post your settings?
User avatar
cools
Posts: 2057
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by cools »

Correct settings for LCDs with MAME:

autoframeskip 1
throttle 0
refreshspeed 1
syncrefresh 1
Image
User avatar
Fudoh
Posts: 13045
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by Fudoh »

There's obvious a little lag when going from "tearing hell" to v-synced goodness, but it doesn't feel lagier when speed up to 104% compared to 100% with choppy scrolling.
User avatar
Fudoh
Posts: 13045
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by Fudoh »

Correct settings for LCDs with MAME:
autoframeskip 1
throttle 0
refreshspeed 1
syncrefresh 1
refreshspeed isn't needed. It's off here. It's the combination of throttle = 0 and syncrefresh 1 which does the trick. I've got frameskip to zero as well.
User avatar
lettuce
Posts: 1336
Joined: Wed Jun 22, 2011 7:10 pm
Location: Bedfordshire, England.

Re: MAME v-sync/refresh/speed-up question

Post by lettuce »

recent versions of the new timing patch require -throttle to be enabled, otherwise -syncrefresh is not considered, probably this was your case if you were using an old mame.ini file??

Surely running the game too fast to destroying the whole gameplay??, having

Throttle 1
Syncrefresh 0
Tripplebuffer 1

set in the ini file should see the game running 100% speed with no tearing or lag...this is with groovymame however so cant speak for other versions of mame. If you were fortunate enough to have a CRT display and ATI card, you wouldn't need tripplebuffer or vsync enabled at all and still you wouldn't get any screen tear and also no noticeable lag to speak of, a win win situation!
User avatar
Fudoh
Posts: 13045
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by Fudoh »

set in the ini file should see the game running 100% speed with no tearing or lag
but that's not what I want. If the speed stays at 100% the scrolling is choppy. I need a variable speed, e.g. from 95% to 105%.
User avatar
shmuppyLove
Posts: 3708
Joined: Thu Apr 07, 2011 1:44 pm
Location: Toronto

Re: MAME v-sync/refresh/speed-up question

Post by shmuppyLove »

Well you don't want the emulation speed to drop below 100%, because then the game is running slower than it's supposed to and you'll get stuttering audio and other bad things.

I dunno it starts to make my brain hurt when I think of the speed that the game is supposed to run at, and the speed that the emulator is running it at, and the refresh rate of the display, etc etc.
User avatar
matrigs
Posts: 682
Joined: Mon Jan 18, 2010 7:27 pm
Location: Poland

Re: MAME v-sync/refresh/speed-up question

Post by matrigs »

so what are the settings to actually make it back lagless ?

i tried these settings in shmupmame 2 yesterday and cannot revert back.
User avatar
cools
Posts: 2057
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by cools »

Fudoh wrote:
Correct settings for LCDs with MAME:
autoframeskip 1
throttle 0
refreshspeed 1
syncrefresh 1
refreshspeed isn't needed. It's off here. It's the combination of throttle = 0 and syncrefresh 1 which does the trick. I've got frameskip to zero as well.
You're right. In fact I can't quite figure out what refreshspeed actually does...

throttle off seems to be the key to everything! This is interesting.

Another set to try:
throttle 0
waitvsync 1
syncrefresh 0

Seems to give the same result. Can't check the sound behaviour at the moment. I've not tested but this feels like there is less lag than with syncrefresh enabled.

For giggles, enable multithreading with throttle disabled.

Regarding autoframeskip - it's preference, if a game runs > 100% then it's inactive. Doesn't seem to cause any detrimental effects by having it enabled.
Image
Calamity
Posts: 18
Joined: Sun Jan 30, 2011 6:26 pm

Re: MAME v-sync/refresh/speed-up question

Post by Calamity »

The problem with -throttle producing stuttering when combined with video synchronizing options has its roots in a modification in the throttling mechanism introduced in MAME v0.114:

http://mametesters.org/view.php?id=2047

Since then, the right options to get smooth video are these:

For ddraw:
-nothrottle
-triplebuffer

For d3d:
-nothrottle
-syncrefresh / -waitvsync / -triplebuffer (any of them is good)

However, the sound still works on its own, so you'll sure get some degree of stuttering in sound depending on the resulting emulation speed.

I've written a long essay on this stuff, I'm currently finishing the last part of it, hopefully will be ready in the next couple of weeks.

All these issues are sorted in GroovyMAME. I would really appreciate some of you guys in this forums who are familiar with input lag issues to give a try to this build, as I believe its implementation of -syncrefresh has as low lag as using -throttle alone (with the benefit of zero tearing):

http://shmups.system11.org/viewtopic.ph ... 00#p813400
User avatar
Overkill
Posts: 513
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME v-sync/refresh/speed-up question

Post by Overkill »

Trying to start using MAME with hlsl on a 1920x1080 lcd, shoud i select ddraw, like when using arcadeVGA, or should i use direct3d? I use a I7 2600k at 3.4, should i change something in: #
# WINDOWS PERFORMANCE OPTIONS
#
priority 0
multithreading 0
numprocessors auto
profile 0
bench 0
?

I remember some years ago the HLSL using the hlsl folder and a hlsl.ini, its now all writen in mame.ini?
fagin
Posts: 1654
Joined: Fri Mar 19, 2010 2:29 pm
Location: UK

Re: MAME v-sync/refresh/speed-up question

Post by fagin »

D3D - HLSL is a resource fest

HLSL settings are held within the MAME.ini or <romname>.ini - as I advised the last time you asked. ;)
User avatar
Overkill
Posts: 513
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME v-sync/refresh/speed-up question

Post by Overkill »

yes, and i use the one you told me, and is working great, but then i have a old folder named HLSL with a hlsl.ini inside, i think is not being used anymore, so just asking to be sure before deleting it. gonna rename it just to see what it happens
User avatar
Overkill
Posts: 513
Joined: Mon Aug 22, 2011 6:11 pm
Location: Portugal

Re: MAME v-sync/refresh/speed-up question

Post by Overkill »

It still uses that folder and ini file, after rename i won't boot games.

Maybe in a not too distant future all will have to play and remember our old games will be emulators with HLSL on a oled or some new other kind of screen :cry:
Xenphor
Posts: 13
Joined: Sun Jun 13, 2010 5:53 am

Re: MAME v-sync/refresh/speed-up question

Post by Xenphor »

Sorry to bump this thread, but has something changed in MAME (.148) recently with regard to throttle+syncrefresh working correctly? Before I was able to achieve stutter free gameplay by setting throttle 0, syncrefresh 1, and then enable either triple buffering or waitvsync. However, the problem now is that with throttle at 0, the gameplay will always be way too fast, even when combined with the various vsync options MAME has. So I don't know what happened.

edit: Think I found the sorce of the problem. For some reason multithreading was enabled in the .ini. After turning that off I was able to get reasonable speeds with throttle 0.
User avatar
matrigs
Posts: 682
Joined: Mon Jan 18, 2010 7:27 pm
Location: Poland

Re: MAME v-sync/refresh/speed-up question

Post by matrigs »

Xenphor wrote:Sorry to bump this thread, but has something changed in MAME (.148) recently with regard to throttle+syncrefresh working correctly? Before I was able to achieve stutter free gameplay by setting throttle 0, syncrefresh 1, and then enable either triple buffering or waitvsync. However, the problem now is that with throttle at 0, the gameplay will always be way too fast, even when combined with the various vsync options MAME has. So I don't know what happened.

edit: Think I found the sorce of the problem. For some reason multithreading was enabled in the .ini. After turning that off I was able to get reasonable speeds with throttle 0.
hahaha what a coincidence - i installed shmupmame 4 yesterday and i had THE EXACT SAME PROBLEM and searched for answers in this thread, wanted to bump it but similarly discovered cools post about the multithreading.

nice it works now. i am just concerned if this has any impact on performance, as i am bound to a rather weak pc.
User avatar
cools
Posts: 2057
Joined: Mon Nov 26, 2007 4:57 pm
Location: South Wales
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by cools »

I've never had any luck testing multithreading, it always breaks something.
Image
User avatar
lemonhead
Posts: 67
Joined: Mon Dec 11, 2006 11:45 am
Location: CZ

Re: MAME v-sync/refresh/speed-up question

Post by lemonhead »

fagin wrote:
shmuppyLove wrote:There's another option in there to modify the game speed to sync to the refresh rate that I believe fixes this problem, but probably introduces a tiny bit of lag.
That's the EXACT point.... there doesn't appear to be an option in the formal MAME build. Lag is slightly more than "tiny" trust me! lol You keep a direction button pressed and it will just keep moving in the direction seconds after you took your finger off!!

As already suggested.... using another build of XYZMAME appears to be the solution under current builds.
multithreading problem too - set this parameter to 0 and --- problem solved
User avatar
Xyga
Posts: 7181
Joined: Tue Nov 05, 2013 8:22 pm
Location: block

Re: MAME v-sync/refresh/speed-up question

Post by Xyga »

Kind of necro-bump for a couple of questions regarding throttle & the various sync options, hope someone will be able to clear my doubts;

1. If applying a sync method without throttle gives a smooth scrolling, this also means the game is no longer running at its proper original speed, right ?
(i.e DDP at 104%)

2. In what way older builds (before 0.114) behave differently ?
Because I've tried DDP again on 0.99 and it behaves the same as the 0.152 I'm using.
(Choppy with throttle enabled but speed counter says 100%, or smooth with only a sync option activated but says 104%)

PS: precision; this is for a basic windows use, I'm not thinking about a 15Khz scenario here.
Strikers1945guy wrote:"Do we....eat chicken balls?!"
User avatar
Fudoh
Posts: 13045
Joined: Mon Mar 06, 2006 3:29 am
Location: Germany
Contact:

Re: MAME v-sync/refresh/speed-up question

Post by Fudoh »

it should be the same. It's been a number of versions in between that were broken in this regard.
User avatar
Ed Oscuro
Posts: 18654
Joined: Thu Dec 08, 2005 4:13 pm
Location: uoıʇɐɹnƃıɟuoɔ ɯǝʇsʎs

Re: MAME v-sync/refresh/speed-up question

Post by Ed Oscuro »

RE point #1:

Yeah, "tearing" seems more likely to be getting the correct pixels onscreen at the right times due to the inter-frame update potential.

Of course it doesn't emulate the total feel of CRTs - but neither does a per-frame update method (as seen on LCDs) where there's not tearing but rather flicker from per-scanline updates. The effect is of course worse than scanline flicker, in many cases, although I would say that for many sidescrollers (for example) it would be preferable to get a more up-to-date render near the bottom of the screen than to have the whole frame delayed. In fact, if the main things moving are at the bottom of the screen, you might be getting the new frame update with less lag and no really appreciable visual artifacts compared to a v-synced method.

I would say to check each game for what gets the balance of utility and feel right.

Of course, complicating matters is that MAME is arguably designed to give the most accurate view at any time, and this might not dovetail nicely with either of the goals of utility or "feel" at all. I would say it is more likely to coincide with utility (i.e., tearing) though.
User avatar
Xyga
Posts: 7181
Joined: Tue Nov 05, 2013 8:22 pm
Location: block

Re: MAME v-sync/refresh/speed-up question

Post by Xyga »

Sorry guys I don't get it.

Should we read the 104% speed as something really affecting the game's normal speed or is this a misleading fgure ?
And if it is affecting the game's normal speed, what is the extent of the 'damage' ?

I'm trying to figure if any of those recent additions to some Mame builds like -frame_delay in Groovymame, or the stuff found in RetroArch like video_hard_sync or noLag in either OpenGL or D3D modes actually brings a real improvement over what a 'regular' build can already do do by itself.

Don't know if I read Calamity's post correctly but this is only useful in a 15Khz scenario, right ?
http://shmups.system11.org/viewtopic.php?f=6&t=42059

And this, regarding Retroarch;
https://github.com/libretro/RetroArch/w ... erformance
Er...

To my understanding both builds (GroovyMame & RetroArch) are skipping on 'throttle' to use alternative sync methods to reduce the total input lag.
Which build is the most desirable for a basic windows+lcd use ?
Strikers1945guy wrote:"Do we....eat chicken balls?!"
Post Reply