1

If an application using WASAPI fails to fill an endpoint buffer for an IAudioRenderClient as the playback position reaches that point, what does that do to the result of IAudioClock::GetPosition()? Does it stop at that point or continue to count forward?

I specifically wish to know this to recover from this situation, and keep account of the play position correctly. The ideal specification would be for it to precisely stop at the missing samples so you could resume exactly and easily there. But I can't find that documented anywhere.

iam
  • 1,623
  • 1
  • 14
  • 28
  • From https://learn.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-iaudioclock-getposition: "... into which the method writes the DEVICE position." (emphasis mine). I interpret that to mean the stream will just glitch but that will have no impact on the device position whatsoever. I always thought of the device position as being queried from the hardware/driver level. Would be good if someone from MS could clarify though. – Sjoerd van Kreel Jan 28 '21 at 18:20
  • Ah, just found this https://social.msdn.microsoft.com/Forums/sqlserver/en-US/2f9ec79b-8cc3-4b75-a041-a2847613947e/synchronizing-audio-input-and-output-with-iaudioclockgetposition?forum=windowspro-audiodevelopment in the comments of another post of yours. So that implies it is indeed a driver query. I never had any problems with it though, running a full-duplex stream at 2.7 ms latency, calling GetPosition() at every buffer without glitching. I can only assume GetBuffer and ReleaseBuffer in exclusive mode already mean 2 system calls anyway as the data has to reach the driver anyway. – Sjoerd van Kreel Jan 28 '21 at 19:02

0 Answers0