|
|
WDM provides considerable
leverage to audio applications. It provides an audio mixing and resampling
component that runs in kernel mode, known as "KMixer." KMixer facilities
multiclient access to the same hardware and provides the illusion of
limitless audio streams that are mixed in realtime. Due to its layered
architecture, WDM also provides automatic support for the MME and DirectX
APIs. A vendor simply needs to implement a WDM mini-port driver, and
other layers in the system’s driver stack provide MME and DirectX support.
Unfortunately, this power comes at a price. Due to internal buffering
KMixer nominally adds 30 msec of latency to audio playback streams.
(At present, Microsoft does not provide a method to allow host applications
to bypass KMixer.)
WDM Adoption WDM is relatively new to most audio hardware vendors. It
is much more like the NT driver model than the Win9x VxD model. This
means that the many hardware vendors who haven’t yet developed NT drivers
will have to learn new technology in order to support WDM. (Note that
difference between the NT driver model and VxD driver model is the primary
reason for the current dearth of NT drivers, including NT ASIO drivers.
Building a driver for a new platform requires learning the DDK for the
platform, regardless of which API the driver is meant to support or
how crisply defined the API happens to be.) We see the newness of WDM
as an opportunity for the Windows audio community at large. We are at
a point in time where many hardware and software vendors are simultaneously
taking their first serious look at WDM. At times when everybody is "on
the same page" it is easiest focus on working together towards building
the best solutions for everybody. Another opportunity presented by WDM
is its synergy with Win2k. We have already suggested that Win2k is a
more desirable operating system for audio because of its well-bounded
interrupt latency. Win2k also has the benefit of support for advanced
file management such as asynchronous disk I/O. Since Win2k has great
potential for professional audio, and WDM is the driver model for Win2k,
a large trends towards the adoption of WDM seems inevitable.
Is WDM the Answer? The following table places desirable traits of an
idealized audio streaming solution alongside the capabilities of WDM.
| Design Goal
|
Supported
by WDM? |
|
Requires
only a single, well-defined, kernel mode component?
|
Yes. One kernel
mode component provides MME and DirectX support automatically. |
| Works equally
well on Win9x and Win2k? |
Yes. WDM drivers
are source (and often binary) compatible across these 2 operating
systems. |
| Easy to implement? |
Yes. WDM drivers
are designed in a simple mini-port model, where the vendor needs
only to provide details that are specific to their hardware. This
model removes much of the excess "glue code" in building a driver.
|
| Free of political
or legal baggage? |
Yes. WDM has
no baggage. It is a standard technology built into Windows. |
| Provides <
5 msec latency for all hardware and software? |
No. KMixer
adds 30 msec of latency. |
Resolving the Limitations of WDM
Fortunately, the WDM has a provision for driver extensions. The WDM
DDK provides a function named IoRegisterDeviceInterface through which
any kernel mode driver can "advertise" that it has custom behavior.
A user-mode application can then query the system for registered drivers,
and communicate directly with them via the user-mode DeviceIoControl
function by sending I/O controls (IOCTLs).
This mechanism suggests a way to work around the KMixer issue in WDM.
If all hardware vendors can agree on a common set of IOCTLs, and expose
these IOCTLs as standard WDM registered device interfaces, then we have
an ideal solution that all software vendors can use.
A further benefit of IOCTLs is that drivers use them as the underpinnings
of their support for ASIO or EASI user-mode APIs. So a kernel-mode solution
based on IOCTLs will be compatible with existing applications that support
ASIO or EASI. In fact, any hardware vendor who is considering ASIO or
EASI support under Win2k is going to have to build a mechanism like
this anyway.
To summarize, an IOCTL solution provides low-latency audio across the
board for all Windows audio applications. A solution based on WDM plus
IOCTLs has all of the desirable properties mentioned elsewhere in the
paper:
-
Single kernel-mode driver component
-
Usable
within kernel mode as well as user mode
-
Cross platform on Win9x and WinNT
-
Easy
to implement
-
Very
low latency
-
Free of political or legal baggage
|