August 4, 2006

[Testing] Reason #∞ To Dislike PC Testing

Okay, I can't share any source code for this one, but you've got to love this one...

Standard do-nothing DirectX application, consisting of basic render loop and DirectInput polling. The only other items hooked up to the computer are a USB keyboard and a USB mouse.

While the application does not have focus, the render loop runs at full speed (~120fps).

Once the application gains focus, the application framerate drops to .2 frames per second.

Because the problem "goes away" when the application has focus, you can't hook it up to the debugger to track it down, so you insert trace statements.

The trace statements indicate that the DirectInput mouse polling call is "timing out," and is the cause of the problem. Changing the mouse to a different mouse or to a PS/2 mouse has no effect.

Unplugging the keyboard and plugging it back in causes the symptoms to go away until the computer is restarted, at which time the symptoms come back. Changing the keyboard out completely for a different USB keyboard causes the symptoms to go away permanently. However, if you swap the keyboard for another from the same brand, the symptoms come back.

In other words, somehow the keyboard is causing a 99.8% framerate decrease by interfering with the mouse.

Let's just say that on a scale from 1 to 10, this hit a 950 on my WTF-o-meter.

No comments: