This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SRC4382: non constant output delay for SRC4382

Part Number: SRC4382
Other Parts Discussed in Thread: PCM5100

Hello all,

i 'm struggling with the output delay of two SRC4382 mounted on different equipment and 
i think it is the same problem discussed in this thread:
https://e2e.ti.com/support/audio-group/audio/f/audio-forum/944740/src4382-phase-difference-amongst-tx-output-pins?tisearch=e2e-sitesearch&keymatch=src4382#

Previously i got the same problem when changing MCLK clock and PLL registers, but in such case i partially solved the problem turning off and on again the ASRC block after
MCLK change and PLL reprogramming.  I said "partially" because it remains an about 500nS uncertainty (when resampled clock is at 38KHz)

Is there a more correct way to have a guaranteed output delay at the SRC output ? Indeed it seems that the output delay is depending somewhat on how the internal PLL 
locks to the incoming signal.

Thanks.      

  • Hi Alessandro, 

    What delay are you referring to? The net group delay of the part should be the combination of the interpolation filter and decimation filter delays, which will be much higher than 500ns.

    If you're trying to synchronize multiple devices are you driving them with the same MCLK, BCK, LRCK?

    Best,

    Zak

  • Hello Zak,

    thanks for answering.

    Yes, indeed the overall delay is what you said, but i'm telling this:
    -i have two resamplers mounted on two different devices.
    -the two devices are feeded with the very same aes-ebu signal
    -the ASRCs can be reprogrammed to fit different configurations: in one configuration
    it should produce a 37KHz sampled output, in another it should produce a 195KHz output.
    Changing between the two configurations is done reprogramming the internal PLL, switching
    the external MCLK to a proper frequency (about 18 and about 25MHz) and switching the ASRC
    input from A to B.
    -here comes the issue: if i feed both devices with the very same aes signal, and i compare
    the two analog converted outputs, i see that the two outputs have not the same delay.
    Sometimes the relative delay could also be zero, but it depends on how the devices are powered up.
    The problem is that, switching between the two configurations, the relative delay between the two signals
    can be any value between about +/- 10uS.
    Moreover, any relative delay i get, it can be changed if i disturb the MCLK: say i have 1uS of delay,
    i ground the MCLK for a while and release and the ASRC locks with 12uS delay.
    I ground again the MCLK (no internal registers are touched) and it re-locks with, say, 5uS delay and so on; no
    "delay jump" is observed when disconnecting/reconnecting the AES signal.

    It seems like, regardless the whole resampling delay stated in the datasheet, the output phase/delay is
    related on how the PLL locks to the incoming signal. I don't care about the absolute I/O delay, it can be
    any value, but it is important that it is always the same.

    I know that the two devices should be feeded by the same MCLK (both are running in master mode, so they will
    produce their BCLK and LRCK), but as i wrote before, they are not mounted on the same equipment.
    Their MCLKs are externally provided, so the frequencies amongst the devices are exactly the same, but the
    phase relation of each MCLK could be different: anyway, phase-aligning two MCLKs on two devices, had no positive effect.

    Moreover, the person who started this thread
    e2e.ti.com/.../src4382-phase-difference-amongst-tx-output-pins

    is using the two ASRCs like they should be used, with their common MCLK, LRCK and BCLK, but it seems that he's experiencing the
    same problem.

    The maximum i achieved until now is that, turning off and on the ASRC block with register 0x01 once i sent the new configuration, i have a
    delay uncertainty of +/-1uS maximum when using 37KHz output and +/-10uS when using 195KHz output; for our application the
    first is barely acceptable, while the second is not.


    Many thanks.

  • Hey Alessandro,

    Thank you for providing more detail, I think understand your problem. I think this ultimately stems from the fact that the DIR portion of the device uses an internal PLL to lock to and decode the incoming S/PDIF signal and the lock time of this PLL is not deterministic and will vary between devices and can even vary for a signal re-applied to the same device as you have observed. These parts weren't designed for a deterministic lock time and unfortunately I am not aware of a way to improve this. It doesn't help that the reference clock for the PLLs aren't the same between the two boards, but as you have pointed out there is still the possibility of a slight delay between devices anyways due to this variation in lock time.

    Best,

    Zak

  • Hello Zak,

    Just for the sake of completeness, in my previous post i stated that phase jumps occurs only if i disturb the SRC4382 MCLK
    line and/or if i reprogram its internal pll registers; in no case i have observed phase shifts when connecting and reconnecting the
    aes-ebu input signal.


    Meanwhile i made other tests: i connected two PCM5100 in slave mode to the two SRC4382 outputs and their converted
    outputs are always perfectly aligned. No matters what you can do to disturb this: interrupting the MCLK, disconnecting
    and reconnecting the input signal, always result in perfectly aligned outputs.
    The PCM5100s are clocked only by the SRC4382 BCLK and they willl generate their internal MCLK.


    The SRC4382 output is then used by an FPGA, we are looking into its gut and, for this reason i ask 
    a couple of questions:
    -i need to change the ASRC output rate from about 37 to about 195KHz  (in one step, not continously),
    is there a preferred way to do this ? Actually i simply change the MCLK, then i reload the SRC internal PLL registers,
    then i reset it internally (with register 0x01 written to 0 and, after some time, written to 0x33). Please note that
    this last action partially solved the issue when in low sample rate mode (37KHz) but not when running at the higher one,
    moreover, a phase jump can be seen when i issue the reset command, even if i didn't change the internal PLL registers.
    First question is: having to change the MCLK/PLL "on the fly", is there a preferred way/sequence to do this ?

    -second question: why the PCM5100 never shifts ? I know it generates its internal clock based on incoming BCLK so, 
    i think that, when anything at its input is changed, it smootly resets and restart always aligned.
    That's why i ìm asking if  SRC4382 RDY and LOCK signals are deterministic.
    If they are, can i combine them in some way to reset the internal fgpa guts?

    Thanks.

  • Hey Alessandro,

    I appreciate the detail you have provided. I have a question about your sequence though, you mention you reload the internal PLL registers and then reset the device? You are just powering down the blocks though writing 0x00, never issuing a reset by writing 0x80, right? A true reset would set the PLL values back to default so I could see in this case why you would see a phase jump. 

    Assuming you are just powering down the block prior to changing PLL values, your sequence seems sound. You might try powering down the blocks though as the first step and then changing MCLK and adjusting the PLL values before powering these blocks back up. I think this would be the smoothest way to transition.

    The PCM5100 has its own PLL to generate its clocks from BCK as you mentioned and should reset and ramp back up when anything at the input changes. Still I am somewhat surprised that you never have alignment issues with the lock time of this PLL as an added variable...

    Unfortunately there is some variability in the RDY and LOCK signal timing and it wouldn't be very reliable to use them to keep your two boards synchronized.

    Can you try the revised sequence I mentioned and see if this improves anything?

    Best,

    Zak

  • I appreciate the detail you have provided.

    I'm thanking you for the support you are giving.

    I have a question about your sequence though, you mention you reload the internal PLL registers and then reset the device?


    The sequence is this (register and data pairs are listed), remember i'm using two inputs for 
    two incoming aes-ebu signals: one has to be resampled at low datarate (37ksps) the
    other at higher (195Ksps) . 
    That's why i've to switch the SRC inputs also.


    -on initialization, done once at power up:

    0x01,0x33
    0x03,0x38

    0x04,0x03
    0x05,0x40
    0x08,0x3f

    0x0d,0x08
    0x0e,0x19

    0x0f,0x11
    0x10,0x49
    0x11,0x7D

    0x2d,0x02
    0x2e,0x00
    0x30,0x00
    0x31,0x00
    0x01,0x33

    Here the pll is loaded for 37Ksamples output operation with 18MHz master clock

    then ...

    -when i switch to 195Ksamples with 25MHZ master clock

    <master clock switched from 18 to 25MHz>

    0x0d,0x09
    0x04,0x00

    0x0f,0x21
    0x10,0xe1
    0x11,0xc3

    //---ASRC RESET
    0x01,0x00
    <wait some uS>
    0x01,0x33


    -when i switch to 37Ksamples with 18MHZ master clock

    <master clock switched from 25 to 18MHz>
    0x0D,0x08
    0x04,0x03

    0x0f,0x11
    0x10,0x49
    0x11,0x7D

    //---ASRC RESET
    0x01,0x00
    <wait some uS>
    0x01,0x33

    For each configuration change, when ASRC registers are rewritten, the I2S receiver, internal to the FPGA, is also cleared.

    You are just powering down the blocks though writing 0x00, never issuing a reset by writing 0x80, right? A true reset would set the PLL values back to default so I could see in this case why you would see a phase jump. 

    No Sir, as you can see i just power down the blocks then bring them up after a while.
    This trick was rather effective in correcting the 37Ksamples operating mode and now i have i phase uncertainty of +/-500nS which is
    acceptable in our application, but not as effective when running at the highest sampling rate where phase jumps can be up to 20uS.

    Assuming you are just powering down the block prior to changing PLL values, your sequence seems sound. You might try powering down the blocks though as the first step and then changing MCLK and adjusting the PLL values before powering these blocks back up. I think this would be the smoothest way to transition.



    I've already tried this, but this did not improve the behaviour, I will however change the routines in this way.

    The PCM5100 has its own PLL to generate its clocks from BCK as you mentioned and should reset and ramp back up when anything at the input changes. Still I am somewhat surprised that you never have alignment issues with the lock time of this PLL as an added variable...

    I'm surprised too, but this is what i observed.
    My setup is the following:
    I have a function generator giving a sine tone. The same tone is sent to an oscilloscope channel for
    triggering and to a D/A converter for feeding the SRC input. 
    The pcm5100 is connected in parallel to the SRC I2S output and its converted analogue signal is sent to 
    the second oscilloscope channel.
    On the scope i can see the original signal and the converted / resampled / re-converted signal, so i can
    appreciate their delay.
    Having the original signal as a trigger, i put a marker on a point of the other signal and, when swtiching 
    from 195Ksamples to 37Ksamples mode, i see the converted signal jumping to different delays.
    Note: it is normal to have a different delay when working in one of the two modes, but my problem is
    that the delay is not always the same when returning into the same mode.
    Is something wrong in this measurement setup ?

    Unfortunately there is some variability in the RDY and LOCK signal timing and it wouldn't be very reliable to use them to keep your two boards synchronized.


    Yes, i've seen that, but -it could be a coincidence- when operating at lower sampling rate (37Ksamples) RDY signal is
    always (or at least on every trial i carried out) in sync with LRCK transition; it is not the same when running at 195Ksamples. 
    Anyway, it seems not related to the phase delay issue: i wired the RDY signal it into the I2S receiver and kept it in reset state
    until RDY was not asserted, so it started always aligned to lrck rising edge, but -removing the "asrc reset trick"- the phase
    delay problem came back.   

    Best.