Emulation and frequency differences: good emulators, bad emulators, and settings

Jun 13, 2004
24,280
3
1,365
horizonvanguard.com
#1
UPDATE: This post contains some misinformation based on assumptions. These suggested settings in MAME seem to cause lag similar to all "vsync" implementations, and while I haven't tested it yet, I wouldn't be surprised if the same goes for all of these emulators. That being said, these settings/suggestions still lead to the smoothest image possible, so if you're playing a game where a frame or two of lag is acceptable, I would still follow them.

UPDATE #2: Nvidia's newly-announced G-SYNC looks to solve these issues. Using an emulator with vsync off (meaning Aero off for those emulators that don't have true fullscreen) on a G-SYNC setup should lead to a lag-free, tear-free, and stutter-free visual experience. I look forward to updating when I get my hands on it.
--------------------------------------------------------------------------------


Ever get the impression that something emulated just isn't running as smooth as the real thing, but you can't quite put your finger on why? There just might be some useful information in here, then!

What's the point of this thread?

Some emulators synchronize "the right way". Many do not. I've been curious about this for a while now, and this thread is a place for me to explain what I've learned and ask a few questions of my own.

What's this stuff about synchronizing? Isn't everything 60hz anyway?

Hell nah. When it comes to emulation, there's often a slight difference in video frequencies. Your monitor, at its native resolution, might run at 60.021hz, but that Famicom game you're trying to play is made for a machine that ALWAYS outputs 60.098hz.

Many emulators, when left to defaults, will simply let the screen tearing fly in the above situation. The game is generating images at a different rate than your monitor is displaying them, which means that you'll never see a solid single image. Instead, you'll see a state between two frames, with a distinct line between the generated portion of the new frame and the old frame that's getting overwritten (assuming there's enough motion going on). Of course, this is ugly. If the difference in frequencies is small enough, the line can slowly creep along. If the difference is great enough (57hz games emulated in a 60hz resolution), the line can slam across the screen rapidly, creating a very annoying stutter effect.

How do we deal with this? Surely we can use VSync to eliminate screen tearing!

Yes, we can. The problem is, VSync doesn't mean the same thing across the board. Different emulators have options labeled "VSync" that actually do different things. Some emulators don't use the term at all for their sync options.

The way VSync works in most modern games is to delay the display of the screen until there's a full image present. In other words, WAIT until there is no visible tear, then show the image. This can lead to lower framerates and input delay. Certain emulators offer this option, and it can similarly lead to dropped frames (even consistently dropped frames, like x frames per second of stutter) or noticeable input lag. This is bad.

The way VSync (or other sync options) works in other emulators, however, is much more logical. Instead of futzing with the display timing, the emulator instead changes the timing of the HARDWARE IT IS EMULATING. By making that Famicom game output at 60.02hz instead of 60.098hz, you are removing the frequency difference entirely. Are you altering the game's speed? Yes. Are you honestly going to notice such a minute difference? No. Is this change in speed a better option than introducing stuttering or lag? Absolutely. This is good, and this is usually the right way to handle frequency differences in hardware. I usually refer to this as "syncing to monitor refresh", as that's what MAME calls it. Generally, the only downside to this approach is that it can cause very slight audio hiccups in some emulators and games. Finally, this approach will NOT work if your hardware's display frequency is LOWER than the hardware you wish to emulate.

Now, to talk about some emulators and platforms.

MAME, thankfully, allows for altering the game's original speed properly. If you turn on "Sync to Monitor Refresh" and turn OFF "Throttle", it will raise a game's display frequency to match that of your screen and run perfectly. One thing to watch out for, though, are the games that have refresh rates far removed from 60; stuff like R-Type (55hz) will play significantly faster with this method. In these cases, I suggest finding a resolution that your screen supports with a closer frequency and telling MAME to use that resolution.

SNES emulators were disappointing to me for some time. ZSNES and SNES9x both had sync options that did things the wrong way, and MESS, while offering the same features as MAME, simply didn't have the compatibility. Then I found lovely little SNESGT. SNESGT is a Japanese SNES/SFC emulator that, while slightly lacking in the video options department, has a sync option (called "Synchronous Update") that does things the right way. Many Japanese emulators seem to.

NES is a tricky spot for me, too. I love Nestopia, but Nestopia's VSync is the lag-introducing kind, and its Sync to Monitor Refresh option doesn't sync the frequencies completely; it always leaves a VERY slowly creeping line. I'd rather have this than a fast flickering line, though, so I still tend to use it. MESS doesn't look as good, even if it handles the timing better. I haven't looked into other emulators enough. Update: VirtuaNES, another Japanese emulator, seems excellent and has proper sync. Thanks hikarutilmitt!

For Genesis and SMS, you have the excellent Kega Fusion. I'm 99% sure that Fusion's "VSync" option does things the right way.

TG16 has Ootake, which, like other Japanese emulators, does VSync right. Should be all you need.

For Saturn I use SSF, but I honestly haven't been able to confirm how the emulator's VSync option behaves. On one hand, it seems good to me, on the other, I've heard mentions of lag. Can anyone confirm or deny how it behaves?

PSX has pSX Emulator and the ever-so-famous ePSXe. pSX Emulator, sadly, does things the laggy way. With ePSXe, it all depends on the display plugin. Last I checked, Pete's hardware-accelerated plugins actually do things the wrong way, where "VSync" on his Software plugin does things the right way. Funny!

This may all seem overkill, but, hey, to me it's the difference between a practically perfect experience and a tear-ridden jerky mess.
 
Sep 25, 2006
13,032
0
0
Australia
#2
I never really noticed much nput lag with Nestopia using VSync. In fact I just tried it then (with a gamepad playing Ninja Gaiden 2) and could barely tell the difference, the screen tearing annoyed me much more than any input lag did.

I'm sure you're right but it's not a deal-breaker for me.
 
Aug 26, 2006
245
0
940
#3
Thanks for this topic. Very informative.

As you said, the only downside of the second method is that sometimes it will produce audio hiccups. But it's possible to prevent this audio crackling if the emulator gives an option to adjust the input frequency of the audio.

Unfortunately, very few emulators offers this option (bsnes is one example, it's possible to read more about it here: http://www.byuu.org/bsnes/manual/?page=audioconfiguration).
 
Aug 28, 2006
11,468
1
0
#5
My way of getting around the problem by connecting a PC to a CRT TV using a VGA-to-SVHS converter. I installed soft15KHz which adds all native 15KHz resolutions to my PC. So, my TV can actually display (most) of the games at their actual native frequency.

My only problem is SSF. The darn thing refuses to boot if the desktop resolution is smaller than 800x600, and it always runs in a pixel-doubled resolution instead of native. I'm considering actually hacking it one of these days.
 

drohne

hyperbolically metafictive
Jun 6, 2004
16,737
20
0
#6
have definitely noticed this emulating nes games on psp, but thought it was just bad emulation on a low-end platform. informative thread, will keep it bookmarked
 
Dec 11, 2009
9,855
0
0
The Netherlands
#9
Almost never notice screen tearing with emulation, but to be fair I have never gone further then the PSX generation for emulation.

I think that how some PC games don't have Vsync properly working or not present at all is a way bigger issue.
 
Jul 15, 2009
11,804
1
755
New York City
#10
For me, ePSXe software plugin is the only way to play. I wish Project64, or better yet, Mupen64Plus had software plugins...

The drawback is no higher resolutions or special Direct3D effects, but the benefits include accurate emulation and no strain on the video card. On my 1.7 GHz Atom netbook with old Intel graphics, ePSXe runs full speed. (Actually, even Dreamcast games would run full speed if it wasn't for my graphics...)


Also, what about MagicEngine? I know it has compatibility on its side...


Also, for NES emulators, I'm pretty sure FCEU GX is said to be among the best. I suggest you look at that one.
 
Apr 7, 2005
1,413
0
0
#12
Sony PVM-2530, custom RGB cable and soft15khz generally takes care of these issues. It can still be a bit of a hassle with certain emulators. It's nice to see these low res games being displayed the way they're meant to, instead of messing with filters that never really seem to get close (or completely butcher the image :)).
 
Jun 13, 2004
24,280
3
1,365
horizonvanguard.com
#13
I remember trying bsnes and having the impression that it did the delayed kind of vsync. The rest of the package is great though. I don't remember how Magic Engine does it, unfortunately. I do remember that emulator having a very goofy interface!

Actually having the hardware to output the original resolutions and frequencies to a 15hz display is great too. Shame my RGB monitors are at my parent's.
 
Jul 15, 2009
11,804
1
755
New York City
#16
SOLDIER said:
I could never get the sound working on ePSXe. It screws up during FMV.
Perhaps you should try the Eternal audio plugin, version 1.5 beta 2. I read in a few places that it was the best audio plugin, though that was a very long time ago. Also, it's the only one that works with Um Jammer Lammy (you need to set the reverb setting to "new" for that).
 
Jun 13, 2004
24,280
3
1,365
horizonvanguard.com
#19
IrrelevantNotch said:
SnesGT still tears when I go into Full Screen
Even with "Synchronous Update" on? I forgot to mention the name of the setting in my post. :x

With that option on, I've only ever seen it tear through one old video card's s-video output, which always tears with everything ever. Is there any chance that your refresh rate is lower than the SNES native 60.098? I usually use Powerstrip to check exact refresh rates like that, but there might be a better way.

Ellis Kim said:
Can SNESGT run Super Metroid without frameskip on a 7 year old PC?
Good question! It doesn't seem as demanding as MESS or bsnes, but I'm doubting that it's quite as fast as ZSNES.
 

luka

Loves Robotech S1
Jan 15, 2009
9,990
1
0
#22
cj_iwakura said:
pSX always worked better for me. I used it to play Persona 2(both of them). Reads right from the disc.
I've never liked the colors in pSX. Always looked off to me. Everything has a weird tint compared to epsxe (and actual psx output). I've always used epsxe and pete's soft gpu


Why would you do that? said:
Perhaps you should try the Eternal audio plugin, version 1.5 beta 2. I read in a few places that it was the best audio plugin, though that was a very long time ago. Also, it's the only one that works with Um Jammer Lammy (you need to set the reverb setting to "new" for that).
Gnerally yeah, Eternal is the best. But in games that use redbook audio I've only been able to get it working with the internal plugin.
 

Drkirby

Corporate Apologist
Jan 29, 2008
42,344
0
0
28
Florida
#24
Is there an easy way to find out all the display modes a monitor supports?

I think at the very least I may try to make room on my desk for an old CRT I recently got, such a disappointment that my LCD monitor can't support the huge variety of resolutions my CRT did 7 or 8 years ago.
 
Dec 28, 2005
704
1
0
#26
I'm glad to see SNESGT get some recommendation here. It seems to sit right between ZSNES' speed vs. BSNES' accuracy. I also find it the easiest to configure out of those three. Hopefully ZSNES 2.0 will come out one of these days and be fast, accurate and have a nice featureset and gui.

I'd like to have a general PC emulation topic, but I don't think it'd thrive here like the Dolphin and PCSX2 threads do.
 

Stumpokapow

listen to the mad man
May 21, 2006
17,232
2
0
#27
cj_iwakura said:
pSX always worked better for me. I used it to play Persona 2(both of them). Reads right from the disc.
I'd much rather use pSX, but I use my wireless 360 controller and the right analog stick isn't properly supported on pSX :/
 
Aug 26, 2006
245
0
940
#28
ToD_ said:
Sony PVM-2530, custom RGB cable and soft15khz generally takes care of these issues. It can still be a bit of a hassle with certain emulators. It's nice to see these low res games being displayed the way they're meant to, instead of messing with filters that never really seem to get close (or completely butcher the image :)).
It's worth mentioning that some emulators for Wii are capable of running games at it's native resolution. It has some advantages over playing on PC, like been able to control the interface of the emulator (save states, for example), with your controller. Unfortunately, since the CPU is slow, you are basically limited to SNES, Genesis, SMS and NES emulation.
 
Dec 16, 2009
29,978
2
0
#31
Tain said:
Yeah, the Wii low resolution modes are wonderful. If you're fine with the Wii controller options, it can definitely be the way to go for those platforms.
It's great - got a SNES to GC adapter for the controller, as well as a Club Nintendo SNES classic controller.
 

Drkirby

Corporate Apologist
Jan 29, 2008
42,344
0
0
28
Florida
#32
Got my CRT hooked up, god damn I love these screens, if only they weren't so big. I love how you can force just about any resolution size on it, I was able to force a a desktop size of 1280x1080 without a problem to match up with my 1920x1080 LCD.
 
Nov 28, 2005
7,587
0
1,025
34
Leicester
#34
Cuban Legend said:
The lack of N64 Emulator tips in here is staggeringly scary...

one question though, I've heard that there is a way to play old games like OoT, MM, and SM64 @ 60 fps without it running at 3x speed?
http://en.wikipedia.org/wiki/1964_(emulator)

"Another modified release by PistolGrip lets the emulator run games at true 60fps by altering the internal processing speed of the N64 to meet the realistic demand of the software."

Believe :(
http://forum.pj64-emu.com/showthread.php?t=337
 
Jun 13, 2004
24,280
3
1,365
horizonvanguard.com
#35
N64 emulation is a weird, high-level mess, to be honest. I haven't really had any super-demanding 60fps action games from the platform that I've wanted to emulate that would call for me checking how the emulator handles timing differences.

I will say that Glide seems to be the most accurate of the high-level display plugins.
 
Sep 1, 2004
2,199
0
1,275
East Stroudsburg, PA
#36
Tain said:
N64 emulation is a weird, high-level mess, to be honest. I haven't really had any super-demanding 60fps action games from the platform that I've wanted to emulate that would call for me checking how the emulator handles timing differences.

I will say that Glide seems to be the most accurate of the high-level display plugins.
I still keep a VooDoo 2 just because of that.
 
Mar 31, 2010
320
0
0
Maytown, PA
#43
Stopped by briefly to comment that perhaps an all encompassing emulator thread might be a good idea.
Sort of on topic: Vsync issue using linux on a 6 year old PC takes some time to deal with because each emulator handles 'vsync' in different ways. For instance, BSNES (compiled in compatibility mode) fullscreen handles vsync internally without slowdown, but I have to make sure that "Tear Free" and vsync are turned off in Catalyst Control Center or emulation speed takes a noticeable hit. Conversely, with dolphin and gamecube games (PC is too old to play Wii games at full speed), vsync with dolphin needs to be turned off, yet turned on in CCC.

If someone wants to start a linux console emulation thread, I would be happy to post more observations there.
 
Dec 12, 2006
38,766
1
0
eviloreisarapist
#45
I'd much rather use pSX, but I use my wireless 360 controller and the right analog stick isn't properly supported on pSX :/
I think that's because of how the 360 controller maps the right stick x/y-axis as separate pedals/analog bars instead of a second analog stick. I'm not entirely sure, but I remember my PS3 controller showing up different than the 360 one in the windows device thing.
 
Jun 13, 2004
24,280
3
1,365
horizonvanguard.com
#46
I should update the OP. I recently got a 60fps camera and tested MAME with the settings suggested above, and those settings (specifically "Sync to monitor refresh") cause three frames of lag.

I opened up the source and poked around, and from what I can gather, any D3D application that uses D3D_PRESENT_INTERVAL_ONE (I think that's what it's called) can cause up to three (!) frames of lag. I didn't expect MAME to be using the usual vsync method, but I guess that when it comes to D3D, relying on drivers might be the only way to do it. I really should do more testing, but this was kinda devastating to find, as I'd bet that many other emulators do the same thing.

Of course, most everything I said in the OP still stands if you're okay with a little bit of lag and want the best image quality.
 
Oct 29, 2006
5,059
26
1,005
San Antonio, TX
#47
Stopped by briefly to comment that perhaps an all encompassing emulator thread might be a good idea.
Sort of on topic: Vsync issue using linux on a 6 year old PC takes some time to deal with because each emulator handles 'vsync' in different ways. For instance, BSNES (compiled in compatibility mode) fullscreen handles vsync internally without slowdown, but I have to make sure that "Tear Free" and vsync are turned off in Catalyst Control Center or emulation speed takes a noticeable hit. Conversely, with dolphin and gamecube games (PC is too old to play Wii games at full speed), vsync with dolphin needs to be turned off, yet turned on in CCC.

If someone wants to start a linux console emulation thread, I would be happy to post more observations there.
Part of the "break" between emulators handling vsync differently depends on how it's called in the driver and how it interacts with the X server. This ends up making it somewhat distro-specific because the results on the same exact hardware used to give me different results between Slackware, Debian, Fedora and Ubuntu. Slackware tended to be most consistent, but it's also built to run on damn near anything and is a bit less user-friendly for editing things.
 
Jun 10, 2010
1,758
0
0
Berlin
#50
Sony PVM-2530, custom RGB cable and soft15khz generally takes care of these issues. It can still be a bit of a hassle with certain emulators. It's nice to see these low res games being displayed the way they're meant to, instead of messing with filters that never really seem to get close (or completely butcher the image :)).
Are you able to set the 15khz display up as a secondary monitor? Because that's what usually kills it for me. And what sort of wiring scheme did you use? I have a PVM too and this is relevant for my interests.