Multi-channel audio USB driver development

Hi all,

I just joined the forum as I am looking for some information on audio
driver development. I have searched
the archives and WDK docs but can’t find a clear answer so I hope you
guys can help. I have experience
in application programming in C, but have never written a driver.

I want to develop a low-latency, multi-channel audio driver for a USB
connected hardware device.
The device will stream up to 16 (if possible) channels of audio from a
PC’s USB port, out to the
connected hardware. I need to develop a driver(s) that is compatible
with Win2K, XP, Vista and 7.

As there seem to be many audio driver models and APIs, my head is
spinning a little.
This is what I have learned from my research so far - please correct
me if I am wrong!

WDM is a standard format for writing drivers. So audio drivers written
in this format may access audio
APIs such as DirectSound or MME. Later versions of DS support
multi-channel audio.

WDM-KS means that no APIs such as these are used, the application can
stream straight to the drivers kernel.

ASIO also operates like this for low-latency, does this mean that ASIO
is essentially an audio driver that follows the WDM-KS format?

DirectKS is an API that can be used to write kernel streaming drivers,
with similarly low latency to ASIO.

WDM is an older format, and so the WDF model should be followed for OS
that support it (Vista, 7).

For a USB audio driver, the AVStream class should be used. Portcls.sys
and the newer WaveRT are for PCI devices only.

->So for example, if I want to develop an ASIO spec driver (ie that will
be loaded from the hardware upon plugging it into the USB port, and
multi-channel low latency streaming), but “there is already an ASIO
driver for USB audio devices”, then what do I need to write?

What type of driver do other manufacturers of hardware interfaces
typically implement? Do they need to pay licenses to Steinberg for
using ASIO?
Also, what is a typical development time for such a driver? If anybody
can provide an estimate for this, I would really like to hear it. Is 6
or so for development and testing a reasonable guess? Bear in mind
that I have never written a driver before.

Sorry for the long post and so many questions, essentially it comes
down to this - what is the simplest approach for developing my driver,
so it can work at low latency across multiple versions of Windows? If
anybody can provide advice about where to start, it would be really,
really appreciated.

Many thanks,

Daire O’Neill

I’m not a programmer myself, but it’s my understanding that writing good drivers is a rather specialised field. I would expect that very few, if any, of users of this forum will have any experience in this. If you don’t get much response here you could try writing directly to the developers mailing list ( )

16 channels over USB is probably pushing the limits a bit far. Most manufacturers switch to Firewire or other interfaces beyond 8 channels. It’s not that USB cannot handle the bandwidth, it’s that USB was never designed to handle high continuous bandwidth. The available bandwidth over USB is processor dependant, so unless you are using extremely large buffers (which will make the latency unreasonably slow for most applications) the audio stream is likely to be constantly dropping out every time the processor has to do something else.

For low latency on Windows, ASIO is probably the way to go, though well written kernel-streaming WDM drivers are also capable of very good performance (Example of high performance ks-WDM drivers: )

I may be wrong, but I thought that drivers were written for specific hardware and that virtually all sound card manufacturers provided Windows compatible drivers for their hardware, so I’m a little confused as to why you are wanting to write drivers, unless you are chasing the elusive (mythical?) “multi-channel soundcard out of el-cheapo consumer cards”

USB has isochronous transfers specifically for things like audio and video that have a fixed bandwidth. The bandwidth for these devices is reserved when they are plugged in and can’t be used by anything else, so there are no dropouts. You’d definitely need USB 2.0 for 16 channels, though. It should be able to handle hundreds of channels of CD quality audio

unless you are chasing the elusive (mythical?) “multi-channel soundcard out of el-cheapo consumer cards”

To do this right, you need to sync the hardware clocks with each other or they’ll drift out of sync with each other over time. ALSA in Linux can do it without any special drivers.

Hello Darasan,

I’m also researching the same things as you are, and experiencing the lack of resources
on windows drivers. Also Just starting out in this field(internship).

I’m trying to develop a MC hardware interface via USB. It would be 16 stereo in and 16 stereo out.
I’m trying to figure out if the standard USB audio driver is useable so that no extra driver needs to be installed
by the user(and i don’t have to write one). By classifying a device as audio device the audio class driver can be used.

How far along with your project are you now?
Maybe we can help eachother along the way? :smiley: