Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: technocop on July 17, 2009, 04:23:07 pm
-
Hi,
I've been reading some of the threads about screen tearing, and there seems to be a lot of info, but some contradictory, and nothing that has really helped me fix my screen tearing.
This is how I see it (please correct any wrongness!)
I have a PC running MAME 0.132 with an arcadeVGA card hooked up to my arcade monitor (via a JPAC), Looks prety great, but a lot of games suffer from screen tear, some unbearably so.
I understand that this is because the games are expecting to run at a refresh rate different to that of my video mode, so they are drawing the screen out of sync with my monitor. Most of the acadeVGA modes are 60Hz, but many games run at slightly different rates (Rolling thunder for example runs at 60.606060Hz)
Enabling v-sync or triblebuffering fixes this problem by causing MAME to redraw the screen in sync with what the game expects. However this causes sound glitches as sound data is lost.
There is basically nothing I can do about this??
It seems a shame that I spend so much time and effort getting a proper cab set up, only to find I can't play some of my faves! Has anyone with a similar setup managed to sort all this out?
I've heard about the "refreshspeed" option whcih is supposed to make MAME adjust the speed of the game to the current video mode's refresh rate. I've not had much luck setting this. Does it work?
Also read something about a major code change between mame version 0.113 and 0.114, and that the older version handled things better. Can anyone explain this to me?
comments appreciated :cheers:
-
Try -refreshspeed -waitvsync .
The problem that you are running into with the sound skipping is that your monitor refresh rate isn't the same as the original game. I certain number of sound samples are generated during a frame, and if the time per frame isn't correct, you'll either have too many samples or not enough. To work around this, -refreshspeed resamples the audio to a different rate which should cause a bit of pitch shifting depending on how far the refresh rate is off. This should work for all games to get rid of sound overflows and underflows, but it doesn't seem to work in all cases. I basically try to run games without -waitvsync, and if it's a game where the tearing is noticeable, I try "-refreshspeed -waitvsync". If that doesn't work, then I try to program a new video mode using power strip that has the proper refresh rate for the game. I haven't gotten this to work in all cases yet.
I'm a little bummed to hear that this is a problem with ArcadeVGA. . this is the sort of thing that they should be solving. I'm anal enough about this sort of stuff that I'll probably keep on working on solutions (ie. figuring out why -refreshspeed doesn't always fix the problem in Mame.)
-
Also, I'd be very interested to hear how the old version dealt with it better. Maybe the new version could be patched to do the same thing. Did they do a different resample of the audio? Would also be interesting to hear if anyone has done anything to make it resample without pitch-shifting.
-
Also, I'd be very interested to hear how the old version dealt with it better. Maybe the new version could be patched to do the same thing. Did they do a different resample of the audio? Would also be interesting to hear if anyone has done anything to make it resample without pitch-shifting.
As for new vs old, the old way did have problems, but not as noticeable. Syncing of the sound to the the video could get off, or produce echos. The current way locks the sound closer to the video, so there is less un-syncing, and emulation is closer to reality, but resulting in sound cracking. It is closer to reality emulation, so mamedev will not go back to the less accurate way, period.
Maybe a derivative can come out, but I doubt it.
-
cabmame and mameuifx fix this.
-
Thanks for all those replies - really useful clear info
I tried using refreshspeed in conjunciton with vsync, and it didn't seem to work. I'm not 100% sure though. The sound errors seemed less frequent, but that could have been my imagination. I haven't tried it on many games as yet though
SailorSat - your sound hack in mameuifx works great! The pitch change is unnoticable. :applaud:
so going to switch to mameuifx, and set vsync and the soundsync option for badly tearing games..
job done
cheers
-
cabmame and mameuifx fix this.
Hey thanks! I'll give your patch a try as well. Yay for not having to fix this myself! :)
Is it true statement that refreshspeed simply changes the games frame-time to match the monitor refresh without changing the audio playback rate?
With a multisync monitor (D9500 in my case), are there any XP restrictions that keep the ArcadeVGA drivers and/or soft15KHz from supporting multiple refresh rates at the same resolution? I did a little bit of this with PowerStrip, but it is very tedious. :)
Thanks!
Gary
-
Depends on your video card.
NVidia is limited to 32 resolution/refresh rates.
ATI has a way higher limit on those. (I think 72)
Another "limit" is that windows lists all refresh rates as rounded values.
So if you have 59.2Hz it will show up as 59Hz, and if you try to add 58.8Hz, it would ALSO show up as 59Hz.
Other than that I see no real limitations.
-
Depends on your video card.
NVidia is limited to 32 resolution/refresh rates.
ATI has a way higher limit on those. (I think 72)
Another "limit" is that windows lists all refresh rates as rounded values.
So if you have 59.2Hz it will show up as 59Hz, and if you try to add 58.8Hz, it would ALSO show up as 59Hz.
Other than that I see no real limitations.
I know driver guys at both ATI and NVidia. I'll check with them to see if there is any way to basically feed a modeline to the driver dynamically. I'm set up to run the low resolution mode calculator (lrmc) before launching mame to compute the correct modeline. I just need a way to tell Windows and/or the display driver what mode to switch to. Hopefully there is a way to do this. I really don't want to have to switch to linux to get this all working. :)
-
You could feed the modeline to the registry, and then "reload" the driver while windows is running.
However that doesn't work most times.
-
You could feed the modeline to the registry, and then "reload" the driver while windows is running.
However that doesn't work most times.
There may be some back doors for this sort of thing. I'll see what I can find out. I'll start with ATI since a lot of people use their cards for Mame.
-
On a different note, how well would the sound frequency changing code work if it computed the frequency once and didn't dynamically adjust it? On my crappy laptop, any system-wide hitch causes the pitch to change fairly dramatically in such a way that it's worse than just dropping audio, etc. I'll try it out on a faster machine at work.
Also, the audio is Pacman is hugely pitch shifted when the difference between the desired and actual refresh rate is tiny. What am I doing wrong here?
thanks!
Gary
-
You may want to reduce the sound frequency from 48000 to 44100.
Not every audio chip like frequencies over 48000 (and cause hiccups).
-
You may want to reduce the sound frequency from 48000 to 44100.
Not every audio chip like frequencies over 48000 (and cause hiccups).
Thanks! I'll give that a try.
-
I was reading this thread with interest but hadn't got around to testing it yet. I noticed some artefacts in the display for Rolling Thunder and decided to try a few of your suggestions. I fixed it just by running some simple tests. I'm using an original arcade monitor and I've found all games a lot better with these settings. I didn't experience any sound skipping issues.
Thanks for the tips!
[EDIT: Although everything looked good, there were too many games coming up with speed issues to make this a perfect solution. I've reverted back to the old settings and will instead watch out for screen-tearing and create .inis for those titles using the settings below.]]
Here's what works for me (from MAME 0.99):
### Windows video options ###
autoframeskip 1
frameskip 0
waitvsync 1
triplebuffer 0
window 0
ddraw 1
direct3d 1
hwstretch 0
# screen <NULL> (not set)
cleanstretch auto
resolution auto
refresh 0
scanlines 0
switchres 1
switchbpp 1
maximize 1
keepaspect 1
matchrefresh 0
syncrefresh 1
throttle 1
full_screen_brightness 0.000000
frames_to_run 0
effect none
screen_aspect 4:3
-
This is a great thread with lots of useful info- could we add this info to the wiki?