1

I'm working in an audio project. We use stm32f407 like a USB audio device to get audio data from PC then send out by I2S module. We are using stm32f4 Discovery kit and STM32cubeMX. After generate code by following this video, i change nothing and flash to Kit; my PC identifies that STM Audio device but there isn't any data send to my kit when play music, except MuteCMD . My question is:

  • i don't know which function is callback when data stream from PC to Kit.

  • why PC identifies that my kit is an audio output device but the callback of volume control isn't called when I config volume on PC and there isn't any data of music send to my device. The only one mute control callback function is called when i mute the PC.

this is my config in STM32cubeMX

pinout config figure pinout config figure

USB device config figure 1 USB device config figure 1

USB device config figure 2 USB device config figure 2

USB device config figure 3 USB device config figure 3

PC identifies AUDIO device figure PC identifies AUDIO device figure

choosing PC's audio output device figure choosing PC's audio output device figure

fail to play test tone figure fail to play test tone figure

Andrew
  • 26,706
  • 9
  • 85
  • 101

2 Answers2

0

You should set USBD_AUDIO_FREQ to 22050 (or 44100, or 11025). Your value is 22100 and it seems like Windows or built-in audio drivers can't use that frequency.

Dmitry
  • 1
  • 1
0

I had exact same problem.
My project is generated from STM32Cube.
Windows recognizes the F7-DISCO board as sound card but failed to play test sounds.

I changed USBD_AUDIO_FREQ to 48000 and PID to 0x5730 (22320 in decimal).
And then everything works fine.

enter image description here

enter image description here

Quence
  • 38
  • 6