Blur Busters Forums

Who you gonna call? The Blur Busters! For Everything Better Than 60Hz™ Skip to content

flood's input lag measurements

Everything about input lag. Tips, testing methods, mouse lag, display lag, game engine lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.

Re: flood's input lag measurements

Postby flood » 25 Jul 2017, 22:52

lol haven't checked this thread in a while

Kulagin wrote:
flood wrote:idk honestly...
i don't have the time or interest that i used to
i'm still offering to give the rig away to anyone who wants :P (assuming that it still works)

Woah. :o
Are you serious? Send it to me. I can take it.

k added you on steam (asdf)

flood wrote:too busy with stuff to work on this for the rest of the year probably :P
anyone want to take over? i'd be willing to give this rig away to anyone who
1. is curious and has more free time than i do
2. has a crt monitor
3. understands psychological biases and is careful with drawing conclusions from data
4. is reasonably knowledgeable in basic programming, electronics, data analysis, etc...
5. is not epileptic (during measurements, the screen flashes black/white 10-40 times a second in a dark room)



if i forget about this, pm spacediver and he can email me :P
flood
 
Posts: 881
Joined: 21 Dec 2013, 01:25

Re: flood's input lag measurements

Postby spacediver » 25 Jul 2017, 23:22

:)
spacediver
 
Posts: 482
Joined: 18 Dec 2013, 23:51

Re: flood's input lag measurements

Postby Kulagin » 23 Aug 2017, 20:43

flood wrote:lol haven't checked this thread in a while
if i forget about this, pm spacediver and he can email me :P

spacediver wrote::)

So it's been almost a month. I couldn't catch flood online in Steam since he added me. Spacediver, could you email flood for me, please? It would be nice to have a free rig for tests :D

And could you please also give me access to send PMs on this forum? It says I can't do that:
Image
Kulagin
 
Posts: 6
Joined: 27 Feb 2016, 08:17

Re: flood's input lag measurements

Postby Kulagin » 23 Aug 2017, 20:56

So I finally made my own input lag tester based on Arduino Leonardo and LM393 light sensor(photoresistor):
Image

I wanted to keep it simple so I wrote a simple lag tester in HTML5:
http://plnkr.co/edit/Q8CzgCo451XKKFbdmJAH?p=preview

And code for Arduino:
Code: Select all
// Mouse - Version: Latest
#include <Mouse.h>

// light sensor pin
const byte lightSensorPin = 11;
// the number of the pushbutton pin
const byte buttonPin = 2;

// used in tests to get time when test starts
unsigned long startTime;
// used in tests to get time when sensor responded to pixel changes
unsigned long endTime;

// variable for reading the pushbutton state
bool buttonState = 0;

// variable for reading the light sensor state
bool newLightSensorState = 0;
// variable for storing previous state of light sensor
bool oldLightSensorState = 0;

void setup() {
  
  
// initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // initialize mouse
  Mouse.begin();
  
  
// initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT_PULLUP);
  // initialize light sensor pin as an input
  pinMode(lightSensorPin, INPUT);
  // initialize the LED pin as an output:
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // read the state of the pushbutton value:
  int buttonState = digitalRead(buttonPin);

  // check if the button is pressed. If it is, the buttonState is LOW:
  if (buttonState == LOW) {
    // turn LED on:
    digitalWrite(LED_BUILTIN, HIGH);
    
    oldLightSensorState 
= newLightSensorState; // store previous state of light sensor
    newLightSensorState = digitalRead(lightSensorPin); // get new state of light sensor
    
    
    
//Serial.println(newLightSensorState);
    Mouse.press();
    startTime = micros();
    delay(0);
    // wait until sensor's state is changed
    while(newLightSensorState == 1 && buttonState == LOW)
    {
      oldLightSensorState = newLightSensorState; // store previous state of light sensor
      newLightSensorState = digitalRead(lightSensorPin); // get new state of light sensor
      buttonState = digitalRead(buttonPin);
      delay(0);
    }
    
    endTime 
= micros();
    Mouse.release();
    
    float responseTime 
= (endTime - startTime)/1000.0;
    Serial.print("startTime: ");
    Serial.print(startTime);
    Serial.print(", ");
    Serial.print("endTime: ");
    Serial.print(endTime);
    Serial.print(", ");
    Serial.print("responseTime: ");
    Serial.println(responseTime);
    delay(200);
  } else {
    // turn LED off:
    digitalWrite(LED_BUILTIN, LOW);
  }
}
 


How it works:
1. Put light sensor as close to LCD as possible. My sensor is in the top left corner of the monitor 3mm away from the display.
2. Open lag tester web app. I launch it locally in full screen(F11 key to go in full screen mode).
3. Press and hold a button(I use a toggle button) on Arduino, it will take motion to photon latency measurements every ~200ms until you release a button and print on the Monitor(analog of console.log in browsers) it through serial port.

That's just a prototype. I guess I'll try to make it to automatically gather data and save it to Google Spreadsheet or something.

Now I'll test all of these threads claiming they reduce input lag in video games Image

Few days ago I saw this video:
phpBB [video]


Looks like it is flood's video but I can't find this map anywhere. Can anyone help me to find this map?
Last edited by Kulagin on 23 Aug 2017, 22:22, edited 1 time in total.
Kulagin
 
Posts: 6
Joined: 27 Feb 2016, 08:17


Re: flood's input lag measurements

Postby Sparky » 23 Aug 2017, 21:40

Kulagin wrote:So I finally made my own input lag tester based on Arduino Leonardo and LM393 light sensor(photoresistor):
Image

I wanted to keep it simple so I wrote a simple lag tester in HTML5:
http://plnkr.co/edit/Q8CzgCo451XKKFbdmJAH?p=preview

And code for Arduino:
Code: Select all
// Mouse - Version: Latest
#include <Mouse.h>

// light sensor pin
const byte lightSensorPin = 11;
// the number of the pushbutton pin
const byte buttonPin = 2;

// used in tests to get time when test starts
unsigned long startTime;
// used in tests to get time when sensor responded to pixel changes
unsigned long endTime;

// variable for reading the pushbutton state
bool buttonState = 0;

// variable for reading the light sensor state
bool newLightSensorState = 0;
// variable for storing previous state of light sensor
bool oldLightSensorState = 0;

void setup() {
  
  
// initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  // initialize mouse
  Mouse.begin();
  
  
// initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT_PULLUP);
  // initialize light sensor pin as an input
  pinMode(lightSensorPin, INPUT);
  // initialize the LED pin as an output:
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // read the state of the pushbutton value:
  int buttonState = digitalRead(buttonPin);

  // check if the button is pressed. If it is, the buttonState is LOW:
  if (buttonState == LOW) {
    // turn LED on:
    digitalWrite(LED_BUILTIN, HIGH);
    
    oldLightSensorState 
= newLightSensorState; // store previous state of light sensor
    newLightSensorState = digitalRead(lightSensorPin); // get new state of light sensor
    
    
    
//Serial.println(newLightSensorState);
    Mouse.press();
    startTime = micros();
    delay(0);
    // wait until sensor's state is changed
    while(newLightSensorState == 1 && buttonState == LOW)
    {
      oldLightSensorState = newLightSensorState; // store previous state of light sensor
      newLightSensorState = digitalRead(lightSensorPin); // get new state of light sensor
      buttonState = digitalRead(buttonPin);
      delay(0);
    }
    
    endTime 
= micros();
    Mouse.release();
    
    float responseTime 
= (endTime - startTime)/1000.0;
    Serial.print("startTime: ");
    Serial.print(startTime);
    Serial.print(", ");
    Serial.print("endTime: ");
    Serial.print(endTime);
    Serial.print(", ");
    Serial.print("responseTime: ");
    Serial.println(responseTime);
    delay(200);
  } else {
    // turn LED off:
    digitalWrite(LED_BUILTIN, LOW);
  }
}


How it works:
1. Put light sensor as close to LCD as possible. My sensor is in the top left corner of the monitor 3mm away from the display.
2. Open lag tester web app. I launch it locally in full screen(F11 key to go in full screen mode).
3. Press and hold a button(I use a toggle button) on Arduino, it will take motion to photon latency measurements every ~200ms until you release a button and print on the Monitor(analog of console.log in browsers) it through serial port.

That's just a prototype. I guess I'll try to make it to automatically gather data and save it to Google Spreadsheet or something.

Few days ago I saw this video:
phpBB [video]


Looks like it is flood's video but I can't find this map anywhere. Can anyone help me to find this map?

The map is earlier in this thread: viewtopic.php?p=15665#p15665

As for your test setup, can you measure the latency of your setup responding to the LED it illuminates? Is there any change if you delete those "delay(0);"s?

For saving stuff in a spreadsheet, I just output a CSV format over serial. Stupid simple, and any spreadsheet program can import it.
Sparky
 
Posts: 535
Joined: 15 Jan 2014, 02:29

Re: flood's input lag measurements

Postby Kulagin » 23 Aug 2017, 22:56

Sparky wrote:As for your test setup, can you measure the latency of your setup responding to the LED it illuminates?

Yes, I was thinking about that, to determine the deviation. But I don't know what's the deviation of LEDs themselves, like, in what time range LEDs light up? Is it, let's say, 10.5-10.75 ms or is it 10-15 ms? Of course, different LEDs have different 'light up deviation'. So which one I would want to use to test deviation? There are like over9000 models of them.

In LM393 datasheet it says response time ~1.3 us. I've also read that if you go deep enough you can get Arduino to measure with a precision of 125 ns or something. I wanted to use TCS230 color sensor, it said in datasheet that it has 100 ns response time. But I couldn't find it in the local stores.
I think any deviation/latency below 1ms isn't that important, IMHO.

Sparky wrote:Is there any change if you delete those "delay(0);"s?

Yes, it glitches out for some reason and 50% of the time I get the same results as with delays but then I get 0 or 150-200% bigger number than average. So results would be something like: 0-55-0-56-0-57 or 56-101-58-102-57-101. Sometimes it would glitch out 1 time after another(glitched-normal-glitched-normal-glitched-normal) and sometimes it would glitch out only once in few measurements or multiple times in a row.
I thought it was a problem with Arduino code but as soon as I added delays bug disappeared.
I was trying to find my mistakes in the code for an hour or two and then I remembered all of that debouncing stuff and how they all recommend to wait a little after you take a measurement(or press a button). So I added little delays and it started working properly. I don't know why, I wanted to ask that on Arduino forums myself.

Sparky wrote:The map is earlier in this thread: viewtopic.php?p=15665#p15665

lexlazootin wrote:http://www.mediafire.com/file/s7qslggml9l4rc8/map_flood.zip
http://www.mediafire.com/file/4yzrr6jme ... detail.zip

Thanks. Image
Kulagin
 
Posts: 6
Joined: 27 Feb 2016, 08:17

Re: flood's input lag measurements

Postby Sparky » 24 Aug 2017, 05:31

Kulagin wrote:
Sparky wrote:As for your test setup, can you measure the latency of your setup responding to the LED it illuminates?

Yes, I was thinking about that, to determine the deviation. But I don't know what's the deviation of LEDs themselves, like, in what time range LEDs light up? Is it, let's say, 10.5-10.75 ms or is it 10-15 ms? Of course, different LEDs have different 'light up deviation'. So which one I would want to use to test deviation? There are like over9000 models of them.
10~15 milliseconds is really high, It should be more like tens of microseconds.

In LM393 datasheet it says response time ~1.3 us. I've also read that if you go deep enough you can get Arduino to measure with a precision of 125 ns or something. I wanted to use TCS230 color sensor, it said in datasheet that it has 100 ns response time. But I couldn't find it in the local stores.
I think any deviation/latency below 1ms isn't that important, IMHO.
That's just the response time of the comparator, not the whole sensor circuit.

Sparky wrote:Is there any change if you delete those "delay(0);"s?

Yes, it glitches out for some reason and 50% of the time I get the same results as with delays but then I get 0 or 150-200% bigger number than average. So results would be something like: 0-55-0-56-0-57 or 56-101-58-102-57-101. Sometimes it would glitch out 1 time after another(glitched-normal-glitched-normal-glitched-normal) and sometimes it would glitch out only once in few measurements or multiple times in a row.
I thought it was a problem with Arduino code but as soon as I added delays bug disappeared.
I was trying to find my mistakes in the code for an hour or two and then I remembered all of that debouncing stuff and how they all recommend to wait a little after you take a measurement(or press a button). So I added little delays and it started working properly. I don't know why, I wanted to ask that on Arduino forums myself.

Does that sensor board put any positive feedback/hysteresis into that comparator? It sounds like the measurement is changing state when it shouldn't.
Also, you may be unintentionally synchronizing latency measurements to your refresh rate. Try making that 200ms delay a random delay between 100 and 300ms.

Also try replacing the delay(0); with delayMicroseconds(3);
delay(0); is about 5us, but not terribly consistent.
Sparky
 
Posts: 535
Joined: 15 Jan 2014, 02:29

Re: flood's input lag measurements

Postby spacediver » 24 Aug 2017, 12:21

Kulagin wrote:
flood wrote:lol haven't checked this thread in a while
if i forget about this, pm spacediver and he can email me :P

spacediver wrote::)

So it's been almost a month. I couldn't catch flood online in Steam since he added me. Spacediver, could you email flood for me, please? It would be nice to have a free rig for tests :D

And could you please also give me access to send PMs on this forum? It says I can't do that:
Image


I've just emailed flood. As for PM access, I'll contact Mark and ask him if he can get you access.
spacediver
 
Posts: 482
Joined: 18 Dec 2013, 23:51

Re: flood's input lag measurements

Postby spacediver » 24 Aug 2017, 12:25

so you need 5 posts for PM access. You're just one away :)
spacediver
 
Posts: 482
Joined: 18 Dec 2013, 23:51

PreviousNext

Return to Input Lag

Who is online

Users browsing this forum: Bing [Bot] and 1 guest