07 Audio
1 Audio System Overview
GM-3568JHF development board is equipped with a complete audio processing system, based on the integrated audio controller of RK3568J processor and external ES8388 audio codec chip, providing multiple audio input and output interfaces, supporting high-quality audio recording and playback functions.
1.1 Audio System Architecture
RK3568J I2S/PCM ←→ ES8388 Codec ←→ Audio Interface
↓
HDMI Audio ←→ HDMI Interface1.2 Technical Specifications
| Component | Specification |
|---|---|
| Main Control Audio | RK3568J integrated audio controller |
| Audio Codec | ES8388 high-performance audio codec |
| Digital Interface | I2S, PCM, SPDIF |
| Sampling Rate | 8kHz ~ 192kHz |
| Bit Depth | 16bit, 24bit, 32bit |
| Signal-to-Noise Ratio | >90dB (ES8388) |
| THD + N | <0.1% @ 1kHz |
2 Audio Interface Configuration
The development board provides multiple audio interfaces to meet different application needs:
Audio Input Interface
- Onboard MIC: Built-in omnidirectional microphone, suitable for voice recording
- Headphone MIC: 3.5mm headphone jack integrated microphone input
- Line Input: Supports external audio device input
Audio Output Interface
- Headphone Output: 3.5mm standard headphone jack, supports stereo output
- Speaker Output: Onboard speaker interface, supports mono output
- HDMI Audio: Digital audio output via HDMI interface

3 Sound Card Devices
3.1 Get Recording Devices
root@linaro-alip:/# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: rockchipes8388 [rockchip-es8388], device 0: dailink-multicodecs ES8388 HiFi-0 [dailink-multicodecs ES8388 HiFi-0]
Subdevices: 0/1
Subdevice #0: subdevice #0- card 0: Onboard audio processing chip rockchip-es8388, this chip leads out two recording interfaces, one is the onboard MIC, and the other is the headphone MIC.
- card 0 is a device registered in Linux, and we can call these interfaces through applications.
3.2 Get Playback Devices
root@linaro-alip:/# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: rockchipes8388 [rockchip-es8388], device 0: dailink-multicodecs ES8388 HiFi-0 [dailink-multicodecs ES8388 HiFi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: rockchiphdmi [rockchip,hdmi], device 0: rockchip,hdmi i2s-hifi-0 [rockchip,hdmi i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0- card 0 : Onboard audio processing chip rockchip-es8388
- card 1 : HDMI sound output
card 0 and card 1 are devices registered in Linux, and we can call these interfaces through applications.
3.3 Sound Card Driver Directory
View sound card driver directory
root@linaro-alip:/# ls -l /dev/snd/
total 0
drwxr-xr-x 2 root root 80 Oct 10 17:40 by-path
crw-rw----+ 1 root audio 116, 4 Oct 10 17:40 controlC0
crw-rw----+ 1 root audio 116, 6 Oct 10 17:40 controlC1
crw-rw----+ 1 root audio 116, 3 Oct 10 17:40 pcmC0D0c
crw-rw----+ 1 root audio 116, 2 Oct 10 17:40 pcmC0D0p
crw-rw----+ 1 root audio 116, 5 Oct 10 17:40 pcmC1D0p
crw-rw----+ 1 root audio 116, 1 Oct 10 17:40 seq
crw-rw----+ 1 root audio 116, 33 Oct 10 17:40 timer- controlC0: Used for sound card control, C0 means sound card 0, corresponding to the onboard audio processing chip rockchip-es8388 mentioned above.
- controlC1: Used for sound card control, C1 means sound card 1, corresponding to the HDMI sound output mentioned above.
- pcmC0D0p: PCM device used for playback, the last "p" is the abbreviation of playback.
- pcmC0D0c: PCM device used for recording, the last "c" is the abbreviation of capture.
- pcmC1D0p: PCM device used for playback, the last "p" is the abbreviation of playback.
- timer: Timer device, used for time synchronization of audio playback and recording.
- by-path: Saves the correspondence of devices.
root@lubancat:~# ls -l /dev/snd/by-path/
total 0
lrwxrwxrwx 1 root root 12 Feb 14 18:11 platform-fd880000.usb-usb-0:1.4:1.2 -> ../controlC2
lrwxrwxrwx 1 root root 12 Feb 14 18:11 platform-hdmi-sound -> ../controlC0
lrwxrwxrwx 1 root root 12 Feb 14 18:11 platform-rk809-sound -> ../controlC1
root@lubancat:~#- You can see that there is a correspondence between each control, and these correspondences exactly correspond to card 0 and card 1 mentioned above.
4 Recording and Playback
4.1 Command Line
Recording
Recording uses the arecord command, an example is as follows:
# Get recording devices
arecord -l
# Record 10s audio with sound card 0
arecord -d 10 -D hw:0,0 -r 48000 -c 2 -f S16_LE -t wav /data/test_device.wavParameter details:
- -d 10 : Set recording duration to 10 seconds.
- -D hw:0,0 : Specify the audio device, hw:0,0 means using the first device (0) of the first sound card (0).
- -r 48000 : Set sampling rate to 48000 Hz (i.e. 48 kHz).
- -c 2 : Set the number of audio channels to 2 (stereo).
- -f S16_LE : Set audio format to 16-bit signed little endian.
- -t wav : Set output file format to WAV.
- /data/test_device.wav : Specify the path and name of the output file.
Audio Playback
# Get playback devices
aplay -l
# Play audio for 5s with sound card 0
aplay -Dhw:1,0 -d5 /data/test_device.wavParameter details:
- -D hw:0,0 : Specify the audio device, meaning using the first device (0) of the first sound card (0).
- -d 5 : Set playback duration to 5 seconds.
- /data/test_device.wav : Specify the path of the audio file to be played.
Recording while Playing
Use arecord and aplay tools.
# Record with card 0 and play with card 0
arecord -f cd -Dhw:0 | aplay -Dhw:04.2 Desktop
Recording
After ensuring the network is connected, install the recording software.
# Install software
sudo apt install gnome-sound-recorderOpen the software.

Click the record button in the upper left corner of the application to start recording, press done to end recording. The recording path is /home/linaro/.local/share/org.gnome.SoundRecorder/. If there is nothing in the waveform diagram during recording, check whether the headset is plugged in properly.

Playing Music
The system comes with Rhythmbox software. If you need other players, you can download them yourself.

After opening, you need to import the audio, as shown in the figure:

5 ALSA Advanced Configuration
View detailed audio device information
# View all audio devices
cat /proc/asound/cards
# View device detailed information
cat /proc/asound/card0/id
cat /proc/asound/card1/id
# View PCM device information
cat /proc/asound/pcm
# View audio controller information
amixer -c 0 info
amixer -c 1 infoAudio Control and Mixing
# View all audio controls
amixer -c 0 controls
# View volume controls
amixer -c 0 scontrols
# Set master volume
amixer -c 0 sset 'Master' 80%
# Set headphone volume
amixer -c 0 sset 'Headphone' 70%
# Set microphone gain
amixer -c 0 sset 'Mic' 60%
# Mute/Unmute
amixer -c 0 sset 'Master' mute
amixer -c 0 sset 'Master' unmute6 Common Troubleshooting
6.1 No Sound Output
Check Steps:
# Check audio devices
aplay -l
lsmod | grep snd
# Check volume settings
amixer -c 0 scontrols
amixer -c 0 sget Master
# Test audio output
speaker-test -c 2 -t wav
# Check audio service
pulseaudio --check -v6.2 Recording No Sound or Noise
Solution:
# Check recording devices
arecord -l
# Adjust microphone gain
amixer -c 0 sset 'Mic' 70%
amixer -c 0 sset 'Capture' 80%
# Test recording
arecord -D hw:0,0 -f cd test.wav6.3 Audio Latency Issues
Optimization Configuration:
# Reduce buffer size
echo 'defaults.pcm.dmix.period_size 512' >> ~/.asoundrc
echo 'defaults.pcm.dmix.periods 2' >> ~/.asoundrc
# Use low latency kernel
sudo apt-get install linux-lowlatency6.4 HDMI Audio No Output
Check and Fix:
# Check HDMI audio device
aplay -l | grep HDMI
# Switch to HDMI audio output
pactl set-default-sink alsa_output.platform-hdmi-sound.stereo-fallback
# Test HDMI audio
aplay -D hw:1,0 test.wav