UAC2: choose feedback method #2460
Replies: 2 comments 1 reply
-
Will there be any references on how to use the feedback later on? |
Beta Was this translation helpful? Give feedback.
-
Back from holiday...
I highly recommend you to use buffer and DMA for audio streaming applications, interrupt at this high frequency can easily be delayed by other interrupts and cause data loss.
I suggest you to first try #2328 which take care of feedback calculation inside the class. Even if you are measuring MCLK with a precision hardware timer there will still be accumulated error and drift, which are not accounted by other feedback method. |
Beta Was this translation helpful? Give feedback.
-
hello,
in my project I have TDM at 48kHz and I process it sample by sample, so I have an interrupt every 20.83us and it is within this interrupt that I would need to take the data coming from usb to send it on TDM.
Obviously the clock of this DM is asynchronous to the USB clock so I need the feedback endpoint. The problem is that I have absolutely no idea which method I should choose from those available:
I tried, unsuccessfully, to understand something from the comments in the sources (here https://github.com/hathach/tinyusb/blob/master/src/class/audio/audio_device.h#L470).
So the question is, in my use case what method should I choose and what do I need to provide in terms of functions?
Keep in mind that I also have a hw timer available that could be fed by the MCLK @24.576MHz. I read something about this in the comments in the code (
and the cycle count of f_m at time of the SOF interrupt (e.g. by use of a hardware counter)
here https://github.com/hathach/tinyusb/blob/master/src/class/audio/audio_device.h#L472). I can imagine that it might be useful but I didn't understand how.And then is there an API that allows me to retrieve data from the usb directly from an interrupt handler?
regards
Max
Beta Was this translation helpful? Give feedback.
All reactions