Skip to main content
Hpott.1
Visitor II
June 30, 2021
Question

stm32f746g disco play pcm audio from udp

hi

i am working on stm32f746 disco board and i want to play audio with board from online udp data. for this target i wrote a qt application to send pcm audio data over udp protocol and in stm32 program i use lwip receive function in a freertos task for receive data and play it. here is my code :

BSP_AUDIO_OUT_Play((uint16_t*)&audio_buf[0], sizeof(audio_buf));

nb = netbuf_new();

 for(;;)

 {

res=netconn_recv(nc,&nb);

len=netbuf_len(nb);

if(len>0)

{

netbuf_copy(nb,audio_buf,len);

}

netbuf_delete(nb);

  osDelay(1);

 }

whit this code i can receive and play audio but my audio is very noisy. iam not sure whats the best way to doing this. i think i shoud use interrups and freertos features like queue for best quality of audio but i dont know how to implement that. please help me.

thanks

This topic has been closed for replies.

1 reply

Simon V.
ST Employee
July 1, 2021

Hello,

From my experience, audio frame should be sync with hardware interrupt like USB one.

I would try to avoid audio traffic management via RTOS but directly from peripheral IT.

Regards,

Simon

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.