Original Post
Hi all,
What is the correct way to convert the performance data given by XAudio2's GetPerformanceData() function to actual time values?
Currently, I'm reading the CPU speed from the registry, which gives me 2814MHz, which is 2814000000 cycles / second.
When I call GetPerformanceData(), the TotalCyclesSinceLastQuery member is set to 1685086 (in this frame) - which works out at 0.0005988 seconds, or 0.5988ms.
However, I know that my game tick takes 66.66ms (Using other timer code, which I know works, and the game "looks" like it's running at 15 FPS), and I call GetPerformanceData once per game tick.
The AudioCyclesSinceLastQuery member is also set to 10639 - which works out at 0.00378ms - which seems awfully low (But might be correct, I'm only playing one 32KHz, 16-bit quad channel voice).
Am I failing at converting from cycles to milliseconds, or does XAudio's "CPU cycles" stuff not actually mean CPU cycles? Or am I only supposed to use the values to find out the fraction of CPU time used on audio?
Cheers,
Steve
P.S. Does anyone with access to Microsoft Code Center Premium know if the XAudio source code is available there? I had a look but didn't see anything, and the search function is useless...
What is the correct way to convert the performance data given by XAudio2's GetPerformanceData() function to actual time values?
Currently, I'm reading the CPU speed from the registry, which gives me 2814MHz, which is 2814000000 cycles / second.
When I call GetPerformanceData(), the TotalCyclesSinceLastQuery member is set to 1685086 (in this frame) - which works out at 0.0005988 seconds, or 0.5988ms.
However, I know that my game tick takes 66.66ms (Using other timer code, which I know works, and the game "looks" like it's running at 15 FPS), and I call GetPerformanceData once per game tick.
The AudioCyclesSinceLastQuery member is also set to 10639 - which works out at 0.00378ms - which seems awfully low (But might be correct, I'm only playing one 32KHz, 16-bit quad channel voice).
Am I failing at converting from cycles to milliseconds, or does XAudio's "CPU cycles" stuff not actually mean CPU cycles? Or am I only supposed to use the values to find out the fraction of CPU time used on audio?
Cheers,
Steve
P.S. Does anyone with access to Microsoft Code Center Premium know if the XAudio source code is available there? I had a look but didn't see anything, and the search function is useless...