海思hi3518的audio音频调试

U-Boot 2010.06-svn (Jan 04 2015 - 13:34:55)


DRAM:  256 MiB
Check spi flash controller v350... Found
Spi(cs1) ID: 0xC2 0x20 0x18 0xC2 0x20 0x18
Spi(cs1): Block:64KB Chip:16MB Name:"MX25L128"
envcrc 0x52256d0d
ENV_SIZE = 0x3fffc
In:    serial
Out:   serial
Err:   serial
Press Ctrl+C to stop autoboot
CFG_BOOT_ADDR:0x58080000
16384 KiB hi_sfc at 0:0 is now current device


### boot load complete: 1884960 bytes loaded to 0x82000000
### SAVE TO 80008000 !
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   linux
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1884896 Bytes = 1.8 MiB
   Load Address: 80008000
   Entry Point:  80008000




load=0x80008000,_bss_end=80829870,image_end=801d42e0,boot_sp=80797168
   Loading Kernel Image ... 


U-Boot 2010.06-svn (Jan 04 2015 - 13:34:55)


DRAM:  256 MiB
Check spi flash controller v350... Found
Spi(cs1) ID: 0xC2 0x20 0x18 0xC2 0x20 0x18
Spi(cs1): Block:64KB Chip:16MB Name:"MX25L128"
envcrc 0x52256d0d
ENV_SIZE = 0x3fffc
In:    serial
Out:   serial
Err:   serial
Press Ctrl+C to stop autoboot
hisilicon #
hisilicon # 
hisilicon # printenv
bootcmd=setenv setargs setenv bootargs ${bootargs};run setargs;fload;bootm 0x82000000
bootdelay=1
baudrate=115200
bootfile="uImage"
da=mw.b 0x82000000 ff 1000000;tftp 0x82000000 u-boot.bin.img;sf probe 0;flwrite
du=mw.b 0x82000000 ff 1000000;tftp 0x82000000 user-x.cramfs.img;sf probe 0;flwrite
dr=mw.b 0x82000000 ff 1000000;tftp 0x82000000 romfs-x.cramfs.img;sf probe 0;flwrite
dw=mw.b 0x82000000 ff 1000000;tftp 0x82000000 web-x.cramfs.img;sf probe 0;flwrite
dl=mw.b 0x82000000 ff 1000000;tftp 0x82000000 logo-x.cramfs.img;sf probe 0;flwrite
dc=mw.b 0x82000000 ff 1000000;tftp 0x82000000 custom-x.cramfs.img;sf probe 0;flwrite
up=mw.b 0x82000000 ff 1000000;tftp 0x82000000 update.img;sf probe 0;flwrite
ua=mw.b 0x82000000 ff 1000000;tftp 0x82000000 upall_verify.img;sf probe 0;flwrite
tk=mw.b 0x82000000 ff 1000000;tftp 0x82000000 uImage; bootm 0x82000000
dd=mw.b 0x82000000 ff 1000000;tftp 0x82000000 mtd-x.jffs2.img;sf probe 0;flwrite
ipaddr=192.168.1.10
serverip=192.168.1.107
netmask=255.255.255.0
bootargs=mem=${osmem} console=ttyAMA0,115200 root=/dev/mtdblock1 rootfstype=cramfs mtdparts=hi_sfc:512K(boot),5M(romfs),7424K(user),1536K(web),256K(custom),256K(logo),1280K(mtd)
osmem=64M
ethaddr=00:12:13:39:19:8b
HWID=8043420003410427
NID=0x0007
muxctl0=
muxval0=
gpio0=
gpioval0=
appSystemLanguage=SimpChinese
appVideoStandard=PAL
stdin=serial
stdout=serial
stderr=serial
verify=n
ver=U-Boot 2010.06-svn (Jan 04 2015 - 13:34:55)


Environment size: 1435/262140 bytes
hisilicon # 


setenv ipaddr 192.168.2.10;setenv serverip 192.168.2.9
setenv bootargs 'mem=64M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=jffs2 mtdparts=hi_sfc:512K(boot),2M(kernel),8M(rootfs),5632K(user)'


tftp 0x82000000 uImage;bootm 0x82000000
//NOTE: bootargs必须要重配才能继续往下走,明显,进linux后,原来的产品(熊迈模块)一般都禁止了console的。




成功启用回声抵消需要具备一定条件:单声道模式,采样率为8kHz,采样精度为
16bit,帧长为80 或160 个采样点,且MIC 采集语音数据的AI 和远程语音播放的AO
配置帧长必须相同。
当启动重采样的时候,就不能用EC功能了。这个resample究竟是怎么回事?我估计只是针对数字音频吧。
问题:stAioAttr.u32PtNumPerFrm = 320;这是最小值了,如果设置为160的话,配置AIchn时就会出错。如果这样的话,回声抵消功能EC如何用起来呢?


下面做两个测试:
1、gs_bMicIn=1时,录成pcm听听。
# ./sample_audio 1


/************************************/
press sample command as follows!
1:  send audio frame to AENC channel form AI, save them
2:  read audio stream from file,decode and send AO
3:  start AI to AO loop
q:  quit whole audio sample


sample command:1
Ai(0,0) bind to AencChn:0 ok!


please press twice ENTER to exit this sample


测试结果:一样的。看来海思SDK上面写的不区分mic与linein(select)是真的。


2、播放44100采集率(hz)的AAC音频,再用sample_audio采样试试。
# ./sample_audio 1


/************************************/
press sample command as follows!
1:  send audio frame to AENC channel form AI, save them
2:  read audio stream from file,decode and send AO
3:  start AI to AO loop
q:  quit whole audio sample


sample command:3
ai(0,0) bind to ao(0,0) ok


please press twice ENTER to exit this sample
结果:存下来的audio_hisi.pcm播放正常。这说明,输入是pcm的,AI有重新采样。这样就更搞不懂resample是什么意思了。晕。




我修改了sample_audio
./sample_audio 1 //0:linein,1:mic
将AI采样pcm数据保存在当前目录下面,audio_hisi.pcm
建议用3:  start AI to AO loop来测试。这是绕开Aenc/Adec的loopback。





















你可能感兴趣的:(物联网)