Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge2:applications:es8316

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
products:sbc:edge2:applications:es8316 [2022/11/24 02:27]
ivan created
products:sbc:edge2:applications:es8316 [2022/12/07 20:40]
hyphop [Alsa audio device HW index]
Line 1: Line 1:
-====== Edge2 ES8316 Codec ======+====== Edge2 and ES8316 Audio Usage ====== 
 + 
 +<WRAP important > 
 +ES8316 codec usage require [[|Edge2 IO extension board]]. 
 +</WRAP> 
 + 
 + 
 +===== Alsa audio device HW name ===== 
 + 
 +Access to **ES8316** codec will be available by ''hw:CARD=rockchipes8316c'' alsa audio device HW name, for example: ''aplay -D **hw:CARD=rockchipes8316c** ... '' 
 + 
 +```shell 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 HW index ===== 
 + 
 +```shell 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 
 + 
 +``` 
 + 
 +The sound **card 3** is the ES8316 device and audio device HW index is ''3''
 + 
 +===== Record from ES8316 ===== 
 + 
 +``` 
 +arecord -D hw:CARD=rockchipes8316c -f cd -d 20 record.wav 
 +``` 
 + 
 +or by audio device HW index (will be ''3'' for this example) 
 + 
 +```shell 
 +arecord -D hw:3 -f cd -d 20 record.wav 
 +``` 
 + 
 +<WRAP info > 
 +The headphone mic has the higher priority than the AMIC, which means if you connect the headphone then will record from the headphone mic, otherwise record from the AMIC. 
 +</WRAP> 
 + 
 + 
 +===== Playback from ES8316 ===== 
 + 
 +```shell 
 +aplay -D hw:CARD=rockchipes8316c xxx.wav 
 +``` 
 + 
 +or by audio device HW index (will be ''3'' for this example)  
 + 
 +```shell 
 +aplay -D hw:3 xxx.wav 
 +``` 
 + 
 +<WRAP info > 
 +The headphone has the higher priority than the speaker, which means if you connect the headphone then will play from the headphone, otherwise play from the speaker. 
 +</WRAP> 
  
-{{page>products:sbc:common:applications:gpio:es8316&noheader}} 
Last modified: 2023/03/09 19:58 by nick