Page 1 of 2

Latency of Input Events?

Posted: Mon Aug 09, 2010 6:22 am
by quark
I am experiencing high latency of input events.

I use 'print' to print mouse position / key pressed events, love usually print the current events 1 second later (no matter where I moniter these events: draw(), update(), mousepressed(), etc.

Latency can also be sensed using samples from wiki.

Is there anybody experiencing same problem as me ?

Additional information:
I am using a dual-core Intel x86 laptop running Archlinux i686 and installed love from AUR (version 0.6.2)

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 6:26 am
by kikito
I'm not experiencing anything like that.

Can you put a code sample?

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 6:38 am
by quark
kikito wrote:I'm not experiencing anything like that.

Can you put a code sample?
For example,

Code: Select all

function love.draw()
	local mx, my = love.mouse.getPosition()
	 love.graphics.print(mx..' '..my, 200, 200)
end
If I move mouse from (x0, y0) to (x1, y1) and stop there, love will display two changing numbers and finally stop at (x1, y1).
The problem is the latency: the time love display (x1, y1) is about 1 second after mouse stopping at (x1, y1) :o:

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 7:54 am
by kikito
But is that your complete main.lua file, or are you doing something else (i.e. in love.update)

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 10:01 am
by quark
kikito wrote:But is that your complete main.lua file, or are you doing something else (i.e. in love.update)
that is a complete main.lua ....

I found that love-hg is faster. Maybe my hardware is somehow slow, but love uses < 10% CPU, it is strange ...

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 10:10 am
by bartbes
That is very strange, I have never seen love do anything like it, you could try the usual stuff, update drivers. Another thing that might be interesting, could you test whether this lag also exists in other SDL programs/games (because love uses SDL for input/events)?

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 2:31 pm
by Tesselode
I noticed at least one laptop also lags really bad with Love. Bad enough that the physics glitch up.

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 2:45 pm
by bartbes
But that seems like a mere lack of processing power, input latency is weird.

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 3:22 pm
by pekka
I've tried Löve on a computer with no hardware OpenGL and a non-fancy processor. The particle demos ran at something like 5 frames per sec, and the Lovalanche demo had the balls tunnel thru each other & other weirdness. It was too slow for most things, but the input handling was never anywhere near that slow.

Re: Latency of Input Events?

Posted: Mon Aug 09, 2010 3:38 pm
by Robin
I don't even have this shit on my crappy laptop.