Audio
1 Audio Interface Introduction
1.1 Audio Decoder Chip Introduction
As is well known, a processor inside an integrated circuit can only understand binary data. To make it understand external analog signals, an ADC chip is needed to convert analog signals into digital signals. Likewise, if the processor needs to produce sound, the digital signal must be converted to an analog signal, which uses a DAC chip. With the two processes above, the functions of producing and capturing sound can be implemented, but audio signals that are not further processed will definitely sound "harsh" — we also need to add a DSP unit and so on. Since the essence of a CODEC chip capturing sound is sampling, the faster the sampling rate and the larger the sampling depth, the more realistic the sound — that is, what we call "HiFi" audio.
Now that the sound problem is solved, we also want to perform audio effects and volume adjustment, and unify the interface to facilitate development and debugging... To make audio development convenient, a dedicated audio chip that integrates all the above functions was born — the audio codec chip, whose English name is "Audio CODEC". Therefore, when we see the word "CODEC" in phone or computer descriptions, it generally refers to audio codec.
1.2 RK809 Introduction
The core board of the development board already has an RK809 audio decoder chip from Rockchip. RK809 integrates a high-performance 24-bit ADC and a high-performance 24-bit DAC. The recording path consists of a MIC_PGA and an audio ADC. The DAC converts digital signals to analog signals; the Class-AB driver uses a ground-centered structure for headphone applications and has very low THD (-90dB @1KHz@-3dBFS source). At the same time, it integrates a Class-D driver for speaker applications. Speakers and headphones can be used simultaneously. It integrates an I2S interface to communicate with the processor. Its audio processing block diagram is as follows:

RK809 Audio Decoder Chip Configuration Features
| Feature | Description |
|---|---|
| Integrated design | RK809 integrates PMIC and audio codec functions, simplifying hardware design |
| Standard I2S interface | Connects to the host via I2S1_8CH; supports high-quality digital audio transmission |
| Complete audio chain | Supports the full audio input (microphone) and output (headphone/speaker) chain |
| Flexible pin config | Supports multiple pin multiplexing modes to adapt to different PCB layout needs |
| Integrated power mgmt | Built-in LDO provides a stable 3.3V supply for the audio module |
| Configurable parameters | Supports flexible configuration of volume, sample rate, clock frequency, etc. |
| Differential input | Supports differential microphone input to improve audio input quality |
1.3 I2S Bus Introduction
Both I2S and I2C were proposed by Philips. I2S is mainly used to transmit audio data between digital audio devices and between the main controller and an audio CODEC chip.
The I2S interface requires 3–4 signal lines:
- SCK: serial clock signal
- WS: channel select signal
- SD: serial data signal (if both recording and playback are needed, two signal lines — SDO and SDI — are required)
2 Board Location of the Audio Interface

3 Audio Usage — Command-Line Method
3.1 Audio Test Commands
Here we use the dedicated audio debug tools idl_capture and idl_render provided by the OpenHarmony system to test the recording and playback functions.
Commands are as follows:
idl_capture xxx.wav //录制音频保存到文件xxx.wav 中
idl_render xxx.wav //播放xxx.wav音频文件3.2 Functional Demonstration of Audio Testing
First, create a test file in the /data directory:
touch data/test.wavThen execute the command idl_capture data/test.wav to start recording. The process is as follows:



Recording is complete. Next, execute the command to play back the recording idl_render data/test.wav:


