- 8 minutes to read
Windows 10 allows you to write a universal audio driver that works on many types of hardware. This topic discusses the benefits of this approach, as well as the differences between platforms. In addition to the universal Windows drivers for audio, Windows continues to support legacy audio driver technologies such as WDM.
Introduction to universal Windows drivers for audio
IHVs can develop a universal Windows driver that works on all devices (desktops, laptops, tablets, phones). This can reduce development time and costs for initial code development and subsequent maintenance.
These tools are available to develop universal Windows drivers:
Visual Studio 2015: Set Target Platform equal to Universal. For more information on configuring the driver development environment, seeIntroduction to Universal Windows Drivers.
APIValidator tool – You can use the ApiValidator.exe tool to verify that the APIs called by your driver are valid for a universal Windows driver. This tool is part of the Windows Driver Kit (WDK) for Windows 10 and runs automatically when you use Visual Studio 2015. For more information, seeWindows Universal Driver Validation.
DDI Reference Documentation: The DDI Reference Documentation has been updated to indicate which DDIs are supported by Universal Windows drivers. For more information, seeAudio Device Reference.
Create a universal audio driver
For step-by-step instructions, seeIntroduction to Universal Windows Drivers. Here is a summary of the steps:
Load the universal audio sysvad sampler to use as a starting point for your universal audio driver. Alternatively, you can start with the blank WDM driver template and add the sysvad universal sample code as needed for your audio driver.
Set the target platform to "Universal" in the project properties.
Create an installation package: If your target is a device running Windows 10 for desktop editions (Home, Pro, Enterprise, and Education), use a configurable INF file. If your target is a device running Windows 10 Mobile, use PkgGen to generate a .spkg file.
Build, install, deploy, and debug drivers for Windows 10 Desktop or Windows 10 Mobile editions.
Sysvad and SwapAPO have become examples of universal Windows drivers. For more information, seesample audio driver.
Programming interfaces available for universal Windows drivers for audio
Starting with Windows 10, DPIs are part of OneCoreUAP-based editions of Windows. With this common set, you can write a universal Windows driver. These drivers run on Windows 10 Desktop and Windows 10 Mobile editions and other versions of Windows 10.
The following DDIs are available when working with universal audio drivers.
Event sets for audio controllers
audio controller interfaces
Property sets for audio controllers
audio driver structures
Audio Topology Node
High Definition Audio DDI Reference
Audio Driver Reference for Port Class
Convert an existing audio driver to a universal Windows driver
Follow these steps to convert an existing audio driver to a universal Windows driver.
Determine if existing driver calls are running on OneCoreUAP Windows. See the requirements section on the reference pages. For more information, seeAudio Device Reference.
Recompile your driver as a universal Windows driver. Set the target platform to "Universal" in the project properties.
Use the ApiValidator.exe tool to verify that the DDIs called by your driver are valid for a universal Windows driver. This tool is part of the Windows Driver Kit (WDK) for Windows 10 and runs automatically when you use Visual Studio 2015. For more information, seeWindows Universal Driver Validation.
If the driver calls interfaces that are not part of OneCoreUAP, the compiler reports errors.
Replace these calls with workaround calls, workaround code, or write a new handler.
Creating an audio driver installation with components
Divide the driver installation process into the following components for a smoother and more reliable installation and better component maintenance support.
- DSP (if any) and codec
- OEM customizations
Optionally, separate INF files can be used for DSP and codec.
This diagram summarizes a component-based audio setup.
A separate INF extension file is used to customize each core controller component for a specific system. Customizations include tuning parameters and other system-specific settings. For more information, seeUsing an INF file extension.
An INF extension file must be a universal INF file. For more information, seeUsing a universal INF file.
For information on adding software using INF files, seeUsing a component INF filemiDCH design principles and best practices.
Send INF files divided into components
APO-INF packages must be submitted to Partner Center separately from the base driver package. For more information on creating packages, seeIntroduction to Windows HLK.
SYSVAD component INF files
You can find an example of INF files with components in thesysvad/TabletAudioMuestra, not a git hub.
|ComponentizedAudioSample.inf||The basic components display an audio INF file.|
|ComponentizedAudioSampleExtension.inf||Extension driver for basic sysvad with additional OEM settings.|
|ComponentizedApoSample.inf||A sample APO extension INF file.|
The traditional INF files are still available in the SYSVAD sampler.
|tabletaudiosample.inf||A monolithic desktop INF file that contains all the information needed to install the driver.|
APO manufacturer-specific feature configuration and optimization parameters
All APO vendor system-specific settings, parameters, and settings must be installed via an extension INF package. In many cases this is easily possible with theINF AddReg-Directive. In more complex cases, a fitting file can be used.
Basic driver packs should not rely on these customizations to work (although functionality may of course be limited).
UWP Audio Settings Apps
To implement an end user interface, use a hardware application support (HSA) for a universal Windows audio driver. For more information, seeHardware Support Application (HSA) - Steps for Driver Developers.
Programmatic release of UWP hardware support apps
To programmatically launch an app that supports UWP hardware based on a controller event (such as when a new audio device is connected), use the Windows Shell APIs. Windows 10 Shell APIs support a method to launch the UWP UI based on feature activation or directly viaIApplicationActivationManager. For more details on auto-launching UWP apps, seeAutomate the launch of Windows 10 UWP apps.
Using APO Device Drivers and AudioModules API
The Audio Module API/DDI was designed to standardize the communication transport (but not the protocol) for commands passed between a user-mode UWP app or service to a kernel driver module or DSP processing block. . Audio modules require a driver that implements the correct DDI to support module enumeration and communication. Commands are passed in binary and the interpretation/definition is left to the creator.
Audio modules are not designed to facilitate direct communication between a UWP app and APO software running on the audio engine.
For more information on audio modules, seeImplement audio module communicationmiConfiguring and querying audio device modules.
Structure of APO HWID chains
APO Hardware IDs contain standard information and strings defined by the manufacturer.
They are structured as follows:
SWC\VEN_v(4)&AID_a(4)&SUBSYS_ n(4)s(4) &REV_r(4)SWC\VEN_v(4)&AID_a(4)&SUBSYS_ n(4)s(4)SWC\VEN_v(4)&AID_a( 4)
- v(4) is the 4-digit manufacturer's identifier of the APO device. This is managed by Microsoft.
- a(4) is the 4-digit identifier for the APO, defined by the APO provider.
- n(4) is the 4-digit identifier assigned by PCI SIG to the subsystem vendor for the parent device. This is usually the OEM identifier.
- s(4) is the manufacturer-defined 4-digit subsystem identifier for the parent device. Usually this is the OEM product identifier.
Plug and Play INF version and date evaluation for driver update
The Windows Plug and Play system evaluates the driver date and version to determine which driver to install when multiple drivers are present. For more information, seeHow Windows Classifies Drivers.
To enable the use of the latest driver, be sure to update the date and version for each new driver release.
APO driver registry key
For APO/Audio driver registry keys set by third parties, use HKR.
Use a Windows service to facilitate UWP <-> APO communication
A Windows service is not strictly required to manage user-mode components such as APOs. However, if your design includes an RPC server to facilitate UWP <-> APO communication, we recommend implementing this functionality in a Windows service that controls the execution of APO in the audio engine.
Creating Sysvad Universal Audio Sample for Windows 10 Desktop
Follow these steps to build the sysvad sample for the Windows 10 desktop.
Find the desktop INF file (tabletaudiosample.inf) and set the Provider Name to a value such as "Contoso".
In the Solution Explorer, select and hold (or right-click) the "sysvad" solution and select "Configuration Manager". If you are deploying a 64-bit version of Windows, set the target platform to x64. Make sure that the platform configuration and settings are the same for all projects.
Create all the projects in the sysvad solution.
Locate the output directory to create the build. For example, it could be in a directory like this:
C:\Programa (x86)\Windows Kits\10\src\audio\sysvad\x64\Debug\package
Copy the following files to the system where you want to install the sysvad driver:
|TabletAudioSample.sys||The driver file.|
|tabletaudiosample.inf||An information file (.inf) that contains the information needed to install the driver.|
|sysvad.cat||The catalog file.|
|SwapAPO. dll||A sample controller extension for a user interface to manage APO.|
|KeywordDetectorAdapter.dll||An example keyword detector.|
Install and test the driver
Follow these steps to install the driver usingPnpUtilNo target system.
Open an administrator command prompt and type the following in the directory where you copied the driver files.
pnputil -i -a tabletaudiosample.inf
The sysvad driver installation should be complete. If errors occur, you can refer to this file for additional information:
In Device Manager, select Devices by Type from the View menu. In the device tree, locate Microsoft Virtual Audio Device (WDM) - Sysvad Example. It's usually located under the Sound, Video, and Game Controllers node.
On the destination computer, open Control Panel and navigate tohardware and something>Manage audio devices. In the Sound dialog, select the speaker icon labeled "Microsoft Virtual Audio Device (WDM) - Sysvad Sample" and select Set as Default but not OK. This keeps the sound dialog open.
Locate an MP3 or other audio file on the target computer and double-click to play it. Then, in the Sound dialog box, verify that the volume meter associated with the Microsoft Virtual Audio Device (WDM) driver, Sysvad Sample, is active.