Hi!
Preface: I am just building some more complex free time audio project, comprising few outputs, inputs and SPDIF input. errr... AES/EBU (AES3 balanced) input to be exact.
A part of the design functionality is something like a simple SPDIF soundcard (AES3, but that doesn't matter, these are compatible up to some point). Let's suppose my local DACs (and ADCs) in the design work from a synchronous low jitter precision clock source. Now I want to bring data to the system using SPDIF interface. But there's a catch - SPDIF clocks are asynchronous against my local system, because SPDIF clocks are defined by the transmitter (which may be almost anything from a PC up to some other professional AES3 equipped studio stuff)
A "sort-of-standard" hobby soundcard designs use something like DIR9001 chip from Texas, then slap there a DAC and done. But this is not the case, as my system also does some real time processing on other sources of data (ADCs) and needs to "cross the clock domains".
The problem:I would like to use an integrated SPDIFRX peripheral inside STM32. The peripheral does not have any clock recovery features I could use to switch the whole system from local clock to the recovered SPDIF clocks. How to do the "clock domain crossing"? When I leave my DAC running at my local clock and feed it from the SPDIF received data, overflows or underflows have to occur naturally, as those two clock domains are not synchronous. The more the two clocks deviate one to each other, the more often samples of data will be missing or dwelling in buffers.
How to solve this issue? It seems like the SPDIFRX peripheral is half-unusable, but still I don't want to believe that, as there must be some solution to it. I have seen some (but veeery little) examples from other people, that just copy the incoming data to the DAC. Like this one:
http://test.openstm32.org/forumthread921 No visible effort to synchronize the stream. But yet it somehow works. Wtf? How?
I have tried to look for information about asynchronous resampling algorithms, but fuckin' hell! I have found a lot of stuff, but mostly useless university papers, as those were some very fancy algorithms that used half the computational grunt of an adult SHARC DSP and yet it was called an efficient algorithm. Wtf 2.0?
Have somebody tried the SPDIFRX in STM32? What is your experience with it? How did you solve the synchronization issue? Or am I missing some points completely and looking for problems where they aren't?
Thank you for help,
Yan
EDIT: It seems that realtime ASRC is doable even on Cortex M3:
http://www.dspconcepts.com/products/dsp-library/sample-rate-converterBut HOW? :-O Haven't found any barely useful info till now.