what i'm trying to figure out is where every millisecond of input lag comes from.
the stuff that i can account for, in the sense that i know its probabilistic distribution, are
1) time between physical event and the next usb poll
2) time between the usb poll and frame rendering
3) time to process the gamestate and draw the frame
4) additional time due to the fact that the display runs at some finite refresh rate
ideally:
(1) is effectively a uniform random variable between 0 and the inverse of the usb polling rate
(2) is effectively a uniform random variable between 0 and the time between frames, which is equal to the inverse of actual framerate. unless the frame rendering is precisely synchronized to usb polling...
(3) is a constant equal to the inverse of the uncapped framerate.
(4) depends on how much of the image responds to the physical event, and the amount of display my camera/photodiode/whatever is focused on. if either of these is small, then (4) would correspond to a uniform random variable between 0 and the inverse of the screen refresh rate. but if the entire iamge shows a change and my camera/photodiode is looking at the entire screen, then (4) would be 0 ~90% of the time, and a uniform random variable between 0 and the vblank length ~10% of the time.
the unknown things are stuff like how long it takes for the mouse sensor and microcontroller to process info; whether the mouse position is buffered, filtered, or processed in a way that introduces lag; whether the game or graphics driver is buffering rendered frames unnecessarily; how long it takes for the gpu/display to process the video signal due to scaling or lcd overdrive; whether the display buffers frames; etc...
mouse and display responsiveness are definitely worth investigating in their own rights, but to do that, first the contribution of other things must be accounted for. otherwise it is much harder or impossible to determine the contribution from the various unknown factors. that's why i'm using an arduino+button setup for the "mouse" and a crt for the display.
anyway... actually i was wrong here:
flood wrote:whereas with a photodiode looking over the entire screen, the signal will slope linearly and depending on the signal to noise ratio, only after a significant portion of the screen lights up can the signal be sensed by the arduino.
i forgot that i'm using a crt and that the phosphors light up and decay pretty quickly. the signal will actually be very well defined here...
just think about it... just after 1ms or so after any part of the display begins to turn to white, the signal the photodiode receives is pretty much the same as what it sees once the entire display shows white.
guess im gonna go shop around in radioshack and frys tomorrow ;d