The "Audio Position Property" article
(https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/audio-position-property)
says that WaveRT driver can provide position register value directly
as GetPosition result:
===============
Some audio hardware contains a position register to keep track of the
byte offset of the sample currently in each DAC or ADC, in which case
the GetPosition method simply retrieves the contents of the position
register for the appropriate stream.
===============
But in RTAudio streaming from a user-mode client, I often see a
significant difference between WriteOffset/PlayOffset values obtained
by KSPROPERTY_AUDIO_POSITION and retrieved from the position register
immediately before and after KSPROPERTY_AUDIO_POSITION request.
Here are some log fragments (48000 samples per sec, 16 bits, 2
channels, 192 bytes/ms).
Realtek ALC899, Win7 SP1, Realtek HD driver 6.0.1.8166:
=========================================
Capture
Audio hw latency: FifoSize=0, ChipsetDelay=0, CodecDelay=4
Position register: width: 32, accuracy: 0
PRB=1188, PO= 992, WO= 992, PRA=1188
PRB=2112, PO=1916, WO=1916, PRA=2112
PRB=2404, PO=2208, WO=2208, PRA=2404
PRB=2688, PO=2492, WO=2492, PRA=2688
PRB=2972, PO=2776, WO=2776, PRA=2972
PRB= 320, PO= 128, WO= 128, PRA= 324
PRB=3268, PO=3072, WO=3072, PRA=3268
PRB=3556, PO=3360, WO=3360, PRA=3556
PRB= 36, PO=3936, WO=3936, PRA= 36
PRB=3836, PO=3640, WO=3640, PRA=3836
PRB= 612, PO= 416, WO= 416, PRA= 612
PRB= 900, PO= 704, WO= 704, PRA= 900
Render
Audio hw latency: FifoSize=0, ChipsetDelay=0, CodecDelay=4
Position register: width: 32, accuracy: 0
PRB=1088, PO=1088, WO=1088, PRA=1088
PRB=1384, PO=1384, WO=1384, PRA=1388
PRB=1672, PO=1672, WO=1672, PRA=1676
PRB=1960, PO=1964, WO=1964, PRA=1964
PRB= 224, PO= 224, WO= 224, PRA= 228
PRB=2248, PO=2248, WO=2248, PRA=2252
PRB=2536, PO=2536, WO=2536, PRA=2540
PRB=2824, PO=2828, WO=2828, PRA=2828
PRB=3752, PO=3752, WO=3752, PRA=3756
PRB=4040, PO=4040, WO=4040, PRA=4040
PRB= 520, PO= 524, WO= 524, PRA= 524
PRB= 808, PO= 808, WO= 808, PRA= 812
=========================================
VMWare Workstation 12.5.8 VM, VMWare HD Controller, Win10 16299,
Microsoft HD driver 10.0.16299.15:
=========================================
Capture
Audio hw latency: FifoSize=0, ChipsetDelay=250, CodecDelay=3125
Position register: width: 32, accuracy: 120
PRB=2048, PO= 0, WO=3976, PRA=4096
PRB=2048, PO=2048, WO=1928, PRA=4096
PRB=4096, PO= 0, WO=3976, PRA=2048
PRB=4096, PO= 0, WO=3976, PRA=4096
PRB=4096, PO=2048, WO=1928, PRA=2048
Render
Audio hw latency: FifoSize=0, ChipsetDelay=250, CodecDelay=3125
Position register: width: 32, accuracy: 192
PRB=2048, PO= 0, WO= 192, PRA=4096
PRB=2048, PO=2048, WO=2240, PRA=2048
PRB=4096, PO= 0, WO= 192, PRA=2048
PRB=4096, PO= 0, WO= 192, PRA=4096
=========================================
Realtek HD driver on render, and Microsoft HD driver on both capture
and render, report in KSPROPERTY_AUDIO_POSITION the same play offset
as position register value.
But Realtek HD driver on capture reports play offset 196 bytes less
than position register value.
Is such behavior expected, or Realtek HD driver (and every other one)
must report in KSPROPERTY_AUDIO_POSITION the same play
offset as present by position register value?
******************
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
URL to WDMAUDIODEV page:
http://www.wdmaudiodev.com/