WASAPI exclusive mode and USB Full Speed Audio

Hi,

I found out that the Windows Audio WASAPI (Exclusive mode) does not work with USB Full Speed Audio. What happens is that if Windows audio decides that the device periodicity is 10ms, only 10ms of data (typically 10 packets) is transferred to the USB device and then 5ms (5 packets) are skipped and then the cycle starts again.

Apparently this is because the exclusive mode is driven by IRP's from USB that are executed only every 15ms. (See some details in discussion here)

Might this be a Windows bug or something specific to the USB hardware..? USB audio is pretty simple from firmware point of view and I don't think this is something that can be fixed on the device. (Isochronous audio advertises always 1ms bInterval).

That doesn't make much sense. Usbaudio keeps two transfers in play continuously, so while it's processing the first, the device is already filling the second.

What I see from the USB audio device side is normally 1 packet per ms when playing audio. When WASAPI exclusive mode is enabled from the application side I see this 10+5 period.

In debugger I can tell that Windows audio still asks for a packet from the application every 1 ms. Packets that arrive to the device show that audio signal is realtime and in sync. Data is just missing for 5ms for every 10ms. Looks like Windows audio misses the isochronous transfer slots and simply drops the packets.
With WASAPI shared mode everything works fine.

So, this is in the output side? Do you have access to a USB protocol analyzer? For USB 2, they aren't terribly expensive. It might show you whether the OUT tokens are actually being issued.

It is entirely unclear to me how this could happen. WASAPI doesn't know anything about USB, and usbaudio.sys doesn't know anything about WASAPI. The interfaces are completely abstract.

I notice you quoted from the [wdmaudiodev] mailing list. That would be the right place to ask questions like this. Several members of the Microsoft audio team participate in that list, and have proven to be extremely helpful.

It's pretty easy to confirm in the device firmware that the OUT packets are simply not coming to the device when the exclusive mode is used. Probably best plan is to reproduce the issue with a 3rd party USB DAC and an USB analyzer to gather a bit more evidence and then post to the mailing list.