赞
踩
MIC_P,MIC_N:mic输入。
I2S:总共有5根线(这里不是指 i2s 标准接口):两根音频数据线(输入/输出)、三根时钟线
其中:
I2S_LRCK 是指示当前数据线传输的是左声道还是右声道;
I2S_BCLK 是协调数据线上的数据传输(一个时钟周期,主控、音频编解码芯片从音频线上获取一个 Bit 音频数据);
I2S_MCLK 是主控供给音频编解码芯片保持正常工作用的时钟;
- i2s1_sound: i2s1-sound {
- status = "okay";
- compatible = "simple-audio-card";
- simple-audio-card,format = "i2s";
- simple-audio-card,mclk-fs = <256>;
- simple-audio-card,name = "realtek,rt5616-codec";
- //simple-audio-card,bitclock-master = <&master>;
- //simple-audio-card,frame-master = <&master>;
- simple-audio-card,widgets = //指定相关组件
- "Mic Jack",
- "Speakers";
- simple-audio-card,routing = //音频路径,如mic输入、耳机输出走那些通路。
- "IN2P", "Mic Jack",
- "IN2N", "Mic Jack",
- "Speakers", "LOUTL",
- "Speakers", "LOUTR";
- simple-audio-card,cpu {
- sound-dai = <&i2s1_2ch>; //指定cpu接入音频编解码的dai(数字化接口)
- };
- master: simple-audio-card,codec {
- sound-dai = <&rt5616>;
- };
- };
- };
- root@RK356X:/# cat /proc/asound/cards
- 0 [realtekrt5616co]: realtek_rt5616- - realtek,rt5616-codec
- realtek,rt5616-codec
- root@RK356X:/# ls /dev/snd/* -l
- crw-rw---- 1 root audio 116, 4 Jan 1 00:00 /dev/snd/controlC0
- crw-rw---- 1 root audio 116, 3 Jan 1 00:00 /dev/snd/pcmC0D0c
- crw-rw---- 1 root audio 116, 2 Jan 1 00:00 /dev/snd/pcmC0D0p
- crw-rw---- 1 root audio 116, 1 Jan 1 00:00 /dev/snd/seq
- crw-rw---- 1 root audio 116, 33 Jan 1 00:00 /dev/snd/timer
controlC0 --> 用于声卡的控制,例如通道选择,混音,麦克风的控制等
pcmC0D0c --〉 用于录音的 pcm 设备
pcmC0D0p --〉 用于播放的 pcm 设备
arecord -D hw:0,0 -c 2 -r 44100 -f S16_LE test.wav
aplay -D hw:0,0 test.wav
-> 先通过 amixer contents 查看音频接口
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。