AnsweredAssumed Answered

USB audio (isochronous async EP + feedback EP) - sync problems (SOLVED!)

Question asked by ColdWeather on Oct 9, 2016
Latest reply on Oct 17, 2016 by ColdWeather
Hello!

Using an own board with a F103 and a TAS5715 Class-D amplifier on it I'm trying to implement an USB-Speaker.

Learning from various AN I modified the speaker example from STM USB FS Device Stack V3.3.0 by changing the  isochronous OUT EP to its async submode and adding an isochronous IN EP as a feedback. To obtain a better audio quality the USB "properties" (descriptors, EP buffer sizes, etc...) have been further changed to stereo 16 bit channels at 44.1kHz.

Windows 10 recognizes the device, and in general, it works: I hear the sound!

Well, according to the F103 docs, having 72MHz system clock the actual sample rate of I2S would be 43.269kHz, what I really observe (my scope shows 43.2694kHz ;)). This value I send via feedback EP (in the 10.14 format), and Windows OS seems to accept and process the value: if I intensionally skip sending the feedback, it starts to sound robot-like and with other distortion effects.

OK, I'm still working on the proper synchronisation to adjust the feedback value depending on the buffer level, but the issue is of another kind: every 10 seconds (quite exactly as far as I can measure it by a stop watch) I hear short dropouts in the sound. I found out, in those cases F103 obtains the buffer filled in with zeroes only. I have no places in my code doing this, thus, the data with zeroes must come via USB. I suppose, it must be a Windows driver issue.

Any ideas and experience?

TIA.

P.S. If I don't send the feedback, the periodical distortions are to hear but NO dropouts at all. The further sign, it must be a sync issue on the host.

Outcomes