Automatic DPC Delay Testing - How?

For real-time multimedia tasks, low latency is important. A stable value of low latency allows you to use a computer to create music, for example.

As far as I know, on Windows systems there is a DPC delay function, which is crucial to ensure latency stability. You can learn more about deferred procedure calls here: http://en.wikipedia.org/wiki/Deferred_Procedure_Call .

As you can read on Thescyon's website ,

If any kernel-mode device driver on your Windows system is improperly implemented and causes excessive delay in delayed procedure calls (DPC), then it will probably happen if you use real-time audio or video stream applications.

They provide a simple tool for checking this, which draws a delay graph. If you want to test a Windows computer for professional audio, you must run this DPC delay check and highlight the components that can cause problems. For example, when I test laptops, I check what happens with a delay when you

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

etc.

My question is: what should I do if I want to check this automatically? I would like to develop a tool that could test this and create a report so that we can test many configurations in a short time. (My problems: I don't know how to measure DPC delay and how to automate brightness control from code, etc.)

Reference Information. I bought a laptop that should be perfect enough for making music, but that’s not the case, since it causes almost irrational problems with latency. In fact, I consulted with Focusrite support for several months, and we could not solve the problem. Therefore, I want to help musicians in their choice by creating an easy-to-use testing tool that could clearly say that the computer is in order. Or, better, create a state-of-the-art public database with DPC latency information.

Please support this question to increase awareness of DPC - we need to inform the manufacturers that this is a real problem for anyone interested in multimedia on Windows systems.

+4
source share
2 answers

There are several issues in your Question.

First of all, you cannot check the DPC delay. You can either queue your DPC and then check when it is done. Or you can request the execution time of all / DPCs (I don’t know if you have information about the performance counter for this or if you need to perform profiling on a sample).

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

DPC is queued in the global DPC queue and can be run on any processor. Therefore, if you really have a long (-controlled) DPC on one core, another core can handle another. Thus, any time information really depends on the number of processors that you have, and how many things are currently running at the same time. Thus, on multi-core processors, these numbers can vary greatly.

Even when you have information about one use case, it very much depends on the current situation in the system. When it is connected to a (large) network, there can be a lot of small data centers raised for the network packets that are received by your computer. When you turn off your computer (or everyone goes home), this flurry of DPC suddenly stops.

Note. When you have a new computer, your DPC delay problem may arise from the c-states in which your processor is sleeping. Core-iX processors really quickly go into a state of sleep, from which they wake up very slowly.

+4
source

Also check out http://www.resplendence.com/latencymon as it helps you better find the source of the problems.

As indicated in another answer, a modern processor uses several complicating technologies, namely a variety of c-states, as well as hyperthreads.

+1
source

Source: https://habr.com/ru/post/1311082/


All Articles