Windows Driver Kit: Audio Devices
Sample AC'97 WDM Audio Driver
Description
This sample driver demonstrates the basics of writing a Microsoft Windows Driver Model (WDM) audio driver.
Theory of Operation
The sample driver should work with any AC'97 codec that is connected to an Intel motherboard with an integrated AC'97 controller (for example, the Intel 810 chipset).
The sample driver supports multi-channel audio and builds a mixer topology to represent the data paths in the AC'97 codec.
You can use this sample driver as a starting point for designing your own, custom AC'97 driver. You can extend the capabilities of the sample driver to support non-AC'97 design features or to convert the driver to use a different DMA engine.
Implementation and Design
- There is no AC'97 implementation available for Alpha or Itanium-based computers. Thus, the Windows Driver Kit (WDK) sample source does not install on Alpha or Itanium-based computers.
- This driver supports the old Intel 810/820/840 implementation as well as the new Intel 815/820 implementation (82801BA/BAM). This new chip set supports multi-channel AC'97 codecs, but the sample driver runs satisfactorily only on codecs that are 100-percent AC'97-compatible. The double-data-rate playback (for example, at 96 kHz) feature is unsupported in those chip sets and therefore unsupported in the driver.
- The AC'97 low-priority microphone recording capability is disabled. You can record by using the microphone just as you would record from any other source (for example, a CD) by using the normal recording selector, but the second recording line that is optionally defined in the AC'97 specification is disabled.
- The AC'97 inputs that are reported to the operating system can be disabled through the INF file. In one section of the INF file, you can disable specific input lines of the codec that are not attached to any adapters.
- This driver works only with Windows 2000 and later and with Windows 98 Second Edition (SE) and Windows Me. This sample will not run or install on the original release of Windows 98.
- Because hardware constrains in the Intel 440MX chip set, the sample driver cannot run reliably on this chip set. Therefore, please do not add Plug and Play (PnP) device-identification strings that contain PCI\VEN_8086&DEV_7195.
Building the Sample
To build this sample, enter any Windows Server 2003 or Windows XP build environment and run build –cZ from the main AC97 sample directory (parent directory). Installation
General
You can use the AC97smpl.inf INF file in this directory to install the sample driver after it has been built. Simply copy the INF and the driver binary to a floppy disk and then update the driver for the device with the one from the floppy. Note that the INF file tries to install the proppage sample and might try to find additional binaries. For more information, see the readme.htm file in the main AC97 sample directory.
After the INF file has installed the driver, you can update and test new versions of the driver by simply copying the driver binary file into the directory %SystemRoot%\system32\drivers on the target machine and rebooting. This technique should be sufficient unless you also make changes to the INF file.
Code Tour
File Manifest
| File | Description |
| ac97reg.h | Definition of the AC'97 registers |
| ac97smpl.inf | Set-up information |
| ac97smpl.rc | Resource file containing version information |
| adapter.cpp | Connects the driver with the system |
| adapter.h | Header file for adapter.cpp |
| common.cpp | Common object used by all miniport drivers |
| common.h | Header file for the common object |
| debug.h | Debug output support |
| guids.h | Private GUIDs used by the driver (name definitions) |
| ichreg.h | Defines the registers of the Intel AC'97 interface |
| ichwave.cpp | Implementation of the stream object (DMA programming) |
| ichwave.h | Header file for the stream object |
| makefile | Make file |
| mintopo.cpp | Implementation of the Topology miniport driver |
| mintopo.h | Header file for the Topology miniport driver |
| minwave.cpp | Implementation of the WavePci miniport driver |
| minwave.h | Header file for the WavePci miniport driver |
| prophnd.cpp | Implementation of the property handler (part of the Topology miniport driver) |
| readme.htm | This sample documentation file |
| shared.h | Header file shared by all C++ source files in this sample |
| sources | Dependency information for compiling |
Build machine: CAPEBUILD