TI中文支持网
TI专业的中文技术问题搜集分享网站

CC3200启动后马上用TLV320AIC3254播放音频异常

如题:            CC3200启动后马上用TLV320AIC3254播放音频异常

MCU型号:  CC3200

音频codec:TLV320AIC3254

异常现象:   连续播放同一个声音三次,第一次声音一开始有很小声慢慢变大正常,其余两次播放正常

操作流程:   CC3200是从休眠模式启动的,启动后马上I2C配置音频codec:AIC3254,配置完成后延时100ms播放从flash里读出来的音频数据

Terry Han:

有参考TI的SDK中的wifi_audio_app程序,程序中有关于CODEC的详细配置,

关于wifi audio的一些简单笔记参考:

wifi audio 语音双向传输的例子,通过CC3200的硬件IIS接口进行数据的无线传输,通过驱动CODEC芯片进行编解码工作,

// 主函数的介绍如下 MAIN FUNCTION //By default example come up in loopback mode means it will read data on MIC and playback to speaker.//Verify whether device coming up with loopback mode or not for further debugging. For loopback test use only one LP at a time.//发射板的 SW3 键//接收板的 SW2 键

//Now follow below sequence once both the LP acquired the IP://1. Ensure Line-IN and Line-OUT points are connected appropriately on both the launch pads.//2. Upon successful connection to AP, press SW2 on LP1. Red LED will switch off on LP1.//3. Once LP1 connects to LP2, the red LED on LP2 will switch off.//4. Now press SW2 on LP2 and SW3 on LP1. Red LED will switch on LP2. —操作步骤有问题,按照下面的方法操作!

//The demo in the SDK does support simultaneous bi-directional (full duplex) audio. This is achieved by exercising the //two parallel paths (as described below) for the audio-in and audio-out paths.////Audio-in jack -> 3200 McASP Data pin 1 -> I2S serializer 1 -> Audio Tx Task -> Audio transmit socket — Over the air// |// V//Audio-out jack <- 3200 McASP Data pin 0 <- I2S serializer 0 <- Audio Rx Task <- Audio receive socket — Over the air////Each of the paths are simplex individually but together it achieves the full duplex audio transfer.//————————run in 44.1kHz or 48kHz instead of 16kHz (default)——————–//You need to make following changes for 44.1/48 KHz 16-bit stereo PCM:////1. Add below code lines in AudioCodecConfig() after “if(bitClk == 512000)”////else if(bitClk == 1536000 || bitClk == 1411200)//{//AudioCodecPageSelect(TI3254_PAGE_0);////AudioCodecRegWrite(TI3254_CLK_MUX_REG, 0x03); // PLL Clock is CODEC_CLKIN//AudioCodecRegWrite(TI3254_CLK_PLL_P_R_REG, 0x91); // PLL is powered up, P=1, R=1//AudioCodecRegWrite(TI3254_CLK_PLL_J_REG, 0x38); // J=56//AudioCodecRegWrite(TI3254_CLK_PLL_D_MSB_REG, 0x00); // D = 0////AudioCodecRegWrite(TI3254_CLK_NDAC_REG, 0x82); // NDAC divider powered up, NDAC = 2//AudioCodecRegWrite(TI3254_CLK_MDAC_REG, 0x87); // MDAC divider powered up, MDAC = 7//AudioCodecRegWrite(TI3254_DAC_OSR_MSB_REG, 0x00); // DOSR = 0x0080 =//AudioCodecRegWrite(TI3254_DAC_OSR_LSB_REG, 0x80); // DOSR = 0x0080 = 128////AudioCodecRegWrite(TI3254_CLK_NADC_REG, 0x82); // NADC divider powered up, NADC = 2//AudioCodecRegWrite(TI3254_CLK_MADC_REG, 0x87); // MADC divider powered up, MADC = 7//AudioCodecRegWrite(TI3254_ADC_OSR_REG, 0x80); // AOSR = 128 ((Use with PRB_R1 to PRB_R6, ADC Filter Type A)//}////2. In AudioCaptureRendererConfigure() replace 512000 with 1411200 for 44.1KHZ and 1536000 for 48KHz////3. In main.c pass 44100 or 48000 in place of 16000 as argument for AudioCodecConfig()//4. In main.c pass 44100 or 48000 in place of 16000 as argument for AudioCaptureRendererConfigure() ////As don't have expertise on Audio codec, so it is best to post query in TI-Audio codec((AIC3254) ) forum to know how to configure PLL related configuration.//特别注意://(1)PLAY_WATERMARK宏定义修改 reducing latency or delayed playback 回放延时问题–注意需要修改两个地方!network+pcm_handler// 详见(Wifi Audio App 8k sample rate delayed playback) https://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/394864/1400223#1400223//(2)Unicast通过mDNS获取目的IP地址进行一对一的音频播放,而MuitiCast则采用mDNS的IP地址224.0.0.251进行广播音频数据//(3)mDNS使用服务器开启及客户端请求问题// 详见(CC3200 WiFi Audio App) http://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/438276// 详见(How 2 CC3200s get each other IP address?) http://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/p/400118/1415303#1415303//(4)回放模式设置// (Using Audio booster pack wifi demo app example CC3200) http://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/390582#pi239031348=2&pi239031350=3//(5)操作步骤//<1>按下复位键(SW1)//<2>按下发射板的 SW3 键,绿灯长亮//<3>再按下接收板的 SW2 键,黄灯长亮,红灯也长亮//此时发射板的红灯及黄灯熄灭,绿灯常亮表示发射板正在传输音频,接收板绿灯熄灭,黄灯及红灯常亮表示正在接收音频//(6)关于双向音频流控制//(does the wifi audio sample really running on bidirectional?) http://e2e.ti.com/support/wireless_connectivity/simplelink_wifi_cc31xx_cc32xx/f/968/t/402341// 在(5)基础上// <4>再按下发射板的SW2键,此时绿灯和黄灯亮// <5>再按下接收板的SW3键,此时绿灯,黄灯和红灯都亮,而且之前的发射板的三个灯也全亮。—双向语音设置成功!//(7)注意在手机播放音频信号,用CC3200无线接收播放会有"叭叭叭"的杂音,是由于手机射频信号造成的!将手机设置为飞行模式再次播放杂音消除!//(8)关于无线UDP数据量问题// UDP每包发送1kBytes数据,16kHz采样率*16bit*2通道=64kBytes字节/s 每秒采集16k次=32k个高低电平,高低电平=左右声道,每个声道16bit数据表示,// 则有每秒32k*2Bytes=64kBytes数据流!也就大约512kbps!如果采用44.1kHz则会产生大约1.5Mbps带宽// 一般音频mp3的音质标准品质为128Kbps约4MB/首 超高品质为320Kbps约10MB/首//(9)连接AP的方式采用直接连接的方式,其他路由器注意名称和加密密码的修改!

//操作步骤//首先设置路由器:#define SSID_NAME "CC3200AP" /*cc3200demo AP SSID */#define SECURITY_TYPE SL_SEC_TYPE_WPA_WPA2 /* SL_SEC_TYPE_OPEN Security type (OPEN or WEP or WPA*/#define SECURITY_KEY "12345678"//<1>按下复位键(SW1)//<2>按下发射板的 SW3 键,绿灯长亮//<3>再按下接收板的 SW2 键,黄灯长亮,红灯也长亮 —单向语音设置成功!//<4>再按下发射板的SW2键,此时绿灯和黄灯亮//<5>再按下接收板的SW3键,此时绿灯,黄灯和红灯都亮,而且之前的发射板的三个灯也全亮。—双向语音设置成功!// 通过板卡上的MIC和插入的耳机就也进行语音双向传输了

mortimersong:

回复 Terry Han:

您好,首先感谢您的回复,您说的音频采集、传输、播放我都没有问题,我现在的问题是:

我在CC3200唤醒的时候参考wifi_audio_app例程程序配置音频codec,配置完成后延时100ms开始播放从flash里读出来的数据,连续播放三次同一音频文件,第一次播放时声音异常(开始声音比较小,后来慢慢变大最后就正常了,音频文件播放一次大概2s左右),后边两次播放都正常

我有把送到I2S端口的数据打印出来,在音频播放异常时,数据没有错误

我也有测过信号,第一次播放异常时,I2S信号正常,但信号从音频CODEC :AIC3254出来后就不正常了,跟后边两次正常的相比,第一次最开始时信号明显偏低,后来变高正常。

以上是我问题的具体描述,请问导致第一次播放异常的原因?

Terry Han:

回复 mortimersong:

如果能确定是I2S的数据正常,是否是CODEC的配置问题,可以把这个问题移到模拟音频的论坛问问,Analog的FAE或许对这个CODEC的应用比较熟悉。

赞(0)
未经允许不得转载:TI中文支持网 » CC3200启动后马上用TLV320AIC3254播放音频异常
分享到: 更多 (0)