Electrical – Where to begin with programming an audio interface driver

audioccodedriverinterface

I'm designing my own mic/line preamp (the analog portions) and would like to have it interface with a computer in a send-return fashion as well (like any typical audio interface).

I've noticed that Texas Instruments and other manufacturers sell A/D/A converter chips for dirt cheap. However, the missing link would be the driver code to actually have the computer read and interpret the sent bits, as well as send bits back to the device via USB (having the correct USB topology would also be important). I know a bit of C programming, and I've heard that is the language audio drivers are typically created in.

Here are my questions: are there pre-programmed microcontrollers that include all the necessary I/O and driver code for audio-to-computer interfacing? Or can generic driver code be found on a site like GitHub? If not, where do I begin with programming such software? i.e. what to research, what to focus on, etc.

Thanks a lot for your help!

Best Answer

I've noticed that Texas Instruments and other manufacturers sell A/D/A converter chips for dirt cheap. However, the missing link would be the driver code to actually have the computer read and interpret the sent bits, as well as send bits back to the device via USB (having the correct USB topology would also be important).

Um, that's not true. TI, for example, sells several audio DACs/ADCs that out of the box do USB.

You don't have to write any drivers: "sound card" is a specified USB profile, and thus, if the chip doesn't do anything special, all OSes will just out of the box support your device as generic sound card.

are there pre-programmed microcontrollers that include all the necessary I/O and driver code for audio-to-computer interfacing?

Although you don't need that, as explained above, yes, hundreds of such microcontrollers exist. Basically, every sufficiently fast microcontroller that has a USB interface can do that; look for the standard ARM Cortex-M0 or -M4 cores that get sold by ST (STM32F…), NXP, SiLabs, cypress, basically every medium sized to large silicon manufacturer out there. You're looking for a microcontroller that has an integrated USB2 PHY, and something like an I2S port, or sufficient DAC and ADC itself.

Related Topic