Page 43 of 44

Re: flood's input lag measurements

Posted: 23 Aug 2017, 20:43
by Kulagin
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

Re: flood's input lag measurements

Posted: 23 Aug 2017, 20:56
by Kulagin
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?

Re: flood's input lag measurements

Posted: 23 Aug 2017, 21:32
by lexlazootin

Re: flood's input lag measurements

Posted: 23 Aug 2017, 21:40
by Sparky
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: http://forums.blurbusters.com/viewtopic ... 665#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.

Re: flood's input lag measurements

Posted: 23 Aug 2017, 22:56
by Kulagin
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
Thanks. Image

Re: flood's input lag measurements

Posted: 24 Aug 2017, 05:31
by Sparky
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.

Re: flood's input lag measurements

Posted: 24 Aug 2017, 12:21
by spacediver
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.

Re: flood's input lag measurements

Posted: 24 Aug 2017, 12:25
by spacediver
so you need 5 posts for PM access. You're just one away :)

Re: flood's input lag measurements

Posted: 05 Sep 2017, 15:51
by br00m
Im very interested in how far my feeling that 1.6 is more responsive than csgo is a placebo. Could anyone or maybe even flood himself explain the provided data on the first page (https://docs.google.com/spreadsheets/d/ ... =207953886) to me? Under best conditions whats the lowest input lag for csgo and 1.6? the way i read the data, csgo has an average input lag of 6.5ms and cs 1.6: 2ms.

Re: flood's input lag measurements

Posted: 05 Sep 2017, 17:01
by spacediver
Broom, in the link you provided, I don't see any difference between CSGO and CS 1.6 - both show an input lag of ~2 ms when framerate is uncapped.