Hello Marko
What you are facing is a synchronization problem when sampling on USB. There are different ways to solve this problem, that basically is, to use a synchronization method.
There are 3 different methods:
- Synchronous: Audio is sampled based on USB's SOF. In this method, USB Device needs to measure SOF (every 1 ms), compare with its clock and adjust it. This adjust might be modifying the samples (Using interpolation or sample converter) or modify master clock frequency.
- Adaptive: Recover clock based on data rate and adjust the clock just as synchronous method.
- Asynchronous: Clocks are fixed. You measure difference on clock from stream and then send a feedback to host. In this feedback you request for more or less samples according to your samples buffer.
You can learn more about these synchronization methods on this post: USB audio sync.
So basically, you need to pay attention on implement a synchronization method.
I hope this can help you,
Best Regards,
Isaac
----------------------------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
----------------------------------------------------------------------------------------------------------------------------------------