On Thu, 2012-01-26 at 15:22 +0200, Lauri Kasanen wrote: > Hi list > > Tracing why there's the occasional delay in Irrlicht apps showed the > culprit as XQueryPointer. > > It's called once per frame, but occasionally it takes much longer than > the average 80us - up to 30ms. This is a huge delay and easily > noticable as a skip/jitter. > > Trying various alternatives, like using the mouse position from the > last Motion/Click event proved jerky/jittery and seemed to lag the > mouse by some frames. > > Any suggestions on making the call faster? Would it be possible to use > it with a timeout, say, if it takes over 1ms, abort?
Xlib doesn't work that way. You could do that with XCB and a main loop though. I'd suspect one of two scenarios. Either the X server has some periodic work it's doing, or the kernel's not waking up X promptly enough. Both should be fairly easy to work through. In the former case, it's most likely to be something on the WakeupHandler or BlockHandler call chains in the X server, which run on either side of the call to select() in the main loop. Probably the easiest way to see what's going on is to have your app print timestamps when it calls QueryPointer, and 'strace -t -e file' on the X server (from an ssh session into the machine under test). Then compare. If there's a long lag between your call to QueryPointer to the X server waking up from select and handling it, then the kernel's not getting the message across in time. If there's a lag between the server waking up and writing back the response, then the server's doing excess work. If it's a server issue we'd need to know what driver and hardware you're using. - ajax
signature.asc
Description: This is a digitally signed message part
_______________________________________________ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com