Sample rate synchronisation between sender & receiver (UDP transfer)

Bertrand

Member
My final goal is to build a Teensy 4.1 based matrix intercom via ethernet.
I started of with a simple sender and receiver teensy 4.1, which works fine with native Ethernet(based on VBAN code from https://github.com/ZuwaiiVR/Teensy-3-VBAN)

Of course i'm running now into sample frequency differences, which will give eventually buffer underrun / overrrun issues.
I'm able to monitor the AudioMemoryUsage(), which gives an indication for buffer overruns (note that there is a max of 80 buffers per playqueue on T4), but this is only a indirect indicator, because it depends on other buffer usage.
Detecting a buffer underrun seems to be much more difficult to detect, as there seems to be no method to see if the queue is empty (# buffers used for this queue)

Anyone has some suggestions?
I'm already looking into the audio library framework, but it's a steep learningcurve... (should i make the head and tail pointers public, or create a new public function?)

I'm thinking about making my own intermediate (circular) buffer at the cost of extra memory usage and delay, and hope to come up with an appropriate PLL control algorithm to dynamically adjust the I2S frequency at the receiver side.
 
Back
Top