Audio Driver HAT
| ||
Overview
Version Description
- V2: Compatible with RDK X3 V1.2 / V2.1, RDK X3 MD, RDK X5
Introduction
This is an audio module designed for Sunrise X3 PI, using the ES7210 high-performance four-channel encoding chip and the ES8156 high-performance stereo audio decoding chip. It is controlled via the I2C interface and transmits audio through the I2S interface. The board features a standard 3.5mm headphone jack, allowing external headphones to play music. Four high-quality MEMS silicon microphones are placed at the four corners of the board for stereo recording.
Features
- Supply voltage: 3.3V
- Audio encoding chip: ES7210
- Audio decoding chip: ES8156
- Control interface: I2C
- Audio interface: I2S
- ADC SNR: 102dB
- DAC SNR: 110dB
Hardware Connection
| Function Pin | X3_Pi Pin (BCM) | Description |
| 3.3V | 3.3V | Power Positive (3.3V Power Input) |
| GND | GND | Ground |
| SDA | P2 | I2C Data Input |
| SCL | P3 | I2C Clock Input |
| MCLK0 | P4 | I2S0 Master Clock Input |
| BCLK0 | P18 | I2S0 Bit Clock Input |
| LRCLK0 | P19 | I2S0 Sub-frame (Frame) Clock Input |
| SDIO0 | P20 | I2S0 Data Input/Output |
| MCLK1 | P26 | I2S0 Master Clock Input |
| BCLK1 | P0 | I2S0 Bit Clock Input |
| LRCLK1 | P1 | I2S0 Sub-frame (Frame) Clock Input |
| SDIO1 | P21 | I2S0 Data Input/Output |
User Guide
Basic Recording and Playback
V2 Version
Configuring the Audio Board for RDK X3, RDK X3 Module, and RDK X5
sudo srpi-config
Select 3 Interface Options -> I5 Audio, and press Enter. If the following prompt does not appear, select Finish and confirm reboot.
If the following prompt appears (miniboot version is not the latest), follow the steps below to update miniboot to the latest version.
![]()
Press Enter to enter the following interface.
![]()
Select 1 System Options -> S7 Update Miniboot -> Yes, wait for the update. After the update is complete, select Finish and confirm reboot.
Run the command `sudo sync & sudo reboot` to restart the development board. If the following device nodes appear under `/dev/snd`, the adapter board has been successfully installed.

Uninstallation Method
Uninstall the audio board configuration using srpi-config.
Enter 3 Interface Options -> I5 Audio.
Select UNSET to uninstall the audio driver and related configurations.
Getting Started
Recording
# Record 5 seconds of audio from 4-channel microphones: sudo tinycap ./4chn_test.wav -D 0 -d 0 -c 4 -b 16 -r 48000 -p 512 -n 4 -t 5 # Record 5 seconds of audio from 2-channel microphones: sudo tinycap ./2chn_test.wav -D 0 -d 0 -c 2 -b 16 -r 48000 -p 512 -n 4 -t 5
Playback
# Play 2-channel audio (direct playback of 4-channel recordings is not supported): sudo tinyplay ./2chn_test.wav -D 0 -d 1
V1 Version (Old Version Audio Board)
Hardware detection
sudo i2cdetect -r -y 0

Load the audio codec driver and the x3 audio framework driver
sudo modprobe es7210 sudo modprobe es8156 sudo modprobe hobot-i2s-dma sudo modprobe hobot-cpudai sudo modprobe hobot-snd-7210 snd_card=5
Check if loading succeeded
ls /dev/snd
# Record 5 seconds of audio from 4-channel microphones: sudo tinycap ./4chn_test.wav -D 0 -d 0 -c 4 -b 16 -r 48000 -p 512 -n 4 -t 5 # Record 5 seconds of audio from 2-channel microphones: sudo tinycap ./2chn_test.wav -D 0 -d 0 -c 2 -b 16 -r 48000 -p 512 -n 4 -t 5
Playback
# Play 2-channel audio (direct playback of 4-channel recordings is not supported): sudo tinyplay ./2chn_test.wav -D 0 -d 1
Boxs Repository - Smart Voice
Environment Setup
Install TogetherROS
sudo apt update sudo apt install tros
Check if TogetherROS is installed successfully
ls /opt/
Install the smart voice algorithm package
sudo apt update sudo apt install tros-hobot-audio
Getting Started
It is recommended to run the following as a superuser to avoid errors. Some errors or warnings may appear during execution; ignore them and continue.
sudo su # Enter password
Check the hardware environment
rmmod es8156 i2cdetect -r -y 0

Configure the TogetherROS environment.
source /opt/tros/setup.bash
Copy the configuration files needed for the example from the TogetherROS installation path (skip this step if already copied before).
cp -r /opt/tros/${TROS_DISTRO}/lib/hobot_audio/config/ .
Suppress debug print information
export GLOG_minloglevel=3
Launch
ros2 launch hobot_audio hobot_audio.launch.py
For running results, please refer to the link: https://developer.d-robotics.cc/rdk_doc/en/Robot_development/boxs/audio/hobot_audio#result-analysis
Modify voice input by writing the corresponding format in the appropriate location.
vim config/hrsc/cmd_word.json
RDK S100 Recording and Playback
Note: The DIP switch positions shown below: 40PIN to the left, PCM to the right. Otherwise, normal recording and playback will not work.
For the 40PIN DIP switch, toggle left to connect to I2C5, toggle right to connect to UART2. This switching is done internally on the 40PIN.
For the PCM DIP switch, toggle left to connect PCM0 to the Wi-Fi module, toggle right to connect PCM0 to the 40PIN.

On the S100, the sound card module exists as kernel objects (ko) and is mounted dynamically. The mounting commands are as follows:
sudo modprobe hobot_cpudai_super sudo modprobe snd-soc-es8156 sudo modprobe snd-soc-es7210 sudo modprobe hobot_snd_s100_ac_fdx_host
After loading the drivers, verify that the sound card was loaded successfully:
- Check the /proc/asound/cards node
root@ubuntu:/# cat /proc/asound/cards
0 [s100snd2 ]: s100snd2 - s100snd2
s100snd2
- Check the /dev/snd/ node
root@ubuntu:/# ls -l /dev/snd total 0 crw-rw-r--+ 1 root misc 116, 4 Apr 29 19:09 controlC0 crw-rw-r--+ 1 root misc 116, 2 Apr 29 19:09 pcmC0D0c crw-rw-r--+ 1 root misc 116, 3 Apr 29 19:09 pcmC0D1p
After the sound card is successfully loaded, test the functionality with the following commands:
- Recording
arecord -Dhw:0,0 -c 2 -r 16000 -f S16_LE -t wav -d 5 test.wav
- Playback
aplay -Dhw:0,1 test.wav
Resources
Schematic Diagram
Chip Datasheets
Audio Software Package
Official Resources
FAQ
Support
Technical Support
If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 PM GMT+8 (Monday to Friday)




