2021-06-17 05:30 AM
Hi,
I want to create a simple device that streams audio from a PC to a loudspeaker via NUCLEO-L476RG board. The connection to a PC is implemented via USB connector on the X-NUCLEO-CCA02M2 board, which is plugged into NUCLEO-L476RG.
I've configured the project using STM32CubeIDE.
The USB inputs are set for Audio Device Class and I'm using SAI1 block for audio output. The SAI1 block should take the audio data from the DMA buffer.
In terms of firmware modifications, I only implement the changes that are mentioned here:
https://www.programmersought.com/article/90827167498/
The only difference is that I changed I2S HAL functions to their SAI alternatives.
Currently the issue is that, although the device is recognised by a PC as an Audio Class device, it doesn't output any data via I2S pins. Through debugging I figured out that the device doesn't enter the USBD_AUDIO_DataOut() function in usbd_audio.c file, although it fully implements USBD_AUDIO_Init().
Could anyone tell me how to approch this issuse or give a hint on why USBD_AUDIO_DataOut() function is not implemented?
Regards,
Pavels
2021-07-01 09:13 AM
Hello,
You can refer to the following application example :
It includes audio acquisition, playback and streaming via USB and on SD card
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.
2021-07-01 11:39 PM
Thanks, but that didn't particularly help since there is no example for streaming audio exactly from a PC via USB to STM32L4 and then to a loudspeaker through SAI block.
2021-07-02 12:33 AM
Hello,
There is another library available USB device audio streaming Expansion Package for STM32Cube from X-CUBE-USB-AUDIO Expansion Package.
In chapter 5.1 STM32446E-EVAL board standalone playback example may help you to start your application design.
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.