Previous Thread
Next Thread
Print Thread
Page 2 of 5 1 2 3 4 5
Re: Vsync and input lag in Nestopia #22590
03/24/06 05:28 PM
03/24/06 05:28 PM
Joined: Jan 2005
Posts: 154
Texas
blargg Offline
Senior Member
blargg  Offline
Senior Member
Joined: Jan 2005
Posts: 154
Texas
I whipped up a quick reflex tester ROM which I hope to clean up another time. When run, it makes the screen white and waits for your to press A to seed the random number generator. It clicks and delays for 2-6 seconds, then clicks and makes the screen white. At this point you should press A as quickly as you can. It prints the number of milliseconds between the screen changing and you pressing A, then waits for you to press A to start another trial.

Take several times and average them for better accuracy, since the figure varies by many tens of milliseconds. On an emulator that only reads input once per frame, measurements will always vary by a multiple of 16.6666.

I took measurements for several setups involving my NES and an emulator on my PC with a CRT refreshing at 76 Hz. For each setup, I took 12 times and found the average. For audio, I used headphones.

Code:
189	Video, NES on TV
194	Video, NES on video capture
227	Video, emulator using custom serial joypad
236	Video, emulator using keyboard
254	Video, emulator using keyboard, vsync enabled
231	Video, emulator using custom serial joypad, vsync enabled
191	Audio, NES RCA out
254	Audio, emulator using custom serial joypad
Take your own measurements and post them with a description of what you timed.

reflex_timer.nes

Re: Vsync and input lag in Nestopia #22591
03/24/06 05:41 PM
03/24/06 05:41 PM
Joined: Mar 2002
Posts: 1,060
H
hap Offline
Very Senior Member
hap  Offline
Very Senior Member
H
Joined: Mar 2002
Posts: 1,060
Redx: The technique of triple buffering will only work in fullscreen, have you tried that ?

Also, setting your refresh rate to 120hz or 60hz (or 50/100 for PAL), won't make accurate NES emulators run smoothly, as the (NTSC) NES refresh rate is not exactly 60hz. To demonstrate this, try setting vsync off, and you'll see an ugly 'line' slowly moving downward.

Re: Vsync and input lag in Nestopia #22592
03/24/06 06:05 PM
03/24/06 06:05 PM
Joined: Mar 2002
Posts: 1,060
H
hap Offline
Very Senior Member
hap  Offline
Very Senior Member
H
Joined: Mar 2002
Posts: 1,060
Using an emulator (Sega Li), TFT screen at 75hz, headphones for audio, DirectX input.

Using keyboard, USB joypad, or wireless USB mouse made no difference. Enabling or disabling vsync didn't seem to cause a difference either.

video: between 197 and 213
audio: usually 230 (probably due to latency)

Strangely (assuming the mouse would be the slowest), my 'high score' was obtained with the mouse (181).

*edit* Using Nestopia, I get the same results, didn't test audio though.

Re: Vsync and input lag in Nestopia #22593
03/24/06 06:42 PM
03/24/06 06:42 PM
Joined: Jan 2006
Posts: 138
Sweden
M
Marty Offline

Senior Member
Marty  Offline

Senior Member
M
Joined: Jan 2006
Posts: 138
Sweden
Does your problem account for *all* different input devices, i.e keyboard, joysticks? Are there any lags when you run Nestopia in desktop mode with the default refresh rate set to 60hz in the control panel?

Your joystick, if that's what you're using, what's the name of it? Is it USB or gameport driven?

What gfx card and driver are you using? Is it MS certified? Certain driver vendors likes to stack up internal screen buffers in order to get higher scores on 3D benchmarking programs. Have you made sure you don't use any bogus gfx driver settings and that its own 'Triple Buffering' option is disabled?

Here's a test you can do. Run and compare the input response on SMB1 and VS.SMB1. On non VS games it takes place the instant the emulated game requests it and slight earlier on VS games.

Quote:

Also, the triple buffering option doesn't seem to work (screen tearing still occur).
That's not the main goal of triple buffering. It's there to help, but not on synchronizing.

Quote:

Some people mentionned that vsync might be inferior to triple buffering in that it does have a tendency to cause input lag. I don't know if this information is accurate but this is what I heard.
Not really. From a gamer's perspective it can be seen that way, but they're conceptually different. I generally don't recommend triple-buffering in emulators unless there's actually a speed problem or if the user is happy with the delay it imposes. Further more, extra back-buffers are managed by Direct3D so there's little a developer need to do to support triple buffering.

Re: Vsync and input lag in Nestopia #22594
03/24/06 10:36 PM
03/24/06 10:36 PM
Joined: Mar 2006
Posts: 17
R
Redx Offline OP
Junior Member
Redx  Offline OP
Junior Member
R
Joined: Mar 2006
Posts: 17
Blargg, that's pretty neat.

Although it can be a valuable tool in many instances it's main problem is that it relies on human reaction,which is relatively slow and not totally constant.

The idea I proposed, while not perfect, has the advantage on not relying at all on human reaction,(or for that matter, any kind of human interaction if you manage to code an automated test that just pass the input to the emulator)
.The program simply compare the time the input is entered and the time the display is updated, so there's no any kind of "You must press........ NOW!' involved.


Quote:
Does your problem account for *all* different input devices, i.e keyboard, joysticks? Are there any lags when you run Nestopia in desktop mode with the default refresh rate set to 60hz in the control panel?

Your joystick, if that's what you're using, what's the name of it? Is it USB or gameport driven?

What gfx card and driver are you using? Is it MS certified? Certain driver vendors likes to stack up internal screen buffers in order to get higher scores on 3D benchmarking programs. Have you made sure you don't use any bogus gfx driver settings and that its own 'Triple Buffering' option is disabled?
I'll do a test and report back.

Re: Vsync and input lag in Nestopia #22595
03/24/06 10:58 PM
03/24/06 10:58 PM
Joined: Jan 2006
Posts: 138
Sweden
M
Marty Offline

Senior Member
Marty  Offline

Senior Member
M
Joined: Jan 2006
Posts: 138
Sweden
Very nifty utility. Here's what I got using my GameCube controller via a special USB adapter:

197+197+197+197+181+197+213+181+197+197+197+213 / 12 = 197.00 <- 60hz, no vsync
197+213+181+197+213+197+181+181+181+213+197+197 / 12 = 195.67 <- 120hz, no vsync
213+213+213+213+213+197+197+197+197+213+197+197 / 12 = 205.00 <- 60hz, vsync
213+197+181+197+197+197+213+230+181+213+213+213 / 12 = 203.75 <- 120hz, vsync

As Jack Burton says, it's all in the reflexes.

Re: Vsync and input lag in Nestopia #22596
03/25/06 12:11 AM
03/25/06 12:11 AM
Joined: Mar 2006
Posts: 17
R
Redx Offline OP
Junior Member
Redx  Offline OP
Junior Member
R
Joined: Mar 2006
Posts: 17
Quote:
Very nifty utility. Here's what I got using my GameCube controller via a special USB adapter:

197+197+197+197+181+197+213+181+197+197+197+213 / 12 = 197.00 <- 60hz, no vsync
197+213+181+197+213+197+181+181+181+213+197+197 / 12 = 195.67 <- 120hz, no vsync
213+213+213+213+213+197+197+197+197+213+197+197 / 12 = 205.00 <- 60hz, vsync
213+197+181+197+197+197+213+230+181+213+213+213 / 12 = 203.75 <- 120hz, vsync
I think it's safe to say that the results are inconclusive at best...Even if it does sugest there's slighly more lag with Vsync on...But I think it cannot be use to do objective testing.

Is there any way to avoid the screen tearing without enabling vsync? I'm curious what is the exact fps of the Nes?


Btw I have a Saitek P880 but I fail to see how it could be the gamepad's fault seeing as it does work perfectly without vsync..I realise there may be more to it but...

Also I turned off the horizontal/vertical syncronization in my card's driver (Diamont S85 128MB DDR Radeon 9250 series AGP (0x5960) ) and the lag is still present (I always do a blind test to determine it and I guess right everytime)

I can do more test such as running in a window or running fullscreen at 120hz


Quote:
Redx: The technique of triple buffering will only work in fullscreen, have you tried that ?
Yes, stil gets tearing.

Re: Vsync and input lag in Nestopia #22597
03/25/06 01:57 AM
03/25/06 01:57 AM
Joined: Jan 2005
Posts: 154
Texas
blargg Offline
Senior Member
blargg  Offline
Senior Member
Joined: Jan 2005
Posts: 154
Texas
A couple of timing notes: The measurement of reaction time includes all of the following: time it takes you to respond, input latency, process scheduling overhead, processor time used for emulation, time used to send graphics to video card, (optional) time while waiting for vsync, time for the monitor to display the image (beam retrace or equivalent on LCD). For audio, replace the video with outputting sound to audio buffer, when the buffer is acually read (similar to monitor retrace), and the time it takes for the sound to travel from the speakers to your ears (not sure what this is, might only be a few milliseconds).

Each person's measurement will be different, if only for their differences in reaction me. Assuming this has stable characteristics, this allows relative comparison between one person's measurements, but not comparison between different people's measurements. If two people measured on the exact same system, then differences in reaction time could be determined. The best system for doing this is the NES, due to the lack of variability in setup (except if you're using a modern new-fangled HDTV or some crap like that, yes, they will be crap for a NES).

I think we need someone with some fluency in basic statistics here. I'm thinking that it would help in analyzing the vairiances in values and drawing useful conclusions.

Quote:
Redx: Although it can be a valuable tool in many instances it's main problem is that it relies on human reaction,which is relatively slow and not totally constant.
I just want to say that you're style of discussion is very annoying. Almost every post has a "yes but". How about exploring the topic rather than turning it into a ****ing debate? As in, "how can we eliminate the error caused by varying raction times?" the answer to which is: run many trials on the assumption that variances in one's reaction time will be uncorrelated with the time we're trying to measure. You're not the only one guilty of this, but it's really irritating to interact with. Start with the assumption that problems can be solved and that people are going to explore the issue rather than stick entirely to the original problem statement as you posed it and constantly rebut.

Quote:
Redx: The idea I proposed, while not perfect, has the advantage on not relying at all on human reaction,(or for that matter, any kind of human interaction if you manage to code an automated test that just pass the input to the emulator)
.The program simply compare the time the input is entered and the time the display is updated, so there's no any kind of "You must press........ NOW!' involved.
This requires that the PC know when the image reaches the monitor. Or when the sound reaches the speaker cone. It doesn't.

Quote:
Redx: Even if it does sugest there's slighly more lag with Vsync on...But I think it cannot be use to do objective testing.
And it continues.. but but but. Take the humble approach and assume that you might be wrong. So say "How can this tool be be used to make objective measurements?" Good question. Let's discuss it and elaborate on things anyone doesn't understand.

Re: Vsync and input lag in Nestopia #22598
03/25/06 02:12 AM
03/25/06 02:12 AM
Joined: May 2003
Posts: 225
T
Trebor Offline
Senior Member
Trebor  Offline
Senior Member
T
Joined: May 2003
Posts: 225
Quote:
Btw I have a Saitek P880 but I fail to see how it could be the gamepad's fault seeing as it does work perfectly without vsync..I realise there may be more to it but...

Also I turned off the horizontal/vertical syncronization in my card's driver (Diamont S85 128MB DDR Radeon 9250 series AGP (0x5960) ) and the lag is still present (I always do a blind test to determine it and I guess right everytime)
I'm also the owner of Saitek P880's (x2). Never experienced lag with Vsync on or off. There are updated drivers for the P880 available at Saitek website - Make sure you have the latest drivers.

Additionally, I own a Radeon 9800 PRO. No screen tearing with Vsync On. Triple Buffering has no impact for me whether I turn it on or off. I use Catalyst 4.12 drivers, as they work best for my card and setup.

-Trebor

Re: Vsync and input lag in Nestopia #22599
03/25/06 03:52 AM
03/25/06 03:52 AM
Joined: Mar 2006
Posts: 17
R
Redx Offline OP
Junior Member
Redx  Offline OP
Junior Member
R
Joined: Mar 2006
Posts: 17
Blargg, sorry if you find my posting style annoying, believe me, I don't want to argue for the sake of arguing.


Quote:
This requires that the PC know when the image reaches the monitor. Or when the sound reaches the speaker cone. It doesn't.
I admit that I may have misunderstood the problem...

I realise the PC cannot know when the image on the monitor is updated. But the way I thought about it is that you could have an utility that knows the exact time video data has changed. The same way Fraps can capture directX video data without ever needing a monitor whatsoever...

But then, that wouldn't necessarily take into account many factors causing the perceive lag,and the results wouldn't mean anything anyway...well I'm not sure.

Page 2 of 5 1 2 3 4 5

Moderated by  Marty, R. Belmont 

Who's Online Now
2 registered members (Dam0, reenigne), 28 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,654
Posts113,414
Members4,846
Most Online324
Dec 20th, 2018
Powered by UBB.threads™ PHP Forum Software 7.6.1.1
(Release build 20180111)
Page Time: 0.035s Queries: 14 (0.017s) Memory: 5.7339 MB (Peak: 5.9459 MB) Zlib enabled. Server Time: 2019-05-26 06:58:58 UTC