Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:edge-2l:applications:es8316

This is an old revision of the document!


Edge-2L and ES8316 Audio Usage

Using the ES8316 audio codec requires the Edge-2L IO board

Alsa Audio Device Hardware Name

The ES8316 codec is accessible via the ALSA hardware name hw:CARD=rockchipes8316c. Use this name in audio commands, for example: aplay -D hw:CARD=rockchipes8316c.

You can verify the hardware name with the following commands:

print ES8316 hw name
$ aplay -L | grep rockchipes8316c -m1
hw:CARD=rockchipes8316c,DEV=0
 
$ arecord -L | grep rockchipes8316c -m1
hw:CARD=rockchipes8316c,DEV=0

Alsa Audio Device Hardware Index

You can also identify the ES8316 by its card index. List the available audio devices:

print ES8316 hw index
~# arecord -l | grep es8316-codec -A2
card 3: rockchipes8316c [rockchip,es8316-codec], device 0: fe470000.i2s-ES8316 HiFi ES8316 HiFi-0 [fe470000.i2s-ES8316 HiFi ES8316 HiFi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
 
~# aplay -l | grep es8316-codec -A2
card 3: rockchipes8316c [rockchip,es8316-codec], device 0: fe470000.i2s-ES8316 HiFi ES8316 HiFi-0 [fe470000.i2s-ES8316 HiFi ES8316 HiFi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

In this example, the ES8316 is card 3, so its hardware index is 3.

Record Audio using ES8316

Record a 20-second WAV file using the hardware name:

arecord -D hw:CARD=rockchipes8316c -f cd -d 20 record.wav

Or, using the hardware index (e.g., 3):

arecord -D hw:3 -f cd -d 20 record.wav

Microphone Priority: The headphone microphone has higher priority than the onboard analog microphone (AMIC). If a headphone with a microphone is connected, recording will use the headphone mic. Otherwise, it will use the onboard AMIC.

Playback Audio using ES8316

Play a WAV file using the hardware name:

aplay -D hw:CARD=rockchipes8316c xxx.wav

Or, using the hardware index (e.g., 3):

aplay -D hw:3 xxx.wav

Output Priority: The headphone output has higher priority than the onboard speaker. If headphones are connected, audio will play through them. Otherwise, audio will play through the speaker.

Last modified: 2026/02/03 22:35 by gray