dev_composite_cdc_audio_unified
Overview
The Composite CDC and Audio Unified project is a simple demonstration program based on the MCUXpresso SDK.
It is enumerated as a COM port and playback/recording device, which the COM port can be opened using terminal tools, such as TeraTerm.
The purpose of this demo is to show how to build a composite USB device and to provide a simple example for further development.
System Requirement
Hardware requirements
Mini/micro USB cable
USB A to micro AB cable
Hardware (Tower module/base board, and so on) for a specific device
Personal Computer
Software requirements
The project files are in:
<MCUXpresso_SDK_Install>/boards//usb_examples/usb_device_composite_cdc_audio_unified/ / .
For a lite version, the project files are in:
<MCUXpresso_SDK_Install>/boards//usb_examples/usb_device_composite_cdc_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 log can be different for multiple boards.
For detailed instructions, see the appropriate board User’s Guide.
Run the example in Windows OS
The mentioned steps can be different for Playback and Recording settings as per different Windows OS version.
A COM port and a Audio Device is enumerated in the Device Manager.
Switch the terminal window connection to target USB port.
Type some characters, which are echoed back from the COM port.
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 + CDC 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+CDC 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-USB AUDIO+CDC DEMO” as a default device.
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.
Switch to “playback” tab and select the “Speakers” device with the description “USB Audio + CDC 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+CDC 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+CDC 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.
note
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_cdc_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.
*/