Vsync causing jitter?

Yo_Mama

Member
Nov 2, 2013
30
0
0
I'm trying to play Company of Heroes, the framerate according to Fraps is 60 fps and unwavering, but the game feels 30~40 fps all the time. I get sick of playing it after 5 minutes.
Turning off Vsync makes the game feel 60 fps again, but I can't stand tearing.
So is Vsync to blame?

Also one funny thing, when I use Fraps to record an in-game video, the game suddenly feels 60, and when I stop recording it'll feel 30 again.

Spics:
i7-2600
GTX 570
16GB
 

hans030390

Diamond Member
Feb 3, 2005
7,326
2
76
FWIW, for the past few years, I've always enabled v-sync and triple buffering in GPU driver settings, enabled those settings in-game (if available, sometimes requires an ini tweak), and, lastly, I run D3DOverrider with both v-sync and triple buffering enabled. Triple buffering might be what you need to solve your problem.

I know my solution is overkill or might sound like it would cause troubles, but it rarely causes me problems and more often than more always gives me the smoothest motion possible. You will get the rare game here and there that doesn't like D3DOverrider or might require other specific settings. For most games, it works as a blanket approach.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
I'm trying to play Company of Heroes, the framerate according to Fraps is 60 fps and unwavering, but the game feels 30~40 fps all the time. I get sick of playing it after 5 minutes.
Turning off Vsync makes the game feel 60 fps again, but I can't stand tearing.
So is Vsync to blame?

Also one funny thing, when I use Fraps to record an in-game video, the game suddenly feels 60, and when I stop recording it'll feel 30 again.

Spics:
i7-2600
GTX 570
16GB

What you are experiencing is not judder, but latency.

In this instance, your FPS are 60, but you get latency as if you have 30 FPS. This is due to a rule that DirectX has in place when v-sync and triple buffering are enabled. DirectX forces every frame to be displayed, even if there is a newer one ready, it will always show the oldest complete frame. This results in a full frame of latency. This won't happen in OpenGL games, and wouldn't happen if you turned off triple buffering.

Triple buffering's advantage is only present when your FPS drops below your refresh rate. In that case it won't get backed up forcing the extra frame of latency. What it will do for you, is prevent your GPU from waiting idle while waiting for vertical blanking mode, to update the screen with a complete image. Rather than waiting, it can start drawing a new frame in the extra buffer.

It is when your FPS are below your refresh rate while using v-sync that judder occurs, regardless of triple buffering or not. This is because the frame times are uneven. When the GPU misses the window between refreshes, it has to wait for another refresh window to update the screen, resulting in frame times jumping between 16ms and 33ms.
 

Yo_Mama

Member
Nov 2, 2013
30
0
0
FWIW, for the past few years, I've always enabled v-sync and triple buffering in GPU driver settings, enabled those settings in-game (if available, sometimes requires an ini tweak), and, lastly, I run D3DOverrider with both v-sync and triple buffering enabled. Triple buffering might be what you need to solve your problem.

I know my solution is overkill or might sound like it would cause troubles, but it rarely causes me problems and more often than more always gives me the smoothest motion possible. You will get the rare game here and there that doesn't like D3DOverrider or might require other specific settings. For most games, it works as a blanket approach.

Already tried. According to some people Triple Buffering is an OpenGL exclusive feature that has no effect on DirectX games. I remember reading a comment from a dev, he said that DirectX has its own form of Triple Buffering, and that it's automatically being used when Vsync alone is turned on. That could explain why you don't ever get 60 to 30 drops in DirectX games, and it would also clarify the mystery of why you would need an outdated little-known third party program like D3DOverrider to activate triple buffering instead of just activating it from the Control Panel.

Anyhow, my problem isn't related to triple buffering since the framerate never goes below 60, it feels more like microstutter of multi-GPUs, only it's happening on one GPU.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
Already tried. According to some people Triple Buffering is an OpenGL exclusive feature that has no effect on DirectX games. I remember reading a comment from a dev, he said that DirectX has its own form of Triple Buffering, and that it's automatically being used when Vsync alone is turned on. That could explain why you don't ever get 60 to 30 drops in DirectX games, and it would also clarify the mystery of why you would need an outdated little-known third party program like D3DOverrider to activate triple buffering instead of just activating it from the Control Panel.

Anyhow, my problem isn't related to triple buffering since the framerate never goes below 60, it feels more like microstutter of multi-GPUs, only it's happening on one GPU.

This is exactly when triple-buffering causes problems in DirectX games.

Read this and try to understand the ramifications of what triple buffering does: http://en.wikipedia.org/wiki/Multiple_buffering
Another method of triple buffering involves synchronizing with the monitor frame rate. Drawing is not done if both back buffers contain finished images that have not been displayed yet. This avoids wasting CPU drawing undisplayed images and also results in a more constant frame rate (smoother movement of moving objects), but with increased latency.[1] This is the case when using triple buffering in DirectX, where a chain of 3 buffers are rendered and always displayed.
Because DirectX forces every frame to be shown, when your FPS are capable of higher than 60 FPS, both back buffers will constantly be filled, resulting in a full frame of latency.

Edit: You are right about the driver force triple buffering option. The setting normally states it right there that it only works for OpenGL and most games seem to enable it in DirectX on their own, though some do let you choose in game, like Far Cry 3.
 
Last edited:

Yo_Mama

Member
Nov 2, 2013
30
0
0
This is exactly when triple-buffering causes problems in DirectX games.

Read this and try to understand the ramifications of what triple buffering does: http://en.wikipedia.org/wiki/Multiple_buffering
Because DirectX forces every frame to be shown, when your FPS are capable of higher than 60 FPS, both back buffers will constantly be filled, resulting in a full frame of latency.

Edit: You are right about the driver force triple buffering option. The setting normally states it right there that it only works for OpenGL and most games seem to enable it in DirectX on their own, though some do let you choose in game, like Far Cry 3.

So is there a fix? (I still don't understand what full frame of latency is, is it like throwing away a frame?)
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
So is there a fix? (I still don't understand what full frame of latency is, is it like throwing away a frame?)

Latency is a delay. A full frame of latency means it will wait an additional 1/60th of a second on a 60hz monitor. It'll wait an additional 1/120 of a second on a 120hz monitor.

With DirectX, triple buffering and Vsync, when you reach your refresh rate in FPS, you will always be seeing one frame behind what the GPU has created.

Example:
It takes 1/60 of a second to create a frame, so you always wait 1/60 of a second for an action to be rendered.

With double buffering and 60 FPS:
Every frame takes 16.7ms of time to be created and displayed. There is no additional wait time.
16.7ms

With triple buffering and 60 FPS:
Every frame takes 16.7ms of time to be created, and then it waits another 16.7ms before it is displayed.
Total time from action to displaying: 33.3ms

There may be other latency times added to the system with polling of actions.
 
Last edited:

Yo_Mama

Member
Nov 2, 2013
30
0
0
Latency is a delay. A full frame of latency means it will wait an additional 1/60th of a second on a 60hz monitor. It'll wait an additional 1/120 of a second on a 120hz monitor.

With DirectX, triple buffering and Vsync, when you reach your refresh rate in FPS, you will always be seeing one frame behind what the GPU has created.

You mean input delay?
 

Yo_Mama

Member
Nov 2, 2013
30
0
0
No, display time delay. Though it may feel like input delay.

I get nauseated by this.

Maybe I should've clarified, it's not delay. I can clearly see a visible frameskip/microstutter/jitter when panning the camera in the game. I'm not getting a delay in response time of any kind.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
Maybe I should've clarified, it's not delay. I can clearly see a visible frameskip/microstutter/jitter when panning the camera in the game. I'm not getting a delay in response time of any kind.

Does this persist if you turn the settings down?

It is quite possible to have it jump between being 1 frame behind and no frames behind, causing a similar stutter as jumping from 16ms and 33ms frame times. This would happen if you system is about to drop below 60 FPS (it sort of did, but the extra buffered frame could have prevented it from being displayed on the meter).

If lowering the settings didn't help, then this would be a very unusual circumstance.
 

Yo_Mama

Member
Nov 2, 2013
30
0
0
Does this persist if you turn the settings down?

It is quite possible to have it jump between being 1 frame behind and no frames behind, causing a similar stutter as jumping from 16ms and 33ms frame times. This would happen if you system is about to drop below 60 FPS (it sort of did, but the extra buffered frame could have prevented it from being displayed on the meter).

If lowering the settings didn't help, then this would be a very unusual circumstance.

Same problem with setting turned down. This game isn't taxing at all, the 60fps framerate is maintained effortlessly according to the usage I see in CPU/GPU monitors.
The jitter happens ALL THE TIME, no matter where I am in the game, I mean it's not a hitch here and there, it's constant 30fps. But sometimes I get lucky, maybe 1/100 times, I will open the game and it will feel silky smooth. Also when I video record in-game with Fraps the jitter disappears completely.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
It sounds like the games time sequencing is just not consistent with v-sync on. It is likely a game issue.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
One more thought, which seems far fetched, but it may help. V-sync could result in an extra buffer, which isn't much vram, but it does add to some vram usage. If you happen to be teetering on the edge of maxing out your vram, it could cause some swapping, resulting in some disconnect in smooth frame delivery.

If this were the case, turning off Aero may help.
 

Yo_Mama

Member
Nov 2, 2013
30
0
0
It sounds like the games time sequencing is just not consistent with v-sync on. It is likely a game issue.

Why does it get fixed when Fraps starts recording? When Fraps starts recording it taxes the CPU, my hunch is maybe with a higher CPU load the game stops jittering?
 

Yo_Mama

Member
Nov 2, 2013
30
0
0
One more thought, which seems far fetched, but it may help. V-sync could result in an extra buffer, which isn't much vram, but it does add to some vram usage. If you happen to be teetering on the edge of maxing out your vram, it could cause some swapping, resulting in some disconnect in smooth frame delivery.

If this were the case, turning off Aero may help.

Well it was worth a try.
 

omeds

Senior member
Dec 14, 2011
646
13
81
Try setting an fps limit of 59 in inspector. Fixes a similar issue in a number of other games.
 

omeds

Senior member
Dec 14, 2011
646
13
81
It also helps with jitter or microstutter that can still be present. I have to do this for the Stalker series, Metro 2033, and a couple others.
 

toyota

Lifer
Apr 15, 2001
12,957
1
0
Try setting an fps limit of 59 in inspector. Fixes a similar issue in a number of other games.
so many people spread that myth and I spent hours testing last year to find out does nothing at all to help.if you have 59 fps and you are running vsync at 60hz then you are going to get choppiness since you cant actually get to 60fps. that means all the negatives of running vsync will be experienced in every game. the amount of choppiness will vary of course, depending if triple buffering is used. some games just end with a consistent chop when walking or panning around.
 

bystander36

Diamond Member
Apr 1, 2013
5,154
132
106
so many people spread that myth and I spent hours testing last year to find out does nothing at all to help.if you have 59 fps and you are running vsync at 60hz then you are going to get choppiness since you cant actually get to 60fps. that means all the negatives of running vsync will be experienced in every game. the amount of choppiness will vary of course, depending if triple buffering is used. some games just end with a consistent chop when walking or panning around.

There is actual science to it.

DirectX has a requirement that all frames rendered be displayed. When DirectX has triple buffering on, which appears to be a lot if not most the time, and your FPS are able to beat 60 FPS, you'll constantly have both back buffers filled, requiring DirectX to display the older frame, which adds a 16.7ms of latency to the game.

Having a FPS limit at 59, will prevent both back buffers from being filled, preventing the system from adding that additional 16.7ms of latency.

This is only with DirectX, and only when your FPS are able to beat your refresh rate, but the science behind it is sound.

The question is, does that loss of a frame irritate you?
 
Last edited:

omeds

Senior member
Dec 14, 2011
646
13
81
so many people spread that myth and I spent hours testing last year to find out does nothing at all to help.if you have 59 fps and you are running vsync at 60hz then you are going to get choppiness since you cant actually get to 60fps. that means all the negatives of running vsync will be experienced in every game. the amount of choppiness will vary of course, depending if triple buffering is used. some games just end with a consistent chop when walking or panning around.


Rubbish. It stays at a solid 59fps and fixes a number of games, as well as having the benefit of lower input latency.
 

Yo_Mama

Member
Nov 2, 2013
30
0
0
Try setting an fps limit of 59 in inspector. Fixes a similar issue in a number of other games.

I know that issue, it has to do with the number of frames the CPU sends to the GPU. It doesn't cause constant jitter, it causes less periodic stuttering.
Here a solution I found that is more of a permanent fix so I didn't have to use a framerate limiter anymore:
If you are using an Nvidia card: Go to the Nvidia Control Panel, then go to "Manage 3D settings", and in the Global Settings tab select "Maximum pre-rendered frames" and change its value to "1".


OR:


If you are using an ATI card: download Radeon Pro: http://www.radeonpro.info/downloading/ , then open it and go to the Advanced Tab, there is the "Flip queue size" bar, slide it to the value "1".