IMX6SX ASRC: ideal ratio, no physical input clock

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX6SX ASRC: ideal ratio, no physical input clock

611 Views
dannysmith
Contributor II

Hi,

I have a setup where I need to synchronize audio playback on multiple devices. We use network based clock for the synchronization (something like ntp). Since the audio codec has different opinion of the correct samplerate on each device we get clock drift between the distributed clock and the audio codec.

I am wondering if it might be possible to use the ASRC for eliminating the drift? We do not have a physical input clock but from the reference manual I can see that an input clock might not be needed, is that correct? The output clock is supplied by the audio codec.

There is a register called "ASRC Ideal Ratio" which seems to specify the ratio between the input and output sample rate. Say that we have estimated that the source of the audio is running at 48001 Hz and the receiver is running at 47999 Hz, can we then configure the ratio using this register to eliminate the drift without a physical input clock?

If so, can this register be modified during operation?

Best Regards,

Danny

Labels (3)
0 Kudos
2 Replies

587 Views
dannysmith
Contributor II

Hi @VladanJovanovic

We can make sure to synchronize every audio-stream recipient using for instance PTP or NTP, but we will still have clock-drift between the synchronized audio-stream and the audio-codec on a specific device since the audio-codec clock is derived from the local oscillator on that device. To my knowledge we cannot use PTP for making the audio-codec run synchronized to PTP-master, but maybe that is possible?

So hence my question about running the asrc without an input-clock (since we do not have a physical PTP-synchronized input-clock) and then adjust the ideal_ratio to make the input-side of the asrc consume audio in the rate of the synchronized audio-stream while the output-side is running using the audio-codec clock.

We should be able to use for instance a PID-regulator to match the rates between the synchronized audio-stream and the asrc input-side since we know when we get audio-buffers and when the asrc requests more audio. So if we could run the asrc without a physical input-clock and adjust the ideal_ratio register in runtime, then we should be able to match the rates and remove the clock-drift.

But if it is possible to synchronize the audio-codec clock with PTP, that would probably be a much simpler solution but I have not seen such possibilities.

BR,

Danny

0 Kudos

592 Views
VladanJovanovic
NXP Employee
NXP Employee

Hi @dannysmith 

not sure if that could be done with ASRC. Would have to check. But how would you estimate the drift etc. between units during runtime?

But wouldn't you typically syncronize clocks via network using IEEE1588/PTP, which i.MX 6SX supports?

br,
Vladan

 

0 Kudos