dev_composite_hid_audio_unified#
Overview#
The USB Composite HID and Audio Unified application is a simple demonstration program based on the MCUXpresso SDK. It is enumerated as a playback and recording device. Users can record the sound from this device via the “Sound Recorder” in the Windows Accessories and play music with the device.
System Requirement#
Hardware requirements#
Mini/micro USB cable
USB A to micro AB cable
Specific hardware which has codec presented
Personal Computer
Software requirements#
The project files for the lite version example are in:
<MCUXpresso_SDK_Install>/boards//usb_examples/usb_device_composite_hid_audio_unified_lite/ / .
The project files for a non-lite version example are in:
<MCUXpresso_SDK_Install>/boards//usb_examples/usb_device_composite_hid_audio_unified/ / .
The
is Bare Metal or FreeRTOS OS.
Getting Started#
Hardware Settings#
Set the hardware jumpers (Tower system/base module) to default settings.
Prepare the example#
Connect a USB cable between the PC host and the debugger USB port on the board to provide power supply (the example is self-powered).
Download the program to the target board via IDE.
Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
Connect a USB cable between the PC host and the USB device port on the board.
Demo start log is printed, note that the button name can be different for multiple boards.

For detailed instructions, see the appropriate board User’s Guide.
Run the example in Windows#
The mentioned steps can be different for Playback and Recording settings as per different Windows OS version.
For the Audio recorder, a USB AUDIO+HID DEMO device is enumerated in the Device Manager.

Open the COM port in a terminal tool, such as the Putty.
Right click on the sound control icon in the Start bar (near the clock) and select “Recording devices”.

In the opened window, select the “Microphone” device with the description “USB Audio + HID Demo” and click on the “Properties” button.

In the new window, go to “Levels” tab, move the slide until 100%, and click on “OK”.

Ensure that the selected “Microphone-USB AUDIO+HID DEMO” is display as Default device if no other microphone device supported by the Windows system. If it’s not mention as default device then click on the “Set default” option to make “Microphone-AUDIO+HID DEMO” as a default device.

Use the board specific hardware to record. For the boards which have SGTL board, plug in the line cable into slot J9 on SGTL board and connect the other end into PC or mobile phone.
Open the “Sound Recorder” application and record audio about 5-10 seconds.
After recording, open the recorder file with any media player and verify it by listening on the speaker of Laptop/PC.
In the opened window, select the “Speakers” device with the description “USB Audio + HID Demo” and click on the “Properties” button.

In the new window, go to “Levels” tab, move the slide until 100%, and click on “OK”.

Ensure that the selected “Speakers-USB AUDIO+HID DEMO” is display as Default device if no other speaker device supported by the Windows system. If it’s not mention as default device then click on the “Set default” option to make “Speakers-USB AUDIO+HID DEMO” as a default device.

Connect the earphone/headphone at Audio Line Out port of target board. Open the Window Media Player application, select, and play your favorite song. Check that recorded audio is audible in the connected earphone/headphone at Audio Line Out port of target board.
Use the mute/unmute button shown in the debug console’s print information to mute/unmute speaker, it only control the speaker.
note
On some platforms, the recorder may have noise since the audio clock and USB SOF are not synchronized, this problem only happens on Windows but not on Mac OSX since the latter uses unified engine.
USB audio class 2.0 is enabled by default.
Based on the USB spec, the feedback endpoint data length should be 3 bytes if the device is full speed. In this case, device can work on Mac OS. However, device can not work on Win 10 and feedback data length must be set 4. There is a workaround to fix this issue, please open the macro USB_DEVICE_WORKAROUND_AUDIO_20_WINDOWS when meets the following conditions:
- USB device is full speed and USB audio class 2.0 is enabled.
- USB device uses feedback endpoint.
- USB host is Windows 10.When device functionality is changed, such as USB auido class 2.0 or UAC 5.1, please uninstall the previous PC driver to make sure the device with changed functionality can run normally.
For the dev_composite_hid_audio_unified_lite_bm.bin, if it uses feedback endpoint, it can not work on Windows 10 if the speed mode is full speed, please run it on Linux or Mac OS.
For IP3511HS in high speed mode, microframe can not be obtained and only for frame, the used feedback solution requires us to have to use larger latency and buffer size to avoid buffer overflow or underflow. Sync mode can use low latency (<1ms) even if on IP3511HS.
If you’re having audio problems on Windows 10, please disable signal enhancement if it is enabled and have a try again.

Supported Boards#
MIMXRT685-AUD-EVK
Getting Started
Hardware Settings
Note that the recorder audio is from In-Line Jack.
FRDM-IMXRT1152
Getting Started
Hardware Settings
Remove R183, R131, R151, R177, R124.
LPCXpresso55S36
Getting Started
Hardware Settings
The Jumper settings:\n Short JP73 2-3, JP72 2-3, JP50 1-2, JP53 1-2. Remove resistor between BH20 and BH21, Short BH19 and BH20. Remove resistor between BH23 and BH24, Short BH22 and BH23.
MIMXRT1180-EVK
Getting Started
Hardware Settings
Since GPIO_BUTTON (SW8) shares the same pin with HP_DET, GPIO_BUTTON (SW8) may not be available when connecting the audio jack (J101).
EVK-MIMXRT595
Getting Started
Hardware Settings
Jumper settings for evkmimxrt595 REV.A is : JP7, JP8, JP27, JP28, JP29 1-2 connected.
EVK-MIMXRT685
Getting Started
Hardware Settings
Jumper settings for evkmimxrt685 REV.E is : J7-1 <–> J7-2, J8-1 <–> J8-2.
Note that the recorder audio is from In-Line Jack.
RD-RW612-BGA
Getting Started
Hardware Settings
Please remove the resistor R520 and weld the resistor R518 to make sure the SW4 can work.
Connect JP50; Disconnect JP9, JP11.
If board is V4, also need to connect JP51.