Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:edge2:applications:es8316

This is an old revision of the document!


Edge2 ES8316 Codec

Introduction

This documentation will introduce the usage of ES8316 codec on the Edge2 IO board.

For Edge2, in order to use the ES8316 Codec, you need to attach the Edge2 IO extension board.

Record from ES8316

Get record devices:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: rockchipsoundmi [rockchip,sound-micarray], device 0: fe4b0000.pdm-dummy_codec dummy-codec-0 [fe4b0000.pdm-dummy_codec dummy-codec-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
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

The sound card 3 is the ES8316 device.

Record from Headphone Mic

amixer -c 3 cset numid=18,iface=MIXER,name='ALC Capture Switch' 1 
amixer -c 3 cset numid=35,iface=MIXER,name='Right Headphone Mixer RLIN Switch' 1
amixer -c 3 cset numid=35,iface=MIXER,name='Left Headphone Mixer LLIN Switch' 1
amixer -c 3 cset numid=28,iface=MIXER,name='Differential Mux' 1
arecord -D hw:3,0 -f cd -d 20 record.wav

Record from AMIC

amixer -c 3 cset numid=18,iface=MIXER,name='ALC Capture Switch' 1 
amixer -c 3 cset numid=35,iface=MIXER,name='Right Headphone Mixer RLIN Switch' 1
amixer -c 3 cset numid=35,iface=MIXER,name='Left Headphone Mixer LLIN Switch' 1
amixer -c 3 cset numid=28,iface=MIXER,name='Differential Mux' 0
arecord -D hw:3,0 -f cd -d 20 record.wav

Playback from ES8316

Get playback devices:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: rockchipdp0 [rockchip,dp0], device 0: rockchip,dp0 spdif-hifi-0 [rockchip,dp0 spdif-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: rockchiphdmi0 [rockchip,hdmi0], device 0: fddf0000.i2s-i2s-hifi i2s-hifi-0 [fddf0000.i2s-i2s-hifi i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
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

The sound card 3 is the ES8316 device.

Configure the codec:

amixer -c 3 cset numid=36,iface=MIXER,name='Mixer Right DAC Switch' 1
amixer -c 3 cset numid=34,iface=MIXER,name='Left Mixer Left DAC Switch' 1
amixer -c 3 cset numid=5,iface=MIXER,name='DAC playback Volume' 192,192
amixer -c 3 cset numid=2,iface=MIXER,name='Headphone Playback Voulume' 1,1
amixer -c 3 cset numid=3,iface=MIXER,name='Headphone Mixer Volume' 11

Play audio from ES8316:

aplay -D hw:3,0 xxx.wav

The headphone has the higher priority than the speaker.

Last modified: 2022/12/06 03:50 by nick