views:

139

answers:

1

For real-time multimedia tasks the low latency is essential. A stable low latency value makes it possible to use a computer for making music for example.

As far as I know, under Windows systems there's a DPC latency thing that's quite crucial for ensuring the stability of the latency. You can read more about Deferred Procedure Calls here: http://en.wikipedia.org/wiki/Deferred_Procedure_Call.

As you can read on the Thescyon website,

If any kernel-mode device driver in your Windows system is implemented improperly and causes excessive latencies of Deferred Procedure Calls (DPCs) then probably drop-outs will occur when you use real-time audio or video streaming applications.

They provide a simple tool for checking this which draws a latency graph. When you want to test a Windows computer for pro audio, you should run this DPC latency checker and stress the components that could cause problems. For example when I'm testing laptops, I check what happens with the latency when you

  • switch the wireless on-off or use a wireless connection
  • insert a memory card into a card reader
  • adjust the screen brightness (ACPI-related things can cause a real mess...)

and so on.

My question is, what should I do if I want to check the above automatically? I would like to develop a tool which could test this and generate a report, so we could test a lot of configurations in a short time. (My problems: I don't know how to measure DPC latency and how to automate brightness controlling from code etc.)

Background: I bought a laptop that should be fairly ideal for making music - but it's not, since it produces almost irrational latency problems. In fact, I've consulted with the Focusrite support for months and we weren't able to solve the problem. So I want to help musicians in choosing by creating an easy-to-use testing tool which could clearly says if a computer is okay. Or the better, to create an up-to-date public database with DPC latency informations.

Please support this question to raise DPC awareness - we do need to let manufacturers know that this is a real issue for anyone interested in multimedia on Windows systems.

+1  A: 

There are several problems with your Question.

First of all, you cannot really check the DPC latency. You either can queue an own DPC and then check when its executed. Or you can query the time a/all DPCs run (I don't know if you have performance counter information for that, or if have to do sample based profiling).

Even if you have this information, it is very specific to the situation you are in. Furthermore there are several random factors which skew numbers.

A DPC is queued into the global DPC queue, and can be run on any processor. So if you really have a long (-running) DPC on one core, the other core is free to process another. So any timing information is really dependent on the count of processors you have and how many things get currently executed concurrently. So on multicore processors these numbers might vary widely.

Even when you have information about one use case, this is very dependent on the current situation of the system. When its connected to a (large) network, there may be very many small DPCs raised for the network packets that are received by your computer. When you unplug your computer (or everyone goes home) this DPC storm suddenly stops.

NB: When you have a new computer, your DPC latency problem may derive from the c-states your processor sleeps in. The Core-iX processors do really fast into a sleep state from which they wake really slowly.

Christopher
How complicate this issue is... (and somewhat difficult to understand for me). From what you've told, it seems we cannot do a totally precise testing this way. This is a big problem, since (from this point of view) it seems that you need quite a lot of luck to pick a suitable system. It would be nice to have some kind of benchmarking anyway.
Scorchio
What about virtual cores?
endolith