Starting with Windows 10, release 1703, a USB Audio 2.0 driver is shipped with Windows. It is designed to support the USB Audio 2.0 device class. The driver is a WaveRT audio port class miniport. For more information about the USB Audio 2.0 device class, see https://www.usb.org/documents?search=&type%5B0%5D=55&items_per_page=50.
The driver is named: usbaudio2.sys and the associated inf file is usbaudio2.inf.
The driver will identify in device manager as 'USB Audio Class 2 Device'. This name will be overwritten with a USB Product string, if it is available.
The driver is automatically enabled when a compatible device is attached to the system. However, if a third-party driver exists on the system or Windows Update, that driver will be installed and override the class driver.
The Universal Serial Bus Logo. USB, short for Universal Serial Bus, is an industry standard developed in the mid-1990s that defines the cables, connectors and communications protocols used in a bus for connection, communication, and power supply between computers and electronic devices. It is currently developed by the USB Implementers Forum. Improvements and fixes. This update includes a fix for an incorrect device driver (“Microsoft – WPD – 2/22/2016 12:00:00 AM - 5.2.5326.4762”) that was released by a third-party on March 8, 2017 that affected a small group of users with USB connected phones or other media devices that rely on Media Transfer Protocol (MTP).
Architecture
Locate the Unknown Device. RELATED: How to Use the Windows Device Manager for Troubleshooting You’ll see information about Unknown Devices in the Device Manager.To open it on Windows 10, 8.1, or 8, right-click in the bottom-left corner of the screen or press Windows Key + X and select Device Manager. On Windows 10, a device driver is an essential piece of code, which allows the system to interact with a specific hardware (such as graphics card, storage driver, network adapter, Bluetooth, etc. If drivers were not downloaded automatically by Windows Update, use Device Manager to refresh the driver from Windows Update, or contact the device manufacturer. I’m Moli, your virtual agent. I can help with Moto phone issues.
usbaudio2.sys fits within the wider architecture of Windows USB Audio as shown.
Related USB specifications
The following USB specifications define USB Audio and are referenced in this topic.
- USB-2 refers to the Universal Serial Bus Specification, Revision 2.0
- ADC-2 refers to the USB Device Class Definition for Audio Devices, Release 2.0.
- FMT-2 refers to the Audio Data Formats specification, Release 2.0.
The USB-IF is a special interest group that maintains the Official USB Specification, test specifications and tools.
Audio formats
The driver supports the formats listed below. An alternate setting which specifies another format defined in FMT-2, or an unknown format, will be ignored.
Type I formats (FMT-2 2.3.1):
- PCM Format with 8.32 bits per sample (FMT-2 2.3.1.7.1)
- PCM8 Format (FMT-2 2.3.1.7.2)
- IEEE_FLOAT Format (FMT-2 2.3.1.7.3)
Type III formats (FMT-2 2.3.3 and A.2.3):
- IEC61937_AC-3
- IEC61937_MPEG-2_AAC_ADTS
- IEC61937_DTS-I
- IEC61937_DTS-II
- IEC61937_DTS-III
- TYPE_III_WMA
Feature descriptions
This section describes the features of the USB Audio 2.0 driver.
Audio function topology
The driver supports all entity types defined in ADC-2 3.13.
Each Terminal Entity must have a valid clock connection in compatible USB Audio 2.0 hardware. The clock path may optionally include Clock Multiplier and Clock Selector units and must end in a Clock Source Entity.
The driver supports one single clock source only. If a device implements multiple clock source entities and a clock selector, then the driver will use the clock source that is selected by default and will not modify the clock selector’s position.
A Processing Unit (ADC-2 3.13.9) with more than one input pin is not supported.
An Extension Unit (ADC-2 3.13.10) with more than one input pin is not supported.
Cyclic paths in the topology are not allowed.
Audio streaming
The driver supports the following endpoint synchronization types (USB-2 5.12.4.1):
- Asynchronous IN and OUT
- Synchronous IN and OUT
- Adaptive IN and OUT
For the asynchronous OUT case the driver supports explicit feedback only. A feedback endpoint must be implemented in the respective alternate setting of the AS interface. The driver does not support implicit feedback.
There is currently limited support for devices using a shared clock for multiple endpoints.
For the Adaptive IN case the driver does not support a feedforward endpoint. If such an endpoint is present in the alternate setting, it will be ignored. The driver handles the Adaptive IN stream in the same way as an Asynchronous IN stream.
The size of isochronous packets created by the device must be within the limits specified in FMT-2.0 section 2.3.1.1. This means that the deviation of actual packet size from nominal size must not exceed +/- one audio slot (audio slot = channel count samples). Download gtsource driver.
Descriptors
An audio function must implement exactly one AudioControl Interface Descriptor (ADC-2 4.7) and one or more AudioStreaming Interface Descriptors (ADC-2 4.9). A function with an audio control interface but no streaming interface is not supported.
The driver supports all descriptor types defined in ADC-2, section 4. The following subsections provide comments on some specific descriptor types.
Class-Specific AS interface descriptor
For details on this specification, refer to ADC-2 4.9.2.
An AS interface descriptor must start with alternate setting zero with no endpoint (no bandwidth consumption) and further alternate settings must be specified in ascending order in compatible USB Audio 2.0 hardware.
An alternate setting with a format that is not supported by the driver will be ignored.
Each non-zero alternate setting must specify an isochronous data endpoint, and optionally a feedback endpoint. A non-zero alternate setting without any endpoint is not supported.
The bTerminalLink field must refer to a Terminal Entity in the topology and its value must be identical in all alternate settings of an AS interface.
The bFormatType field in the AS interface descriptor must be identical to bFormatType specified in the Format Type Descriptor (FMT-2 2.3.1.6).
For Type I formats, exactly one bit must be set to one in the bmFormats field of the AS interface descriptor. Otherwise, the format will be ignored by the driver.
To save bus bandwidth, one AS interface can implement multiple alternate settings with the same format (in terms of bNrChannels and AS Format Type Descriptor) but different wMaxPacketSize values in the isochronous data endpoint descriptor. For a given sample rate, the driver selects the alternate setting with the smallest wMaxPacketSize that can fulfill the data rate requirements.
Type I format type descriptor
For details on this specification, refer to FMT-2 2.3.1.6.
The following restrictions apply:
Format | Subslot size | Bit resolution |
---|---|---|
Type I PCM format: | 1 <= bSubslotSize <= 4 | 8 <= bBitResolution <= 32 |
Type I PCM8 format: | bSubslotSize 1 | bBitResolution 8 |
Type I IEEE_FLOAT format: | bSubslotSize 4 | bBitResolution 32 |
Type III IEC61937 formats: | bSubslotSize 2 | bBitResolution 16 |
Class-Specific AS isochronous audio data endpoint descriptor
For details on this specification, refer to ADC-2 4.10.1.2.
The MaxPacketsOnly flag in the bmAttributes field is not supported and will be ignored.
The fields bmControls, bLockDelayUnits and wLockDelay will be ignored.
Class requests and interrupt data messages
The driver supports a subset of the control requests defined in ADC-2, section 5.2, and supports interrupt data messages (ADC-2 6.1) for some controls. The following table shows the subset that is implemented in the driver.
Entity | Control | GET CUR | SET CUR | GET RANGE | INTERRUPT |
---|---|---|---|---|---|
Clock Source | Sampling Frequency Control | x | x | x | |
Clock Selector | Clock Selector Control | x | |||
Clock Multiplier | Numerator Control | x | |||
Denominator Control | x | ||||
Terminal | Connector Control | x | x | ||
Mixer Unit | Mixer Control | x | x | x | |
Selector Unit | Selector Control | x | x | ||
Feature Unit | Mute Control | x | x | x | |
Volume Control | x | x | x | x | |
Automatic Gain Control | x | x | |||
Effect Unit | – | ||||
Processing Unit | – | ||||
Extension Unit | – |
Additional information on the controls and requests is available in the following subsections.
Clock source entity
For details on this specification, refer to ADC-2 5.2.5.1.
Drivers Dimtech Usb Devices Driver
At a minimum, a Clock Source Entity must implement Sampling Frequency Control GET RANGE and GET CUR requests (ADC-2 5.2.5.1.1) in compatible USB Audio 2.0 hardware.
The Sampling Frequency Control GET RANGE request returns a list of subranges (ADC-2 5.2.1). Each subrange describes a discrete frequency, or a frequency range. A discrete sampling frequency must be expressed by setting MIN and MAX fields to the respective frequency and RES to zero. Individual subranges must not overlap. If a subrange overlaps a previous one, it will be ignored by the driver.
A Clock Source Entity which implements one single fixed frequency only does not need to implement Sampling Frequency Control SET CUR. It implements GET CUR which returns the fixed frequency, and it implements GET RANGE which reports one single discrete frequency.
Clock selector entity
For details on this specification, refer to ADC-2 5.2.5.2
The USB Audio 2.0 driver does not support clock selection. The driver uses the Clock Source Entity which is selected by default and never issues a Clock Selector Control SET CUR request. The Clock Selector Control GET CUR request (ADC-2 5.2.5.2.1) must be implemented in compatible USB Audio 2.0 hardware.
Feature unit
For details on this specification, refer to ADC-2 5.2.5.7.
The driver supports one single volume range only. If the Volume Control GET RANGE request returns more than one range, then subsequent ranges will be ignored.
The volume interval expressed by the MIN and MAX fields should be an integer multiple of the step size specified in the RES field.
If a feature unit implements single channel controls as well as a master control for Mute or Volume, then the driver uses the single channel controls and ignores the master control.
Additional Information for OEM and IHVs
OEMs and IHVs should test their existing and new devices against the supplied in-box driver.
There is not any specific partner customization that is associated with the in-box USB Audio 2.0 driver.
This INF file entry (provided in a update to Windows Release 1703), is used to identify that the in-box driver is a generic device driver.
The in-box driver registers for the following compatible IDs with usbaudio2.inf.
See the USB audio 2.0 specification for subclass types.
USB Audio 2.0 Devices with MIDI (subclass 0x03 above) will enumerate the MIDI function as a separate multi-function device with usbaudio.sys (USB Audio 1.0 driver) loaded.
The USB Audio 1.0 class driver registers this compatible ID with wdma_usb.inf.
And has these exclusions:
An arbitrary number of channels (greater than eight) are not supported in shared mode due to a limitation of the Windows audio stack.
IHV USB Audio 2.0 drivers and updates
For IHV provided third party driver USB Audio 2.0 drivers, those drivers will continue to be preferred for their devices over our in-box driver unless they update their driver to explicitly override this behavior and use the in-box driver.
Audio Jack Registry Descriptions
Starting in Windows 10 release 1703, IHVs that create USB Audio Class 2.0 devices having one or more jacks have the capability to describe these jacks to the in-box Audio Class 2.0 driver. The in-box driver uses the supplied jack information when handling the KSPROPERTY_JACK_DESCRIPTION for this device.
Jack information is stored in the registry in the device instance key (HW key).
The following describes the audio jack information settings in the registry:
<tid> = terminal ID (As defined in the descriptor)
<n> = Jack number (1 ~ n).
Convention for <tid> and <n> is:
- Base 10 (8, 9, 10 rather than 8, 9, a)
- No leading zeros
- n is 1-based (first jack is jack 1 rather than jack 0)
For example:
T1_NrJacks, T1_J2_ChannelMapping, T1_J2_ConnectorType
For additional audio jack information, see KSJACK_DESCRIPTION structure.
These registry values can be set in various ways:
By using custom INFs which wrap the in-box INF for the purpose to set these values.
Directly by the h/w device via a Microsoft OS Descriptors for USB devices (see example below). For more information about creating these descriptors, see Microsoft OS Descriptors for USB Devices.
Microsoft OS Descriptors for USB Example
The following Microsoft OS Descriptors for USB example contains the channel mapping and color for one jack. The example is for a non-composite device with single feature descriptor.
The IHV vendor should extend it to contain any other information for the jack description.
Troubleshooting
If the driver does not start, the system event log should be checked. The driver logs events which indicate the reason for the failure. Similarly, audio logs can be manually collected following the steps described in this blog entry. If the failure may indicate a driver problem, please report it using the Feedback Hub described below, and include the logs.
For information on how to read logs for the USB Audio 2.0 class driver using supplemental TMF files, see this blog entry. For general information on working with TMF files, see Displaying a Trace Log with a TMF File.
For information on 'Audio services not responding' error and USB audio device does not work in Windows 10 version 1703 see, USB Audio Not Playing
Feedback Hub
If you run into a problem with this driver, collect audio logs and then follow steps outlined in this blog entry to bring it to our attention via the Feedback Hub.
Driver development
This USB Audio 2.0 class driver was developed by Thesycon and is supported by Microsoft.
See also
-->Summary
- Opening the device and obtaining WinUSB handle.
- Getting information about the device, configuration, and interface settings of all interfaces, and their endpoints.
- Reading and writing data to bulk and interrupt endpoints.
Important APIs
This topic includes a detailed walkthrough of how to use WinUSB Functions to communicate with a USB device that is using Winusb.sys as its function driver.
If you are using Microsoft Visual Studio 2013, create your skeleton app by using the WinUSB template. In that case, skip steps 1 through 3 and proceed from step 4 in this topic. The template opens a file handle to the device and obtains the WinUSB handle required for subsequent operations. That handle is stored in the app-defined DEVICE_DATA structure in device.h.
For more information about the template, see Write a Windows desktop app based on the WinUSB template.
Note WinUSB functions require Windows XP or later. You can use these functions in your C/C++ application to communicate with your USB device. Microsoft does not provide a managed API for WinUSB.
Prerequisites
The following items apply to this walkthrough:
- This information applies to Windows 8.1, Windows 8, Windows 7, Windows Server 2008, Windows Vista versions of Windows.
- You have installed Winusb.sys as the device's function driver. For more information about this process, see WinUSB (Winusb.sys) Installation.
- The examples in this topic are based on the OSR USB FX2 Learning Kit device. You can use these examples to extend the procedures to other USB devices.
Step 1: Create a skeleton app based on the WinUSB template
To access a USB device, start by creating a skeleton app based on the WinUSB template included in the integrated environment of Windows Driver Kit (WDK) (with Debugging Tools for Windows) and Microsoft Visual Studio.You can use the template as a starting point.
For information about the template code, how to create, build, deploy, and debug the skeleton app, see Write a Windows desktop app based on the WinUSB template.
The template enumerates devices by using SetupAPI routines, opens a file handle for the device, and creates a WinUSB interface handle required for subsequent tasks. For example code that gets the device handle and opens the device, see Template code discussion.
Step 2: Query the Device for USB Descriptors
Next, query the device for USB-specific information such as device speed, interface descriptors, related endpoints, and their pipes. The procedure is similar to the one that USB device drivers use. However, the application completes device queries by calling WinUsb_GetDescriptor.
The following list shows the WinUSB functions that you can call to get USB-specific information:
Additional device information.
Call WinUsb_QueryDeviceInformation to request information from the device descriptors for the device. To get the device's speed, set DEVICE_SPEED (0x01) in the InformationType parameter. The function returns LowSpeed (0x01) or HighSpeed (0x03).
Interface descriptors
Call WinUsb_QueryInterfaceSettings and pass the device's interface handles to obtain the corresponding interface descriptors. The WinUSB interface handle corresponds to the first interface. Some USB devices, such as the OSR Fx2 device, support only one interface without any alternative setting. Therefore, for these devices the AlternateSettingNumber parameter is set to zero and the function is called only one time. WinUsb_QueryInterfaceSettings fills the caller-allocated USB_INTERFACE_DESCRIPTOR structure (passed in the UsbAltInterfaceDescriptor parameter) with information about the interface. For example, the number of endpoints in the interface is set in the bNumEndpoints member of USB_INTERFACE_DESCRIPTOR.
For devices that support multiple interfaces, call WinUsb_GetAssociatedInterface to obtain interface handles for associated interfaces by specifying the alternative settings in the AssociatedInterfaceIndex parameter.
Endpoints
Call WinUsb_QueryPipe to obtain information about each endpoint on each interface. WinUsb_QueryPipe populates the caller-allocated WINUSB_PIPE_INFORMATION structure with information about the specified endpoint's pipe. The endpoints' pipes are identified by a zero-based index, and must be less than the value in the bNumEndpoints member of the interface descriptor that is retrieved in the previous call to WinUsb_QueryInterfaceSettings. The OSR Fx2 device has one interface that has three endpoints. For this device, the function's AlternateInterfaceNumber parameter is set to 0, and the value of the PipeIndex parameter varies from 0 to 2.
To determine the pipe type, examine the WINUSB_PIPE_INFORMATION structure's PipeInfo member. This member is set to one of the USBD_PIPE_TYPE enumeration values: UsbdPipeTypeControl, UsbdPipeTypeIsochronous, UsbdPipeTypeBulk, or UsbdPipeTypeInterrupt. The OSR USB FX2 device supports an interrupt pipe, a bulk-in pipe, and a bulk-out pipe, so PipeInfo is set to either UsbdPipeTypeInterrupt or UsbdPipeTypeBulk. The UsbdPipeTypeBulk value identifies bulk pipes, but does not provide the pipe's direction. The direction information is encoded in the high bit of the pipe address, which is stored in the WINUSB_PIPE_INFORMATION structure's PipeId member. The simplest way to determine the direction of the pipe is to pass the PipeId value to one of the following macros from Usb100.h:
- The
USB_ENDPOINT_DIRECTION_IN (PipeId)
macro returns TRUE if the direction is in. - The
USB_ENDPOINT_DIRECTION_OUT(PipeId)
macro returns TRUE if the direction is out.
The application uses the PipeId value to identify which pipe to use for data transfer in calls to WinUSB functions, such as WinUsb_ReadPipe (described in the 'Issue I/O Requests' section of this topic), so the example stores all three PipeId values for later use.
- The
The following example code gets the speed of the device that is specified by the WinUSB interface handle.
The following example code queries the various descriptors for the USB device that is specified by the WinUSB interface handle. The example function retrieves the types of supported endpoints and their pipe identifiers. The example stores all three PipeId values for later use.
Step 3: Send Control Transfer to the Default Endpoint
Next, communicate with the device by issuing control request to the default endpoint.
All USB devices have a default endpoint in addition to the endpoints that are associated with interfaces. The primary purpose of the default endpoint is to provide the host with information that it can use to configure the device. However, devices can also use the default endpoint for device-specific purposes. For example, the OSR USB FX2 device uses the default endpoint to control the light bar and seven-segment digital display.
Control commands consist of an 8-byte setup packet, which includes a request code that specifies the particular request, and an optional data buffer. The request codes and buffer formats are vendor defined. In this example, the application sends data to the device to control the light bar. The code to set the light bar is 0xD8, which is defined for convenience as SET_BARGRAPH_DISPLAY. For this request, the device requires a 1-byte data buffer that specifies which elements should be lit by setting the appropriate bits.
The application can set this through the user interface (UI), such as by providing a set of eight check box controls to specify which elements of the light bar should be lit. The specified elements correspond to the appropriate bits in the buffer. To avoid UI code, the example code in this section sets the bits so that alternate lights get lit up.
Drivers Dimtech Usb Devices Free
Use the following steps to issue a control request.
Allocate a 1-byte data buffer and load the data into the buffer that specifies the elements that should be lit by setting the appropriate bits.
Construct a setup packet in a caller-allocated WINUSB_SETUP_PACKET structure. Initialize the members to represent the request type and data as follows:
- The RequestType member specifies request direction. It is set to 0, which indicates host-to-device data transfer. For device-to-host transfers, set RequestType to 1.
- The Request member is set to the vendor-defined code for this request, 0xD8. It is defined for convenience as SET_BARGRAPH_DISPLAY.
- The Length member is set to the size of the data buffer.
- The Index and Value members are not required for this request, so they are set to zero.
Call WinUsb_ControlTransfer to transmit the request to the default endpoint by passing the device's WinUSB interface handle, the setup packet, and the data buffer. The function receives the number of bytes that were transferred to the device in the LengthTransferred parameter.
The following code example sends a control request to the specified USB device to control the lights on the light bar.
Step 4: Issue I/O Requests
Next, send data to the device's bulk-in and bulk-out endpoints that can be used for read and write requests, respectively. On the OSR USB FX2 device, these two endpoints are configured for loopback, so the device moves data from the bulk-in endpoint to the bulk-out endpoint. It does not change the value of the data or add any new data. For loopback configuration, a read request reads the data that was sent by the most recent write request. WinUSB provides the following functions for sending write and read requests:
To send a write request
- Allocate a buffer and fill it with the data that you want to write to the device. There is no limitation on the buffer size if the application does not set RAW_IO as the pipe's policy type. WinUSB divides the buffer into appropriately sized chunks, if necessary. If RAW_IO is set, the size of the buffer is limited by the maximum transfer size supported by WinUSB.
- Call WinUsb_WritePipe to write the buffer to the device. Pass the WinUSB interface handle for the device, the pipe identifier for the bulk-out pipe (as described in the Query the Device for USB Descriptors section of this topic), and the buffer. The function returns the number of bytes that are actually written to the device in the bytesWritten parameter. The Overlapped parameter is set to NULL to request a synchronous operation. To perform an asynchronous write request, set Overlapped to a pointer to an OVERLAPPED structure.
Write requests that contain zero-length data are forwarded down the USB stack. If the transfer length is greater than a maximum transfer length, WinUSB divides the request into smaller requests of maximum transfer length and submits them serially.The following code example allocates a string and sends it to the bulk-out endpoint of the device.
To send a read request
Drivers Dimtech Usb Devices Drivers
- Call WinUsb_ReadPipe to read data from the bulk-in endpoint of the device. Pass the WinUSB interface handle of the device, the pipe identifier for the bulk-in endpoint, and an appropriately sized empty buffer. When the function returns, the buffer contains the data that was read from the device. The number of bytes that were read is returned in the function's bytesRead parameter. For read requests, the buffer must be a multiple of the maximum packet size.
Zero-length read requests complete immediately with success and are not sent down the stack. If the transfer length is greater than a maximum transfer length, WinUSB divides the request into smaller requests of maximum transfer length and submits them serially. If the transfer length is not a multiple of the endpoint's MaxPacketSize, WinUSB increases the size of the transfer to the next multiple of MaxPacketSize. If a device returns more data than was requested, WinUSB saves the excess data. If data remains from a previous read request, WinUSB copies it to the beginning of the next read request and completes the request, if necessary.The following code example reads data from the bulk-in endpoint of the device.
Drivers Dimtech USB Devices
Step 5: Release the Device Handles
After you have completed all the required calls to the device, release the file handle and the WinUSB interface handle for the device. For this, call the following functions:
- CloseHandle to release the handle that was created by CreateFile, as described in the step 1.
- WinUsb_Free to release the WinUSB interface handle for the device, which is returned by WinUsb_Initialize.
Step 6: Implement Main
The following code example shows the main function of your console application.
Next steps
Drivers Dimtech Usb Devices Download
If your device supports isochronous endpoints, you can use WinUSB Functions to send transfers. This feature is only supported in Windows 8.1.
For more information, see Send USB isochronous transfers from a WinUSB desktop app.
Related topics
WinUSB
WinUSB Architecture and Modules
WinUSB (Winusb.sys) Installation
WinUSB Functions for Pipe Policy Modification
WinUSB Power Management
WinUSB Functions
Write a Windows desktop app based on the WinUSB template