Sunday, March 14, 2010

Reducing DPC latency on your laptop

If you plan on producing or streaming high-quality live audio (or video) from your laptop computer, or you just happen to be a bit of a tuning nerd, then you definitely should care about DPC latency. (Otherwise, you might want to skip this post, as this is not about making your system run faster per se.)

The Deferred Procedure Call (DPC) latency is a Windows concept. Suffice it to say that audio/video to/from an external device is handled by a queue of such low-level priority function calls. The time delay between a DPC call and execution is the latency (typically measured in microseconds, μs) and varies over time, depending on such variables as system load and running system services (of course), but also hardware and, most importantly, device drivers. To see live measurements of your system’s average DPC latency over time, this free tool is invaluable: Thesycon’s DPC Latency Checker.

A low DPC latency is what we are aiming for, but it’s not just a low mean value, but a constantly low number without any spikes. It’s the spikes in latency that will cause audio or video to stutter, skip, crackle, or pop (only a good thing if you developing a new Rice Krispies commercial). A good system would have no latency spikes above 250 μs; a setup like this or better is a requirement if you plan on being a laptop-DJ performing live, non-pre-recorded sets (next, you’ll need some software like Ableton Live, Native Instruments Traktor, Atomix Virtual DJ, etc., not to mention a good external audio interface, but I digress…).

If you find that your system has a horrible DPC latency profile, you’ll have to do some digging. The sad news is that you’ll mostly be blind in this hunt for low DPC latencies. A general rule of thumb is to make sure that you have the latest drivers for your graphics card (as the display is a big performance hog, even when a system is idle). Next, try stopping any unessential services or background running programs -- one by one -- and seeing if the situation improves (by running the linked-above DPC Latency Checker utility). Generally, background applications like Dropbox, a weather widget, Mozy, etc., don’t affect the DPC queue, but you never know! On my computer, the ESET NOD32 Antivirus real-time protection was the cause of some “minor” periodic 500 μs peaks. Another serious culprit on my machine was CPUgenie, a CPU power management application I installed that reduces CPU voltages to decrease CPU temperatures and increase battery life. I can only infer that other undervolting tools such as RMClock should also be considered potential targets in this war on DPC latency.

If all else fails, try a web search for your notebook computer’s “MODEL NAME” and “DPC LATENCY”. (Come to think of it, you should probably do this first!) In my case, I found out that some hard-core gamers were complaining about the Nvidia graphics card on their Sony Vaio Z’s. This gave me the idea to switch to using the integrated Intel graphics system on my system’s motherboard (conveniently, Sony provides a useful external switch to do this on the machine: “STAMINA” switches to the built-in Intel graphics processing, whereas “SPEED” means the Nvidia graphics card will be used). Although I lose 3D graphics performance by using the integrated graphics unit, my average DPC latency was more than halved (now down to the 50-70 μs range) and, more crucially, eliminated the last of the remaining spikes.

Time for me to enjoy my laptop’s newly lowered DPC postponement statistics… but first, my human priority calls for a short period of dormancy.

3 comments:

Hugo, E-guitar admin said...

Hey,

Question:

What model Sony Vayo do you have? Always on the lookout for a laptop with good DPC latency (I am on a rather dull but DPC latency wise "good" Lenovo at the moment).

LifeOnEight said...

I have a Sony VAIO Z790.

Hugo, E-guitar admin said...

Hey thanks. That is a rather uncommon model in Europe (or better, Belgium). I was hoping for a less "expensive" answer :-)