[wdmaudiodev] Re: Timestamp source for KSAUDIO_POSITIONEX

  • From: Eugene Muzychenko <eugene@xxxxxxxxxxxxxx>
  • To: "Bielik, Robert" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Tue, 8 Jan 2013 14:53:08 +0700

Hello Robert,

> The KSAUDIO_POSITIONEX struct contains a TimerFrequency field, I
> suspect that you can use that to specify that information to the
> audio engine.

The problem is that timestamp information seems not to be used by
system audio engine itself. The engine simply provides this
information to WASAPI clients. But MSDN documentation explicitly
mentions QueryPerformanceCounter as the timestamp source so audio
application developer could rely on it and compare timestamps to
QueryPerformanceCounter results to determine position accuracy.

As I understand KSAUDIO_POSITIONEX description, two timestamp values
are intended to calculate position accuracy and avoid errors added by
code execution delays, context switches etc. But WASAPI methods don't
provide both timestamp values; instead, there is only a single
timestamp value. In such case, it is impossible to avoid errors caused
by code execution delays.

So my question is: should each audio driver use
KeQueryPerformanceCounter to generate timestamps?



WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx


Other related posts: