MickMad
Well-known member
Hello, this topic should contain every useful information about an USB Audio implementation. I'm adding all of my recent work in the field here, as a starting point for everyone.
Teensy 3.0 USB Audio Github repo
In this repo, you'll find modded files from the Teensyduino library, with support for a simple audio device implementation, actually it makes your Teensy result as a mono microphone.
The Readme file on GitHub birefly explains how the code is structured. For a better understanding of what's going on, you should take a look to the USB Audio Class 1.0 specification, with the Formats and Terminal Types docs, USB Specification chapters 5-8-9, and Kinetis K20 datasheet chapter 40. There's also another topic where I started discussing the problems found in the USB "stack" of the Teensy library, I'll try to keep that stuff in that topic because most of it has nothing to do with USB Audio.
WARNING: This stuff modifies your standard Teensyudino library and it's in very early development stage, I strongly suggest to install a fresh copy of Arduino and Teensyduino, and then add the modified code to it.
The end result should be a generic project template to add data to a buffer (on Teensy) to be sent to the PC as a microphone, the opposite for sending audio from the PC to the Teensy as a speaker, and another template for simultaneous output and input.
UPDATE 3/10/2013 15:56 GMT +1:Now the device works in Synchronous Mode, which means that the sample generation is slaved to the USB Start Of Frame clock. The sampling frequency has been updated to 16 KHz, and the bSubFrameSize field in the Type I Format Descriptor has been corrected to 2 bytes;
UPDATE 10/10/2013 02:25 GMT +1:The Teensy USB library has been modded to support buffers bigger than 64 bytes, and the data type stored inside the buffer can be changed (right now it's fixed with a #define to uint16_t). This in turn paved the way to support sampling frequencies bigger than 32 KHz, in fact the library currently handles stereo input at 48 KHz.
Teensy 3.0 USB Audio Github repo
In this repo, you'll find modded files from the Teensyduino library, with support for a simple audio device implementation, actually it makes your Teensy result as a mono microphone.
The Readme file on GitHub birefly explains how the code is structured. For a better understanding of what's going on, you should take a look to the USB Audio Class 1.0 specification, with the Formats and Terminal Types docs, USB Specification chapters 5-8-9, and Kinetis K20 datasheet chapter 40. There's also another topic where I started discussing the problems found in the USB "stack" of the Teensy library, I'll try to keep that stuff in that topic because most of it has nothing to do with USB Audio.
WARNING: This stuff modifies your standard Teensyudino library and it's in very early development stage, I strongly suggest to install a fresh copy of Arduino and Teensyduino, and then add the modified code to it.
The end result should be a generic project template to add data to a buffer (on Teensy) to be sent to the PC as a microphone, the opposite for sending audio from the PC to the Teensy as a speaker, and another template for simultaneous output and input.
UPDATE 3/10/2013 15:56 GMT +1:Now the device works in Synchronous Mode, which means that the sample generation is slaved to the USB Start Of Frame clock. The sampling frequency has been updated to 16 KHz, and the bSubFrameSize field in the Type I Format Descriptor has been corrected to 2 bytes;
UPDATE 10/10/2013 02:25 GMT +1:The Teensy USB library has been modded to support buffers bigger than 64 bytes, and the data type stored inside the buffer can be changed (right now it's fixed with a #define to uint16_t). This in turn paved the way to support sampling frequencies bigger than 32 KHz, in fact the library currently handles stereo input at 48 KHz.
Last edited: