Microsoft Virtual Audio Device (MSVAD) Driver

SUMMARY

This is a collection of sample drivers that demonstrate the basics of writing a WDM audio driver. All the sample drivers use the same "virtual audio device" instead of an actual hardware-based adapter. Each of these samples highlights a different aspect of the WDM audio driver architecture.

This sample collection uses a step-by-step approach to implementing a variety of WDM audio driver features. Each feature is implemented as a separate driver that uses the common classes and services that are implemented in the msvad root directory. Driver developers can use the same framework to implement new features without concern for hardware dependencies. The framework includes implementations of the following interfaces:

·         The CAdapterCommon interface gives the miniports access to virtual mixer hardware. It also implements the IAdapterPowerManagement interface.

·         The CMiniportTopologyMSVAD interface is the base class for all sample topologies. It has very basic common functions. In addition, this class contains common topology property handlers.

·         The CMiniportWaveCyclicMSVAD interface is the base class for all sample wave miniport drivers. It has very basic common functions such as property handlers.

·         The CMiniportWaveCyclicStreamMSVAD interface is the base class for all sample wave streams. It implements a timer-based interrupt mechanism to simulate DMA interrupts. Its implementation of the IDmaAdapter interface uses programmed I/O instead of DMA to copy data to memory.

The following table shows the features that are implemented in the various subdirectories of this sample.

Subdirectory

Description

simple

Basic driver with waveCyclic and topology ports.

multistr

Implements multiple playback streams.

drmsimp

Implements DRM for simple.

drmmult

Implements DRM for multistr.

pcmex

Implements WAVEFORMATEXTENSIBLE pins.

ac3

Implements AC3 pins for playback.

ds2dhw

Implements DirectSound 2D hardware support.

 

BUILDING THE SAMPLE

To build this sample, start the DDK build environment and run the build command from this directory.

The sample must be manually installed.  It can be installed via the devcon.exe tool, which is available as a free download from http://support.microsoft.com/kb/311272, or it can be installed programmatically via a third-party setup application.  The Add New Hardware wizard is no longer supported in Windows 7.

Devcon source code is also included elsewhere in the WDK as a sample.

DRIVER ISSUES

No known issues

CODE TOUR

File Manifest

File           Description
 
adapter.cpp    Connects the driver to the system
basedma.cpp    IDmaChannel implementation
basetopo.cpp   Base topology class implementation
basetopo.h     Base topology class definition
basewave.cpp   Base waveCyclic class implementation
basewave.h     Base waveCyclic class definition
common.cpp     Common object used by all miniport drivers
common.h       Header file for the common object
hw.cpp         Hardware abstraction of MSVAD
hw.h           Hardware class definition
kshelper.cpp   Kernel streaming utility function implementations
kshelper.h     Kernel streaming utility function definitions
msvad.h        Common definitions
msvad.inf      Installation INF file for this sample
msvad.rc       Common resource file
readme.htm     The documentation for this driver (this file)
savedata.cpp   Writes PCM data to disk
savedata.h     Definition of CSaveData class
sources.inc    Common sources file included by all sample drivers
 

Top of page

 

 

© 2004 Microsoft Corporation