ti工程师们好!
我修改了wifi_audio_app程序,把编解码芯片改成wm8960,取消了里面的按键程序和网络传输。由于手头上只有一个板子,想修改程序实现一个板子上将输入的音频输出。在main函数中把跟网络和按键有关的函数都注释了,加了 g_ucMicStartFlag = 1;g_ucSpkrStartFlag = 1;g_loopback = 1。现在遇到的问题是播放没声音,调试的时候发现没进DMA中断函数。main函数如下:
{
long lRetVal = -1;
unsigned char RecordPlay;
BoardInit();
// Pinmux Configuration
//
PinMuxConfig();
g_ucMicStartFlag = 1;
g_ucSpkrStartFlag = 1;
g_loopback = 1;
{
pRecordBuffer = CreateCircularBuffer(RECORD_BUFFER_SIZE);
if(pRecordBuffer == NULL)
{
//UART_PRINT("Unable to Allocate Memory for Tx Buffer\n\r");
LOOP_FOREVER();
}
}
if(RecordPlay & I2S_MODE_TX)
{
pPlayBuffer = CreateCircularBuffer(PLAY_BUFFER_SIZE);
if(pPlayBuffer == NULL)
{
//UART_PRINT("Unable to Allocate Memory for Rx Buffer\n\r");
LOOP_FOREVER();
}
}
//
// Configure Audio Codec
//
WM8960_Init();
//
// Initialize the Audio(I2S) Module
//
// Initialize the DMA Module
//
UDMAInit();
//if(RecordPlay == I2S_MODE_RX_TX)
if(RecordPlay & I2S_MODE_TX)
{
UDMAChannelSelect(UDMA_CH5_I2S_TX, NULL);
SetupPingPongDMATransferRx(pPlayBuffer);
}
//if(RecordPlay & I2S_MODE_TX)
if(RecordPlay == I2S_MODE_RX_TX)
{
UDMAChannelSelect(UDMA_CH4_I2S_RX, NULL);
SetupPingPongDMATransferTx(pRecordBuffer);
}
// Setup the Audio In/Out
//
lRetVal = AudioSetupDMAMode(DMAPingPongCompleteAppCB_opt, \
CB_EVENT_CONFIG_SZ, RecordPlay);
if(lRetVal < 0)
{
//ERR_PRINT(lRetVal);
LOOP_FOREVER();
}
AudioCaptureRendererConfigure(AUDIO_CODEC_16_BIT, 16000, AUDIO_CODEC_STEREO, RecordPlay, 1);
// Start Audio Tx/Rx
//
Audio_Start(RecordPlay);
// Start the simplelink thread
//
//lRetVal = VStartSimpleLinkSpawnTask(9);
//if(lRetVal < 0)
//{
// ERR_PRINT(lRetVal);
// LOOP_FOREVER();
//}
//
// Start the Network Task
//
//lRetVal = osi_TaskCreate( Network, (signed char*)"NetworkTask",\
OSI_STACK_SIZE, NULL,
// 1, &g_NetworkTask );
//if(lRetVal < 0)
//{
// ERR_PRINT(lRetVal);
// LOOP_FOREVER();
//}
// Start the Control Task
//
//lRetVal = ControlTaskCreate();
// if(lRetVal < 0)
//{
// ERR_PRINT(lRetVal);
// LOOP_FOREVER();
//}
//
// Start the Microphone Task
//
lRetVal = osi_TaskCreate( Microphone,(signed char*)"MicroPhone", \
OSI_STACK_SIZE, NULL,
1, &g_MicTask );
if(lRetVal < 0)
{
//ERR_PRINT(lRetVal);
LOOP_FOREVER();
}
// Start the Speaker Task
//
lRetVal = osi_TaskCreate( Speaker, (signed char*)"Speaker",OSI_STACK_SIZE, \
NULL, 1, &g_SpeakerTask );
if(lRetVal < 0)
{
//ERR_PRINT(lRetVal);
LOOP_FOREVER();
}
// Start the task scheduler
//
osi_start();
}