Hello,TI ,Engineer
cc3200 "wifi_audio_app"demo,
I want to use STATION mode to transmit PCM audio stream,do not use smartconfig mode.So I transplant program"Wlan_station"demo to "wifi_audio_app"demo.
cc3200 Device to transmit PCM audio stream to a 60002 port on a computer.Computer analysis of received audio stream。While the headphone is connected to the LINE_OUT, listen to the sound of LINE_IN.
cc3200 LINE_IN------------------------------------------------>LINE_OUT(headphone)
|
|----------------------------------------------------->PC
I found the sound quality is too bad, the player is very fast. Packet loss phenomenon in network transmission.But,The LINE_OUT output sound quality is very good.
my program = "wifi_audio_app" + " waln_station"
SlSockAddrIn_t sAddr;
int iSockID;
int iAddrSize;
void ConnectClientSocket ( void )
{
sAddr.sin_family = SL_AF_INET;//IPV4
sAddr.sin_port = sl_Htons((unsigned short)60002);
sAddr.sin_addr.s_addr = sl_Htonl((unsigned int)(/*g_ulStaIp*/0xc0a8647B));
iAddrSize = sizeof(SlSockAddrIn_t);
iSockID = sl_Socket(SL_AF_INET,SL_SOCK_DGRAM, 0);
}
void Microphone( void *pvParameters )
{
long lRetVal = -1;
while(1)
{
while(1)
{
int iBufferFilled = 0;
iBufferFilled = GetBufferSize(pRecordBuffer);
if(iBufferFilled >= (2*PACKET_SIZE))
{
if(g_EthOKFlag)//Connect to the network to transmit audio data
{
#if 0
lRetVal = sendto(g_UdpSock.iSockDesc, \
(char*)(pRecordBuffer->pucReadPtr),PACKET_SIZE,\
0,(struct sockaddr*)&(g_UdpSock.Client),\
sizeof(g_UdpSock.Client));
if(lRetVal < 0)
{
UART_PRINT("Unable to send data\n\r");
LOOP_FOREVER();
}
#endif
//
// send audio message by wifi
//
lRetVal = sl_SendTo(iSockID, (char*)(pRecordBuffer->pucReadPtr), PACKET_SIZE, 0,
(SlSockAddr_t *)&sAddr, iAddrSize);
}
else
{
lRetVal = FillBuffer(pPlayBuffer,\
(unsigned char*)(pRecordBuffer->pucReadPtr), \
PACKET_SIZE);
if(lRetVal < 0)
{
UART_PRINT("Unable to fill buffer\n\r");
}
g_iReceiveCount++;
}
UpdateReadPtr(pRecordBuffer, PACKET_SIZE);
g_iSentCount++;
osi_Sleep(2);
}
}
//MAP_UtilsDelay(1000);
osi_Sleep(1000);
}
}
It takes me too much time, no way, please help me, I will be very grateful