RTSS Scanline Sync HOWTO

Everything about latency. Tips, testing methods, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
Post Reply
User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

RTSS Scanline Sync HOWTO

Post by Chief Blur Buster » 24 Jan 2019, 02:26

I'm the one who suggested the Scanline Sync feature to be added to RTSS on Guru3D. It's becoming popular

I've been refining the HOWTO.
Other threads
- Main RTSS Scanline Sync Thread on Blur Busters
- Guru3D Download Of RivaTuner Statistics Server (RTSS) With Scanline Sync
- Scanline Sync Lag Tests
- Scanline Sync Is Amazing

Blur Busters Scanline Sync HOWTO
Version 1.1

Summary
1. It works with any GPU. And any display including CRT.
2. You need a very powerful GPU
3. You need to try to get your 0.1% frametime no more than a refresh cycle. Upgrade GPU, decrease Hz, decrease detail, etc.
4. If properly configured, it looks like a lagless version of VSYNC ON.
5. If improperly configured, it will look like an ugly mess.
6. It can help make ULMB stutterless without the lag.
7. There's a way to get S-Sync working with Fast Sync and Enhanced Sync too
8. Enable the Scanline Sync hotkeys, it makes calibration easier (arrow keys to move the tearline UP/DOWN)

IMPORTANT: Before you begin, make sure you're familiar with VSYNC OFF tearing. Before you turn on RTSS, please get familiar with VSYNC OFF and what tearing looks like first! For easiest observation of tearing, you need to generate horizontal motion in a game (e.g. turning, strafing, horizontal panning, etc). Here is an example of what tearing looks like, and tearing usually often appears very briefly/momentarily/instantaneously -- though they can start to sustain in visibility -- when tearing continuously repeats itself every refresh cycle in the same approximate location. Scanline Sync will focus the tearing into one single location, generating a lingering tearline, whose location can be controlled very precisely.

Scanline Sync can give you glassfloor frametimes in certain games .... A perfect 18-20ms lag glassfloor is always better than 16.7ms with lots of 33ms spikes.

Enable the Hotkeys to manually move the tearline up/down Add SyncHotkeys=1 to your config file to enable shortcuts. Hold CTRL+SHIFT while using UP/DOWN arrow to move the tearline up and down.

Calibration & Tuning Mantra: Always calibrate RTSS Scanline Sync with keyboard using VSYNC OFF first before turning VSYNC ON / Enhanced Sync / NVIDIA Fast Sync!
The tearline position is a wonderfully excellent visual calibration indicator.

Combining RTSS ScanLine Sync with your preferred sync mode:
VSYNC OFF: Calibrate tearline offscreen
Fast Sync: Calibrate tearline to stay permanently above bottom edge
Enhanced Sync: Calibrate tearline to stay permanently above bottom edge
Once you finish calibrating, switch to your preferred sync mode.

Tearline vibrates too much? (e.g. 1/4th screen height vibrations or worse)? Move the tearline onscreen and work hard to calm down your tearline first! Temporarily ignore the lag during this calibration stage, and focus on calming down the tearline first. Try increasing SyncFlush numbers by 1. Use SyncFlush 1. Also, lower refresh rates produce calmer tearlines. And lower CPU%, lower GPU% utilization will produce calmer tearlines too. Turning off certain features like AA will also produce calmer tearlines. If you are running very old games that always stay well below GPU 50%, try SyncFlush 2 as that produces very tranquil & calm tearlines. (Don't worry, the crazy increase in GPU% will be more than compensated by the complete lack of lag spikes; keep reading. That shiny glass floor lag beckons!). Remember, the calmer the tearline, the more likely it stays permanently near one location. Fiddle until you see your tearline calm down (vibrating consistently in a reasonably tight vertical space rather than all over the vertical dimension of the screen). The calmer the tearline, the more likely it stays permanently away from the bottom edge of screen. Thereby avoiding lag spikes if using another sync mode than VSYNC OFF. Tearlines that dips below bottom edge of screen exactly equals a latency spike if you were running FastSync instead of VSYNC OFF.

Framerates often below Hz: If your game cannot sustain framerate equal refresh rate, you WILL get lag spikes (with accompanying microstutter), no matter what. So lower your refresh rate and/or upgrade your GPU and/or adjust game detail and/or reduce AA.

Occasional framerate dips:
Occasional framerate dips: For using scanline sync with VSYNC OFF, you ideally prefer 99.9% framerate matching refresh rate. But for combining Scanline Sync with Fast Sync / Enhanced Sync, it is okay if there's occasional framerate dips -- such as disk access -- e.g. you're able to sustain full framerate matching refresh rate 90%+ to 95%+ of the time, so just aim for the 90th or 95th percentile of permanence. For emulators or older games, it's easy to aim at the 99th+ percentile though, but for newer games, just merely getting 90th percentile can sometimes be hard. A stutter will be a visual indicator of a lag spike, so if you're getting stutters during competitive-critical gameplay, then you definitely want to calibrate for framerate permanence above that, to improve aiming during critical heated moments. You might not be able to do anything about those disk access stutters, but at least you've calibrated for your critical moments.
Extra safety margin: For all of modes other than VSYNC OFF -- I recommend moving the tearline least 1/10th screen height above the bottommost visible tearline (where the tearline vibrates downwards to). Basically you should have a 1/10th area above bottom edge of screen that you've never seen the tearline vibrate downwards to. This gives you "padding". This adds 1/10th refresh cycle extra lag (~1.6ms at 60Hz) but will eliminate your lag spikes during Fast Sync, etc. If you're trying to synchronize at 120Hz or 144Hz, try 1/5th screen height of padding above bottom edge of screen.

What about SyncScanLine1 for twice framerate versus refresh rate?:
- If unfamiliar with this, keep SyncScanLine1 setting to 0. Worry only about one tearline (SyncScanLine0 or via GUI)
- Even if you do this, please do the easy stuff first before attempting this

If your game is ultra-low GPU (e.g. Quake Live or CS:GO) combined with motion blur reduction, this can reduce strobe lag a further (e.g. 240fps at 120Hz, or 200fps at 100Hz). First, calibrate using VSYNC OFF. You may use two tearlines with Enhanced Sync or Fast Sync -- but not with VSYNC ON (that will frame-throttle you badly). Calibrate the middle tearline to middle of screen (slightly above middle is ideal, to keep it equidistant with the bottommost tearline, but position of middle tearline matters less than the bottommost tearline) but focus on carefully calibrating the bottommost tearline to stay permanently above bottom edge of screen. Ideally, they should be signal-equidistant from each other (half Vertical Total apart, taking into account of VBI versus visible vertical resolution). But this is less critical than keeping the bottommost tearline permanently above bottom edge of screen, in order to avoid those lag spikes during Fast Sync and Enhanced Sync.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: RTSS Scanline Sync HOWTO

Post by Chief Blur Buster » 06 Feb 2019, 02:45

Pros/Cons

Full framerate
RTSS + Any sync = Identical look with almost identical lag

Framerate Slowdowns
RTSS + VSYNC OFF = tearlines will reappear
RTSS + Fast Sync / Enhanced Sync / VSYNC ON = stutters will reappear

Choose Your Preference
Some people are more sensitive to stutters.
Some people are more sensitive to tearing.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

User avatar
tygeezy
Posts: 104
Joined: 29 Feb 2016, 21:56

Re: RTSS Scanline Sync HOWTO

Post by tygeezy » 25 Feb 2019, 13:26

Chief Blur Buster wrote:Pros/Cons

Full framerate
RTSS + Any sync = Identical look with almost identical lag

Framerate Slowdowns
RTSS + VSYNC OFF = tearlines will reappear
RTSS + Fast Sync / Enhanced Sync / VSYNC ON = stutters will reappear

Choose Your Preference
Some people are more sensitive to stutters.
Some people are more sensitive to tearing.
I just got a 4k tv freesync samsung and since nvidia gsync over freesync only works on display port and I only have hdmi this tweeking world is now back in my life.

So, I started up batman origins. I seem to be able to run this game at a little more than double my refresh rate at 4k (123 ish average on bench mark). So I can use vsync plus scan line sync (flush=1) and not incur the ridiculous lag penalty of just vsync on at 60 hz with no framerate capping?

Also, do you get stutter if you use scan line sync + vsync off and the game runs below you refresh rate? I was reading someone elses post and he didn't mention stutter in this scenario, but that the tear lines would be unstable and jump around?

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: RTSS Scanline Sync HOWTO

Post by Chief Blur Buster » 25 Feb 2019, 19:18

tygeezy wrote:Also, do you get stutter if you use scan line sync + vsync off and the game runs below you refresh rate? I was reading someone elses post and he didn't mention stutter in this scenario, but that the tear lines would be unstable and jump around?
Yes, there can still be slight stutter, but it depends on how much the tearline moves around.

A slight frametime delay (e.g. 1ms) will generally only cause a momentary appearance of tearline near the top edge of the screen.

No visible stutter will occur for the frame below a slightly-delayed tearline, but a stutter will be visible for the frame ABOVE the tearline. So how far that "delayed" tearline moves downwards, dictates how much stutter visibility is unveiled to you.

For 120Hz (8ms refresh cycle), a 1ms delay is equal to a tearline moving downwards approximately 1/8th screen height (and/or wrapping around back to the top edge of the screen). So one single, instantaneous, one-time "2ms frametime delay" during VSYNC OFF Scanline Sync -- means (2ms/8ms)th = one-quarter of screen (area above the tearline briefly showing up nearer top edge of screen) with the remainder three-quarter of the screen (area below tearline) will have no visible stutter.

Your eyes are usually staring at the middle of the screen -- so if you've adjusted RTSS Scanline Sync to hide tearline between refresh cycles -- then everytime a tearline reappears at the top edge (tearling jittering) due to a tiny brief framerate spike - you won't see a stutter. Now if framerate sustains slow (e.g. you have eight "1ms late" frametimes, accumulating to a grand total of 8ms delay = one refresh cycle at 120Hz), you've got a one refresh cycle's wraparound worth of a single microstutter -- so a consecutive sequence of very-slightly-late frametimes that builds up to a framedrop. In this situation, you've got a rolling tearline that "wraps-around". This is more eye-catching than the microstutter itself, so the microstutter itself may not be noticed at all especially if the rolling/scrolling tearline is the more eye-catching artifact.

Now, that depends on how you've configured RTSS. In some cases you'll simply be getting full-screen stuttering a lot more (since the process of hiding a too-late tearline necessitiates waiting for the next refresh cycle to re-time the tearline at the correct position of the next refresh cycle scanout.

Bigger frametime spikes that last a refresh cycle or more, will always have visible stutter.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

Litzner
Posts: 30
Joined: 25 Apr 2018, 14:29

Re: RTSS Scanline Sync HOWTO

Post by Litzner » 26 Mar 2019, 09:26

In DX12 and Vulkan games, if I use SyncFlush=0 the tear line moves a lot but mostly stays on screen if i set it in the middle. If I use SyncFlush=2 I can't hold a steady frame-rate and they dip 20+ frames below where I want it sometimes.

In both modes my GPU is not hitting its max clock to compensate, where my max clock is above 1.6 ghz, my gpu stays at 1.2ghz, as its not being "seriously taxed". I assume if I were running at near my max clock I wouldn't have the large tear line variation or frame rate dips with the 2 flush modes.

Am I missing something, or is this just a symptom of boost algorithms on modern graphics cards?

User avatar
RealNC
Site Admin
Posts: 3730
Joined: 24 Dec 2013, 18:32
Contact:

Re: RTSS Scanline Sync HOWTO

Post by RealNC » 26 Mar 2019, 10:21

Litzner wrote:In both modes my GPU is not hitting its max clock to compensate
Does setting GPU to "max performance" in the NVCP help?
SteamGitHubStack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.

Litzner
Posts: 30
Joined: 25 Apr 2018, 14:29

Re: RTSS Scanline Sync HOWTO

Post by Litzner » 26 Mar 2019, 11:44

RealNC wrote: Does setting GPU to "max performance" in the NVCP help?
It's a AMD card, Vega 64 to be exact. In the AMD CP I have Radeon Chill turned off and am running in balanced mode.

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: RTSS Scanline Sync HOWTO

Post by Chief Blur Buster » 27 Mar 2019, 21:31

Litzner wrote:
RealNC wrote: Does setting GPU to "max performance" in the NVCP help?
It's a AMD card, Vega 64 to be exact. In the AMD CP I have Radeon Chill turned off and am running in balanced mode.
Precision tearline control requires microsecond accuracies. A delay of one horizontal scanrate unit (e.g. 1/160,000sec) moves a tearline downs 1 pixel.

Graphics output are transmitting one row of pixels at a time, and RTSS Scanline Sync piggybacks on that fact to do a precision "interrupt" at the right moment.

Essentially, this is a raster-based technique (timing the tearline based on precision timing of the sequential scan-out of GPU output) that RTSS Scan Line Sync is using. Raster-based operations on modern GPUs require 100% performance -- I've noticed that sync reliability is higher at approximately 30%-50% GPU load than at <10% GPU load and 100% GPU load. At <10% GPU, the power management tends to screw around with the raster precision.

Pushing power to maximum and intentionally loading the GPU to goldilocks level, causes RTSS Scanline Sync to behave more reliably. It's not one of the easiest sync modes to work with.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

Litzner
Posts: 30
Joined: 25 Apr 2018, 14:29

Re: RTSS Scanline Sync HOWTO

Post by Litzner » 28 Mar 2019, 08:19

Chief Blur Buster wrote:I've noticed that sync reliability is higher at approximately 30%-50% GPU load than at <10% GPU load and 100% GPU load.
When my card drops lower in utilization it seems to want to drop to a lower speed clock as well. I think I have found a good spot, it appears in Vulkan\DOOM I can't use SyncFlush=2, as it just won't hold a frame rate = refresh rate at all. SyncFlush=0 does a much better job in this use case, as I can move the tear line to get it to stay on screen at least and always stay at 120FPS (except cut scenes for some reason, DOOM seems to lock those at 60 fps).

This seems to vary greatly depending on game engine. What I am doing now is using SyncFlush=0 for all DX12\Vulkan titles, calibrating the tear line so I can see it in the middle of my screen, if it moves around too much in testing I will use Enhanced Sync\VSync and take the small input lag hit, if the tear line doesn't move enough to make it too noticeable at the top\bottom of the screen I will move it below the bottom of the screen and use the NoVsync method.

User avatar
Chief Blur Buster
Site Admin
Posts: 11647
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: RTSS Scanline Sync HOWTO

Post by Chief Blur Buster » 29 Mar 2019, 20:45

Advanced trick, but....

In ToastyX CRU or NVIDIA Control Panel Custom Resolution or AMD Catalyst Center Custom Resolution....

One can also intentionally use a Large Vertical Total to hide the tearline better.

The blanking interval size is (Large Vertical Total) minus (Vertical Resolution). So a VT1350 at 1080p means you've got a generous 270-line jitter margin that's completely off-screen. Meaning, a tearline can vibrate 270 pixels up/down and still never appear.

It depends on your monitor though, some of them don't tolerate large vertical totals well but several of them do, and it is an excellent tool to help you hide the tearline offscreen, while also providing you with a "Quick Frame Transport" effect. (to reduce input lag, because of a higher scan rate). Just remember, that if your VBI becomes much bigger than your tearline jitter -- then align your tearline just right above the top edge of the screen (lower lag), rather than just right below the bottom edge of the screen. Aligning that way can give you (VBI/VT)ths less input lag. (aka 270/1350ths of a refresh cycle less input lag, for a VBI size of 270 for Vertical Total 1350)
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

Post Reply