22 March 2018, 16:06 | #141 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Lagless vsync
http://www.winuae.net/files/b/winuae.7z
Implemented lagless vsync mode (https://www.blurbusters.com/blur-bus...or-developers/) Replaces old low latency vsync mode. What does it do? It reduces input latency from usual 20ms-40ms+ to less than 5ms! (or even less) This is experimental test version with following requirements and restrictions: - Low latency vsync (with or without 50/60 switching) - Display panel refresh rate must be selected (50 or 60). It must not be "default". - Cycle-exact or approximate CPU speed only. - Fullscreen only. - Direct3D 11 only. - Does not (can not) support black frame insertion or frame doubling = use only standard 50Hz or 60Hz modes. (or up to 85Hz or so ) - Sound syncronization is not updated yet. - Due to above, missed frames/glitches will happen randomly. - Native mode only. - Amiga display to monitor position mapping must be border to border vertically (or close enough) or you may see tearing lines. - Uses CPU polling only. (It should sleep if time between slices is long enough) - Does not gain anything from G-Sync. Current features: - Input is read after each slice. - Default is 4 slices which makes max input latency about 6ms. (Assuming quality "gaming grade" USB input devices that use <=1ms USB rate.) - Because output is shader based, outputting each slice requires full render pass each time. It technically means same as rendering screen 4 times the frame rate. (for example 50Hz output requires rendering 200 frames) -> don't enable any extra shaders unless you have powerful GPU. Most likely requires GPU with on-board RAM (discrete GPU) because this mode increases VRAM bandwidth requirements heavily. Or reduce resolution. - Add config file "gfx_frame_slices=<number of slices>" if you want to test other values, minimum is 3. It passes my standard Pinball Dreams input latency test playability test perfectly. Ball/flipper response feels wrong even with 1 frame of input latency. Last edited by Toni Wilen; 22 March 2018 at 21:14. |
22 March 2018, 17:03 | #142 |
Missile Command Champion
Join Date: Aug 2005
Location: Germany
Age: 52
Posts: 12,438
|
Impressive. This new lagless Vsync/double buffer is pretty much as smooth and responsive as Freesync/single buffer without Vsync.
|
22 March 2018, 18:18 | #143 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Small update. Original vblank rendering was still active, making one extra useless rendering pass + possibly caused random tearing.
|
22 March 2018, 21:01 | #144 |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Just tried the winuae.7z, but I'm encountering some things that make me unsure whether it's active at all.
I need to select "low latency vsync" right? It seems to sync to my real refresh rate of my LCD monitor. When I run it on my default 60hz LCD setup, everything is sped up to 60hz (music, game speed etc), the log also report vsync=60.000hz. Also when I enter a ridiculous number of slices, like "gfx_frame_slices=4000" I get the same result as with the default (like above). Is there anything in the log to verify that the slice method is active and working? Edit: this is on a setup with NVidia GTX 1070. |
22 March 2018, 21:14 | #145 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Of course it uses monitor refresh rate, it is vsync (weirdly done vsync but still a vsync) and can only work if Amiga refresh rate matches monitor rate.
max slice count is limited to 99. Refresh rate must be selected in display panel. It must not be "default". (added to previous post) |
22 March 2018, 21:44 | #146 |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Ah, my bad.
Just tried it with 50hz screenmode and it works like a charm! I need to test more, but first impression with default number of slices and slices at 10 is that input latency is insane . Great stuff, thanks for implementing . Will have to do some more testing with different setups and I hope coming weekend with a CRT setup. |
23 March 2018, 14:58 | #147 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
Is there a particular reason you're limiting the number of slices to 3? I'm asking because the "compatability" with older hardware / integrated graphics (portables etc.) would increase by quite some margin when using less slices than 3. Technically it should even work up to 1 right? Just out of interest, is the timing of reading the input when using say 4 slices, much different now than with low latency vsync in 3.6.1? |
|
23 March 2018, 15:54 | #148 | |||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
Quote:
Quote:
Quote:
|
|||
23 March 2018, 18:34 | #149 | |
Registered User
Join Date: Jul 2008
Location: Netherlands
Posts: 485
|
Quote:
Just juggling thoughts.. Maybe some part of the methodology of this partial frame updating /slicing could be applicable to the non vsync mode as well? I.e. by only applying the slicing and mid-frame updating, without the host beam racing part, non-vsynced mode could potentially get closer to real hardware response too? |
|
23 March 2018, 19:08 | #150 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
|
23 March 2018, 19:46 | #151 |
Missile Command Champion
Join Date: Aug 2005
Location: Germany
Age: 52
Posts: 12,438
|
So with G-Sync/Freesync and this new lagless Vsync we've reached the optimum for now? Or is there still room for a few ms less lag in other tasks inside emulation. What do you think is smallest over-all input lag we could reach these days? Best case scenario, with a modern PC/monitor and decent input devices.
|
23 March 2018, 22:51 | #152 |
Registered User
Join Date: Sep 2017
Location: Kansas, USA
Posts: 324
|
I am getting a steady vsync tear near the top edge of the screen when using this new version. However, I'm not sure if I'm just setting something wrong as I'm not entirely clear on what "Amiga display to monitor position mapping must be border to border vertically (or close enough) or you may see tearing lines." means. Do you mean that one should adjust scaling so that (assuming a regular 320x200 screen) the image should fill the actual display with no gaps, or that the entire overscan area should also be on screen and not scaled off the edge of the display?
Attached is the config and logs from my desktop. |
24 March 2018, 09:35 | #153 |
Zone Friend
Join Date: Apr 2005
Location: London
Posts: 1,176
|
Is new lagless vsync dx11 only?
Does new lagless vsync add siginificantly to cpu load compared to 'old' low latency vsync mode? If answer to either of these queztions is 'yes', then is there any possibility to keep the option of 'old' low latency vsync mode? |
24 March 2018, 11:47 | #154 | |||
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
New update:
- Debug background colors added, shows exact position of slice changes. (Position where tearing happens if timing is wrong) - Now also Direct3D9 compatible (Windows 7+ only) - Stability improved. Quote:
Variable sync (g-sync/etc) also improves it slightly because display output starts immediately when program does Present() call. Normal displays still need to wait for vblank period to end. Quote:
Quote:
It does not need to be exactly right, especially when using small number of slices. (This will become automatic later) 1) No. 2) currently yes, later: most likely almost no. |
|||
24 March 2018, 12:21 | #155 |
Zone Friend
Join Date: Apr 2005
Location: London
Posts: 1,176
|
|
24 March 2018, 14:09 | #156 |
Registered User
Join Date: Sep 2010
Location: Greece
Posts: 27
|
I thought I'd never see the day where emulators on an LCD monitor would match real hardware latency. Great job!
Now if we could convince AMD and NVidia to allow front-buffer rendering in non-VR mode, I think this method would work even better. |
24 March 2018, 14:16 | #157 |
Banned
Join Date: Aug 2005
Location: London / Sydney
Age: 47
Posts: 20,420
|
I haven't had the chance to try this out as yet but...
Well done Toni!!! ...this is the one main thing that "real" Amiga users complain about when using emulation and now you've found a solution without the need for expensive hardware |
24 March 2018, 17:20 | #158 |
Registered User
Join Date: Sep 2017
Location: Kansas, USA
Posts: 324
|
Just tried the new version and, strangely enough, it seems to run slightly better on my laptop which is using the integrated Intel HD Graphics 4000 on the Core i5-3230M CPU than on my desktop with an older i7-860 and GTX 760 video card. On the laptop the debug color bars are rock steady, with only the occasional glitch, but on my desktop the bars jitter constantly, although there doesn't appear to be any visible tearing in the actual emulated display.
Oh, and turbo mode seems to be disabled in this version when using low latency vsync. |
24 March 2018, 17:39 | #159 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
|
I didn't find the solution, I only implemented it This is holy grail for emulation latency! Supposedly impossible to do..
There is still something unexplained going on.. I see bottom slice color appearing in the very top of screen even when topmost present-call is guaranteed inside vblank period. Test with sound disabled, it should remove all large (as in more than +-10 pixel) random jitter but it does not.. Warp mode should already work (and works even better now). Fastest possible CPU still won't work, it is always the biggest problem.. Slice count 2 (from 3) is now supported. |
24 March 2018, 17:46 | #160 |
Missile Command Champion
Join Date: Aug 2005
Location: Germany
Age: 52
Posts: 12,438
|
One thing wasn't clear enough to me though. Can i leave Freesync enabled while the lagless Vsync is running? Or should i disable it in the AMD driver.
Last edited by Retro-Nerd; 25 March 2018 at 04:19. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Photos and/or measurements of Amiga 500 | bLAZER | request.Other | 144 | 16 October 2018 01:40 |
A method for further improving latency (input lag) in FS-UAE | Dr.Venom | support.FS-UAE | 4 | 12 September 2017 16:49 |
Optimizing DirectX apps for low latency input and longer battery life | Dr.Venom | support.WinUAE | 2 | 24 April 2017 09:40 |
What are the measurements of Amiga 1200 case screws | Tallrot | support.Hardware | 9 | 15 June 2016 10:04 |
A1200 and B1230 Voltage Measurements for Dummies? | Jarin | support.Hardware | 2 | 23 January 2014 10:02 |
|
|