|
发表于 2020-4-26 09:34:00
只看该作者
板凳
在 kernel 中执行
make rk3308_linux_defconfig
make menuconfig
device drivers-->
<*>usb support -->
<*>usb gadget support-->
<*> usb gadget drivers (audio gadget)
audio gadget
<*> uac 1.0
该选项选中后,编译烧写进去板子,windows端识别到ac interface ,没有adb
音频设备与usb枚举log:
[ 0.556550] ALSA device list:
[ 0.556588] #0: UAC1_Gadget 0
[ 0.556608] #1: rockchip,rk3308-pcm
[ 0.556629] #2: rockchip,rk3308-vad
[ 0.556687] #7: Loopback 1
[ 0.559306] VFS: Mounted root (squashfs filesystem) readonly on device 31:6.
[ 0.560543] devtmpfs: mounted
[ 0.560835] Freeing unused kernel memory: 320K
[ 0.567647] dwc2 ff400000.usb: new address 11
[ 0.762785] dwc2 ff400000.usb: new device is high-speed
[ 0.795656] dwc2 ff400000.usb: new address 12
[ 0.818172] g_audio gadget: high-speed config #1: Linux USB Audio Gadget
eq/drc 程序运行log
==========EQ/DRC process release version 1.23===============
snd_pcm_open
snd_pcm_hw_params_malloc
snd_pcm_hw_params_any!
snd_pcm_hw_params_set_access!
snd_pcm_hw_params_set_format
channels = 2
bufferSize = 20480
periodSize = 1024
Rate = 48000
Open record device done
Open PCM: fake_play
[ 3.494665] dwmmc_rockchip ff4a0000.dwmmc: Busy; trying anyway
[ 3.494707] mmc_host mmc0: Timeout sending command (cmd 0x202000 arg 0x0 status 0x0)
interleaved mode
snd_pcm_hw_params_alloca
interleaved mode
format successed
3.507831]c hmamncn_eholsst =m m2c0:
Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
setting sampling rate (48000)
write_bufferSize = 4096
write_periodSize = 1024
rk eq_drc v2.02 2019-07-20 Oct 11 2019 09:26:56
psEqualizer->m_pfControlValue = 0.000000
open write device is successful
WAKE_LOCK[RK_acquire_wake_lock] id=eq_drc_process
param_name = /data/cfg/eq_bin/Para_48000Hz_2ch.bin
EQ/DRC Algorithm 3BAND_IIR_DIVFREQ PEAK VALUE V1.0...Oct 11 2019 09:26:56
GetLMTVersion v1.03 2019-10-10 Oct 11 2019 09:26:57,force=0 firstInit=1
串口端输出arecord -f dat -t wav -r 48000 -c 2 -D hw:2,0 /tmp/test.wav,执行录音
ctrl+c 停止,得到音乐文件 test.wav
然后执行aplay /tmp/test.wav -c 2 -r 48000 -D hw:2,0 播放
Windows打开 录音机 软件 点击录音
串口提示错误log
[root@rockchip]:/$:aplay /tmp/test.wav -c 2 -r 48000 -D hw:2,0
Playing WAVE '/tmp/test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
====read frame error = -32===
Overrun occurred: -32
ALSA lib pcm.c:8905:(snd_pcm_recover) overrun occurred
|
|