Dai: digital audio interfaces (audio device hardware interface)

Source: Internet
Author: User

1 PCM Interface
For different digital audio subsystems, there are several microprocessor or interfaces used for digital conversion between DSP and audio devices. The simplest audio interface is the PCM (pulse Coding Modulation) interface, which consists of Clock Pulse (bclk), frame synchronous signal (FS), and receive data (DR) and data transmission (dx. On the rising edge of the FS signal, the data is transmitted from MSB (most
Significant Bit). The FS frequency is equal to the sampling rate. After the FS signal starts data word transmission, a single data bit is transmitted in order, and one data word is transmitted in one clock cycle. When MSB is sent, the signal level is first minimized to avoid MSB loss when interfaces of different terminals use different data solutions.
The PCM Interface is easy to implement. In principle, it can support any data scheme and any sampling rate, but each audio channel needs to obtain an independent data queue.
2. IIS interface (I2S Interface)
In 1980s, the IIS interface (Inter-IC Sound) was first used by Philips to consume audio.
In the clock signal mechanism, the two audio signals are converted into a single data queue. When the lrclk is high, the left-channel data is transmitted; when the lrclk is low, the right-channel data is transmitted. Compared with PCM, IIS is more suitable for stereo systems. For multi-channel systems, it is also possible to execute several data queues in parallel under the same bclk and lrclk conditions.
3 ac97 Interface
AC '97 (audio codec 1997) is an Intel-led five PC vendor, Intel and creative
Specification standards jointly proposed by labs, NS, analog device, and Yamaha. Unlike PCM and IIS, ac'97 is not only a data format, but also an Internal Architecture Specification used for Audio Encoding. It also has control functions. AC '97 is connected to external codecs using AC-link. The AC-Link interface includes bitclk and sync) and Data queues that are decoded from the encoding to the processor and from the processor (sdatdin and sdataout. The ac'97 data frame starts with a sync pulse, including 12 20-bit time periods (time periods are different destination services defined in the standard) and 16-bit "tag" segments, A total of 256 data sequences. For example, the time periods "1" and "2" are used to access the control registers of the encoding, while the time periods "3" and "4" load the Left and Right audio channels respectively. The "tag" segment indicates which of the other segments contains valid data. Dividing frames into time periods makes it possible to transmit control signals and audio data only through four wires to reach 9 audio channels or convert them into other data streams. Compared with the IIS solution with the separation control interface, ac'97 significantly reduces the total number of pins. Generally, the ac'97 decoder adopts the tqfp48 encapsulation.

PCM also supports time division multiplexing (TDM) in that several devices can use the bus simultaneously (this is sometimes referred to as network mode ).

ASLA-advanced sound Linux architecture

OSS-previous Linux audio architecture, replaced by ASLA and compatible


I2S/PCM/ac97-codec and audio communication protocol/interface/bus between CPU

Dai-digital audio interface is actually I2S/PCM/ac97

DAC-digit to analog conversion

ADC-analog to digit Conversion

DSP-Digital Signal Processor

Mixer-mixer, which combines several audio analog signals from different channels into one analog signal

Mute-cancel voice and shield Signal Channels

PCM-pulse code modulation is a technology that converts analog audio signals to digital signals. It is different from PCM audio communication protocol.

Sampling frequency-ADC frequency, the number of samples per second, typical value such as 44.1 kHz

Quantization accuracy-for example, 24bit, equals the audio analog signal to the power of 24 in 2

SSI-serial Sound Interface

Dapm-Dynamic Audio Power Management

Codec processes Audio Information, including ADC, DAC, mixer, DSP, input/output, and volume control.

Codec communicates with the processor through the I2C bus and the digital audio interface Dai.

I2C bus-reads and writes codec register data.

Dai-implements communication between the CPU and codec for audio data.

Codec is used as the research object. Its input includes mic (MICROPHONE) and phonein telephone signals, and the output includes headset HP (headphone), speaker and phoneout telephone signals. In addition, you must note that there are Audio Digital Signal Input and Output between codec and CPU.

1) Play Music


2) Recording


3) telephone

--- Call --- answer ---

4) call through Bluetooth

--- Call --- answer ---



2. System Architecture

The android audio system has a relatively standard and sound architecture, from the upper-layer application, Java Framework Service audiomananger, Local Service audioflinger, abstraction layer alsahal, local library, call the external support library of ALSA-lib of external, and finally the codec of the underlying driver ".

The following uses the system to start auidoflinger as an example to describe the organizational structure of ALSA sound.

The Java service audiomanager serves as the server, and the local service audioflinger serves as the client. The two interact through the Binder Mechanism. Audioflinger handed over the hardware abstraction layer alsahal to implement hardware functions (such as setting the phone/Bluetooth/recording mode in setmode. The abstraction layer can call local standard interfaces, such as masladevice-> route, or directly call the Alsa-lib library to operate on the underlying driver.


The audio driver structure in Linux is relatively complex. The source code is located in the/sound/soc/directory of the kernel, where the/codec folder stores the platform-independent codecs driver, the/IMX folder is stored in the Freescale IMX platform-related audio drivers, which can be divided into SSI drivers and Dai drivers.

Starting with the data structure driven by sound cards,

1) struct snd_soc_codec-implemented by a platform-independent codec driver.

2) struct snd_soc_platform-implemented by the Dai driver related to The IMX platform, mainly implementing the DMA transmission function of audio data.

3) struct snd_soc_dai_link-associate platform-related Dai with platform-independent codec.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.