Behold a small guide/faq of the sync options in retroarch for silky smooth console experience.
Preface
A game console is always in perfect sync with the TV (usually CRT) because the console itself generates the video signal, meanning NTSC games are native in 59.94Hz (audio & video) and that is exactly what the console outputs to the TV.
Emulators on the other hand do NOT have control over the refresh rate of the TV because the GPU of your device generates the video timing and it might not be perfect 59.94Hz as the console outputs.
Lets assume the GPU runs the desktop in 60.01Hz but NTSC games are still 59.94Hz, as you can see there is our problem we are trying to fix.
There are two ways we can run the emulation:
- In sync with NTSC audio which will be in perfect pitch in 59.94Hz but the video will be out of sync and stutter.
- In sync with the GPU refreshrate but the audio will be out of sync and crackle when the drift is to large.
Since the refreshrate in HZ of the GPU timting is fixed we want to synchronize the NTSC game to it (vsync) thus making the game run several 1/100 of Hz faster, and then fix the resulting audio crackling.
The way retroarch fixes the audio crackling is by changing the NTSC game audio pitch by dynamically adjusting/stretching the audio pitch to be in sync with the GPU refreshrate.
This audio stretching from 59.94HZ to 60.01Hz is roughly 0.1% change in pitch which is inaudible to us but fixes the sync issues.
So let’s begin.
…
Guide
First thing, make sure the monitor that you’ll be playing Retroarch is the PRIMARY monitor in windows and IN-FOCUS (mouse click it), if you are using multiple monitor setup.
Experience shows that this is the biggest factor in stuttering in retroarch.
I use a 15kHz CRT as an extended monitor with a VGA->ScartRGB cable from my PC, so I make sure it is set to be Primary BEFORE I run Retroarch.
Every monitor has a personal vertical sync timing that should be calibrated first in retroarch.
Go to the Settings -> Video menu.
Windowed Fullscreen Mode -> Off
Vertical Sync (VSync) -> On
Hard GPU Sync -> On
Vertical Refresh Rate.
Estimated Screen Framerate.
Press the “Space” or “Start” key when on “Estimated Screen Framerate” and wait till the counter reaches 2048 smaples.
Now press “Enter” or “X” (dualshock) or “A” (xbox) when still standing on “Estimated Screen Framerate” to update “Vertical Refresh Rate”.
That’s it, you calibrated the vertical sync to your monitor and you can do this procedure as often as you think you need.
This initial calibration is very important since all Audio synchronization and stretching in retroarch rely on this measured “Vertical Refresh Rate” value, so make sure you do it.
–
Now that we calibrated the screen refreshrate, let’s understand the Audio settings and how they affect perfect sync.
Go to Settings -> Audio, there are three not so obvious options we need to understand.
- Audio Sync.
- Dynamic Audio Rate Control.
- Audio Maximum Timing Skew.
The guide is intended for NTSC games on 60Hz screen, but to explain these options in a clearer way lets assume we are playing a 50Hz PAL game on a 60Hz monitor to learn what corrections retroarch does.
-
Audio Maximum Timing Skew:
This one is first because it only takes effect when a game is loaded.
When a game is loaded this option allows retroarch to ‘stretch’ the audio pitch of the game to your monitor refresh rate you set in “Vertical Refresh Rate” thus creating perfect audio sync but the audio will also be slightly higher in pitch as a result of stretching from 50Hz to 60Hz (in this example) which is 17% speedup.
To allow correct 50->60 sync we need to set this slightly above 0.17 (17%), say 0.18 or 0.2.
Everything below 20% will also sync, as this setting is the maximum allowable stretching percent.
Note that if you set it too low (say 0.15) it will not take effect at all if the game needs 0.17 or more.
Once again, this option takes effect only when you freshly start a game, not even a reset command will do, you have to close content for new settings to take effect.
As you understand, this option is primary as the other audio options come after this one did its job.
If you play mostly NTSC games on a 60Hz monitor (as you should), keep the default setting of 0.05. -
Audio Sync:
When ON, the game will sync to audio and play audio smoothly without crackling, but the video may stutter as the game audio runs in sync to the “Vertical Refresh Rate” which is a measured estimate of the screen real refresh rate.
When OFF, the video will be in perfect sync (no video stuttering), the game will speed/slow to your real screen vsync, but audio may crackle if “Vertical Refresh Rate” is not close enough to the real refresh rate of the screen.
If you properly done the “Estimated Screen Framerate” calibration, then the default ON should give you no trouble. -
Dynamic Audio Rate Control:
Unlike “Audio Maximum Timing Skew” which only takes effect at start, this one is constantly updating on-the-fly and fixing minor (or major) deviations in sync between audio and video.
Basically this one will keep the audio/video experience silky smooth like a console would, but the pitch correction is of lesser quality than of “Audio Maximum Timing Skew” because it works in real time.
Don’t assume you will ever hear these pitch corrections as they are very small and swift, but will keep you in perfect sync.
If you want retroarch to behave like other emulators without this option, set it to 0.000.
–
UPDATE:
To further clarify the relationship between “Audio Sync”, “Dynamic Audio Rate Control”, “Vertical Refresh Rate” and “Hard GPU Sync”;
First, “Vertical Refresh Rate” has nothing to do with the real vsync of your monitor, it is simply an estimation by retroarch software so that “Audio Sync” has an estimate of your screen refresh rate.
So “Audio Sync” and “Audio Maximum Timing Skew” will sync to the estimated/calibrated refreshrate not the true vsync of your display.
Displays have some minor timing instabilities because of heat and other environmental factors.
The DELTA in % between “Vertical Refresh Rate” and the real hardware fluctuating Display refresh rate is what “Dynamic Audio Rate Control” fixes in real time.
Please re-read these two sentence till you clearly understand them.
I remind again to set the monitor you’ll be playing retroarch on as Primary, as I found it is the biggest factor of macro (big) stuttering. I recommend a small soft called “Monitor Profile Switcher”, it can switch monitor profiles with hotkeys, very handy.