GSYNC, please help solve this mistery

Hi,

For several days, I am trying to discover why Retroarch does not work with my G-Sync setup as it should be. When GSYNC is enabled, some cores stutter/microstutter.

FACTS:

  • MameUIFX 0.175 works perfectly with GSYNC enabled, fps are adjusted to the game and is perfectly synced, smooth. Games like Mortal Kombat or Air Buster have the right speed like the arcade while synced with monitor.
  • Other emulators also work right, like WinUAE. If I chose a PAL system, 50fps, the sync is perfect, no flaws or stuttering.

Test specs:

  • Asus G751 ROG laptop with GSYNC integrated panel enabled.
  • Windows 10 x64 Creators Edition
  • 16GB RAM
  • nVidia 980M 4GB DDR5
  • Intel i7 8 cores
  • Usual set of apps installed: Avira, drivers, Virtualbox, hard disk sentinel, Steam, GOG Galaxy

Retroarch config:

I have almost tried every combination on retroarch.cfg regarding audio/video, but I may be missing something important. These are the results:

VIDEO:

Vsync disabled. Hard CPU Sync : Does not matter if I enable it or not. Vertical refresh rate: Set to 75Hz (my monitor default refresh). Does not matter if I change this to other value. Estimated refresh rate: Strangely, this value goes around 60Hz. Old retroarch versions, like 1.2, shows 75Hz here, as it should be. I do not know were the 60Hz comes. Fullscreen: Yes Windowed fullscreen: No Video Driver: gl

AUDIO:

Audio Disable: If I disable audio the problem is gone, game runs smoothly gsynced at the original FPS. Audio Maximum Timing Skew: 0. If I increase this to 0.5, FPS goes up to 60Hz and emulation play smoothly with no stuttering. But not at the real FPS of game/system. Dinamic Audio Rate Control: 0. If I enable it, same behaviour as audio maximum skew. With a value of 0.150, FPS goes up to 60Hz and stuttering is gone. Audio Sync: If I enable it, game FPS is right, and stuttering appears. If I disable it, game is smooth at 60fps, no stuttering but wrong refresh rate. This is true for several cores, like MAME and BlueMSX. But for VICE core, it does not matter if I enable this or not, it works perfectly as intended, Gsynced without stuttering, at 50 fps (PAL). Audio Latency: 60ms. If I change this value, stuttering behaviour changes, but I suppose it is only the audio buffer. If it is very low, stuttering is shorter, but still there. Driver: Tried all of them, currently xaudio. All show the problem, some make stuttering worse.

I have changed several options in nVidia’s retroarch profile, like forcing Tripe Buffer or vsync, but all of them does nothing apparently.

TRIED with no changes in retroarch behaviour:

Retroarch: 1.2, 1.3, 1.6.5, 1.6.7, nightly build. Windows: Disconnected the external monitor, all USB, changed audio output (HDMI/analog)

Now I am stuck, run out of ideas. Any help would be greatly appreciated.

1 Like

Does GSync even work with OpenGL?
Maybe try to change the video driver in retroarch to D3D.

Yes it works with OpenGL. In fact, VICE core works perfectly. For example, Uridium, a fast paced perfect scroll shoot’em up for C64, works perfectly in 50Hz PAL. GSYNC indicator shows on screen if enabled.

Let me check D3D though. Thank you for the advice.

EDIT: Just checked it with D3D. No changes, same behaviour, GSYNC not working properly with several cores.

Try to disable “Audio Sync”, this will make sure the core syncs only to the video.
Some cores though don’t like Audio Sync disabled like Parallel-N64 because the emulation relies on the precise audio timing and will runs at full throttle with audio sync disabled.

EDIT: I see you already tried it.
In any case, something has to ‘set the tempo’ and it is best that the audio will do it and your gsync screen will follow.

If I disable Audio Sync, misteriously retroarch goes to 60 FPS, and all problems are solved. That’s the weird thing I don’t get. Emulation goes smooth as silk, but faster. Audio pitch is higher as expected, but no cracks or pops. No stutter. But my monitor is only 75Hz (Asus G751 gsync monitor only have that refresh rate in all resolutions), so that 60Hz is not the native monitor, nor monitor synced. It is GSYNC working. I do not get it.

I want to play at real speed, that’s the magic behind GSYNC. And should work. In fact it does in VICE core.

These are the settings I have been using with G-Sync based on what I could find here on the these forums and they seem to be working quite well for me. No screen tearing, no stuttering and no sound issues.

Audio Sync On
In the retroarch.cfg file look for 2 settings:
audio_rate_control = “true” and set it to “false”
video_refresh_rate = “59.xxx” and set this to match the Hz that your monitor runs at, for me this was “144”

Please keep in mind though these are settings I derived from reading what I could find here and I am not an expert. I can only say that these settings appear to be working perfectly for me. If I have something wrong it doesn’t appear to be having a negative effect on my end and of course I am willing to test specific recommended changes if asked or told.

Yes, I have the audio rate control disabled and the video refresh rate set to 75, my monitor refresh rate (though it does not matter which value I put there).

It syncs at the real game speed? It’s easy to check with PAL games or arcades like Mortal Kombat (runs at around 55Hz). Enabling video->display framerate will show it.

Just did a quick test and yeah Mortal Kombat runs at 54.8 fps

Great to know it’s fixed for Mame.
I couldn’t find anyone with a Gsync monitor to confirm it worked since R-type fixed the game refresh rate detection a while back.

If you need someone to do some G-Sync testing for you please feel free to contact me on here or in the Retroarch Discord since I am on there all the time as well.

1 Like

Are you really on 0.185 for that MK1 test?
The fix was done end of May which is probably for 0.186… I’m confused now.

Yeah, I have not updated the Mame core at all because that is what my rom set is.

So it is something related to my system as far as I can see. Perhaps audio driver is doing something I can’t figure out with the MAME core

UPDATE: Tried with several sound drivers, no luck (latest from Realtek, the one downloaded from ASUS and the Microsoft generic one). No changes.

Bump for hope. Fingers crossed any dev onboard will pick up a monitor.

Well, after two months, I found nothing. Seems it is related to mame core implementation in retroarch and gsync rate control. It just do weird things, but for almost all cores gsync do the work right.

For now, I use my external Philipg CRT for 60hz output, and rest (PAL, 55Hz arcades…) with gsync. MAME gsync is done properly through MameUIFX 0.175.