[wdmaudiodev] Re: Multi-channel audio USB driver development

  • From: Jerry Evans <jerry@xxxxxxxxxxx>
  • To: wdmaudiodev@xxxxxxxxxxxxx
  • Date: Thu, 01 Jul 2010 18:56:49 +0100

Hello Daire

I think you've got a classic need for compromise here :)

Assuming your USB device is playback only ....

Streaming using KS from user mode on XP will give you ~10ms latency (best case) with the XP driver. However I don't think you'll get anything more than stereo working. Not sure the XP class driver groks multi-channel hardware. Certainly did not work back in '05 with custom 6 channel board here. H/W worked with OSX ...

USB performance is, I believe, much better on W7. Recent postings in this group indicated you can reduce USB bus latency to 4ms. Favourite would have to be KS as well for compatibility.

As Tim has pointed out, ASIO4ALL provides an industry standard (and simpler) API for any Windows compatible hardware. Performance is good and Michael may still be amenable to bundling if modestly rewarded. Not sure if XP multi-channel limitations apply as faults we encountered may have been problems with my KS interface.

All of that said, there are a couple of other options. If your hardware uses Cypress parts (for example) you can use their own driver with which you could implement your own device communication. On XP and W2K (why?) you might get better performance than the in-box driver, esp. with multi-channel audio, but probably not on W7. There are also 3rd party USB drivers from outfits like this: http://www.thesycon.de/eng

I'd strongly recommend *not* writing anything from scratch unless you want to turn the project into a career.

Clearly YMMV considerably. It's unclear whether your project is research/commercial/consumer? with your own hardware or third party? level of price sensitivity? All will clearly impact the decision making process.

Finally 20 ms is *not* low latency. It is easily heard when monitoring a recording or playing software instruments.



On 01/07/2010 13:42, Daire O'Neill wrote:
Hi Tim, many thanks for your reply.
ASIO also operates like this for low-latency, does this mean that ASIO
is essentially an audio driver that follows the WDM-KS format?
Well, not really.  ASIO is mostly a user-mode framework.  It allows
applications to bypass the intermediate layers and talk directly to the
manufacturer's audio driver, much like DirectKS.  An ASIO "driver" is a
(thin) user-mode wrapper around an existing kernel-mode driver.  It
would be possible, I suppose, to create a separate kernel-mode driver
that pairs directly with an ASIO driver, but to my knowledge no one does

DirectKS is an API that can be used to write kernel streaming drivers,
with similarly low latency to ASIO.
No.  DirectKS is a user-mode API that allows applications to access
kernel streaming drivers.  It is not used to WRITE kernel streaming drivers.

So, I need to write a "wrapper" around the existing kernel-mode driver
(eg usbaudio.sys), possibly
using the DirectKS API?  How does DirectKS relate to the AVStream class?

The DDK docs mention that WDMAud.sys performs I/O for the WaveIn / Out
APIs, so I can use
those APIs to send audio directly to the driver kernel?

Nothing.  If your device meets USB Audio Class, you don't write
anything.  Microsoft provides usbaudio.sys, and ASIO4ALL provides the
ASIO layer for ASIO applications.
However, doesn't this assume that the end user will have ASIO4ALL installed?
What if I want my hardware to operate independently of ASIO4ALL, then
I need to write a
"wrapper" driver similar to ASIO4ALL, as mentioned above?

USB audio device manufacturers don't write drivers.
Really? Even in the absence of an ASIO4ALL driver on the users PC?
What about for pro-audio products, which is what I am developing for?
For example this company provides their own USB drivers:

I have read the same as what you are saying from the DDK docs:
       "When an audio device identifies itself as USB Audio-compliant
during Plug and Play device enumeration,
  the system automatically loads the USBAudio driver to drive the
device. USBAudio drives the device directly,
  without the aid of a proprietary adapter driver. This means that a
device that complies with the USB audio specifications
requires no proprietary adapter driver."

But, if thats the case, why do companies such as above provide
drivers?  This confuses me, so if you could explain it would be great.

Up to this point, you have not defined what "low latency" means to you.
I'm estimating about 20ms.

Could you recommend the most sensible way to approach writing for multiple OS,
namely Win2K, XP, Vista, 7? I would like to re-use as much code as possible.
Do you think 6 months is a reasonable estimate for development time?

Many thanks, its really appreciated.


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: