[wdmaudiodev] Re: usbaudio 4ms in Vista / Win7 myth?

  • From: DJ Sisolak <dsisolak@xxxxxxxxxxxxxxxxxxxxxx>
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Mon, 26 Oct 2009 18:31:42 -0700

This is not a Myth for Vista Gold. The driver did send 4ms requests in this OS 
release. The problem was that the extra DPC time required to service the extra 
requests was deemed as a performance hindrance and vendors requested that the 
original 10ms request size from XP be restored. This was done in the ensuing 
service pack (I believe it was SP1). The 10ms request was selected because it 
matched the engine cadence and thus was the most efficient number for the 
driver to use for the most common uses of audio capture, being usually webcams 
and messenger type applications. Windows 7 however, has a means to set the 
request size down to 3ms or any value between 3 and 10ms. There is a new 
Property that can be sent to the driver pin: KSPROPERTY_AUDIO_BUFFER_DURATION 
(see MSDN http://msdn.microsoft.com/en-us/library/ee220334.aspx). The caveat 
being that you will sacrifice CPU time for latency. This value is also used in 
the audio engine to match the exclusive mode period to the packet request count 
as closely as possible in this same range.

Thx,
DJ

This posting is provided "AS IS" with no warranties, and confers no rights.


From: wdmaudiodev-bounce@xxxxxxxxxxxxx 
[mailto:wdmaudiodev-bounce@xxxxxxxxxxxxx] On Behalf Of Matt Gonzalez
Sent: Sunday, October 25, 2009 7:45 PM
To: wdmaudiodev@xxxxxxxxxxxxx
Cc: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Re: usbaudio 4ms in Vista / Win7 myth?

I suspect that the 10 msec number is due to both the XP and Vista audio mixers 
running at a 10 msec native buffer size.

Matt

On Oct 23, 2009, at 10:07 AM, First Last 
<molley45@xxxxxxxxx<mailto:molley45@xxxxxxxxx>> wrote:
Hi,

I have an USB Audio Class device, which I've been using on XP x64 with 
usbaudio.sys and the asio4all driver.  I've been using usbtrace to look at the 
actual packets to try and determine the actual latencies.

It seems usbaudio.sys always asks for 10 packets at a time (i.e 10ms of data) 
from the IN endpoint, however, when using the asio4all driver I see that 
usbaudio can send as little as 1ms at a time, which is great.  I understand 
that usbaudio is still usb 1.0, so anything less than 1ms is not possible given 
that it cannot support any interval other than 1 (meaning only frames, no 
microframes for packets).

So I have a couple questions regarding this...

1) Why 10ms only for the input stream?  If you take into consideration the 
round trip latency 10ms input + ~2ms audio processing + 1ms output + (whatever 
time it actually takes to go up and down the stack), that's like at least 15ms 
in a best case scenario with usbaudio, no? more?  Anyone who plays an 
instrument, even someone who doesn't know how long 15ms is or how many feet 
from the speakers that equates to will tell you "that doesn't feel right".  Why 
so much latency on the input stream?

2) I've heard rumors that in Vista / Win7, that it uses packets in groups of 4 
instead of 10, or 4ms at a time.  How do you get this elusive number?  I have a 
Win7 test machine here, and darned if it doesn't still ask for 10 packets / ms 
at a time.  Is 4ms a myth?  How is the NumberOfPackets determined?  Is it 
determined at the kernel level? in usbaudio? or perhaps even in the descriptors 
of the device?  Or is it enforced by DirectSound, or I suppose DirectKS or 
WaveRT when using ASIO?  How do I get that magic number?

Any suggestions welcome, thanks.


Other related posts: