Audio is an important feature of many embedded devices. One way to implement audio on an embedded system is to use an audio system on a chip (SoC). In many contexts, the SoC chip is also called a codec. The codec is a microchip dedicated to audio processing that sits between the audio hardware and the CPU. The codec’s main purpose is to convert between analog and digital audio signals. In general, analog signals are used on the audio hardware side, and digital signals are exchanged between the codec and the CPU. Codecs can be fairly complex and may have many different analog inputs and outputs with many possible audio paths. They may also include some audio processing features.
There are usually two main connections between the codec and the CPU: a bus connection and a digital audio interface (DAI). The bus connection is used by the CPU to read and write register values on the codec for configuration. This connection uses a bus protocol such as SPI or I2C for communicating register values. The digital audio interface is for transferring audio data between the CPU and the codec. Different DAI formats require different numbers of pin connections between the CPU and codec.