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.

PCM5242 total latency?

Other Parts Discussed in Thread: PCM5242

Hi,


I have a setup where a PCM5242 is fed data via I2S (16+16bits, 48kHz), the analog output then sent to speakers via a TPA6120, and the sound recorded.

When comparing the data sent and the recording, I am seeing a delay of >20 samples, when the PCM5242's miniDSP is set to preset program 7, Asymmetric FIR Interpolation filter. According to the PCM5242 datasheet, this filter's group delay should be 1.2 samples.

A few samples of the total delay can be attributed to acoustic path, I2S buffer and the microphones used, but even after eliminating these, the majority of the delay seems still to be unexplained. So my strongest suspicion is that there might be some buffering internal to the PCM5242, that is not specified in its datasheet. Can someone confirm this, or say with certainty that there is no internal delay?

I also tried the other preset miniDSP programs in the PCM5242 aswell, and they seemed to increase the total delay approximately as much as the datasheet says their group delay is.  I even made a trivial program in PurePath Studio, where the I2S input is routed directly to the Interpolator output ("Interpolator x8 sl"), but the total delay from this was close to the case when running the  Asymmetric FIR preset program.

I tried warying the I2S stream as either pink noise (alternating left and right channel), sine sweep or music. Same result with each.

If this extra, unexplained, delay of ~16 samples (nice round number for a buffer, BTW) is due to the PCM5242, is it possible to configure away?

thank you in advance,

Kalle

  • Hi Kalle,

    When changing filters in the DSP you must set the DSP into standby, change the DSP program, then bring it out of standby. Were you doing this for each filter change? These filter changes should result in a change of delay time. What method were you suing to change between preset filters, PPC, script commands, or something else?

    Justin
  • Hello & thanks for the reply,

    I did indeed see changes in the measured time trying the different pre-programmed programs (i.e. by varying the value in register 43). Each of these seemed to have a total delay of X + the group delay specified in the datasheet. (The only exception was the "high attenuation" filter program, where X was a bit bigger than for the rest of the programs, but this perhaps can be explained by acoustics?)

    And yes, I did reset the DSP between the tries (by writing to reg.2). All register writes were done using a embedded control processor program writing to the I2C bus. My custom DSP program was built in PPS, and I took the register settings for instruction and coefficient registers from PPS's output, sending them to the I2C.


    kalle
  • Hi kalle,

    I ran some tests to see if I could capture the delay between no data in and a constant value and here is what I found:

    Using the PCM5242EVM hooked up to an AP and the PPC2 GUI, I switched to the Asynchronous FIR filter. Below is a capture of the time I turn on data from the PSIA out from 0 data to a constant value.

    This shows about a 5 sample delay.

    An interesting thing I stumbled upon doing this testing is that the AP does not turn on channel A and channel B at the same time, there is actually a 24 sample delay between the channels. So if I was measuring the right channel, it would start 24 samples behind the left channel. This is shown below:

    Are you by chance doing your test with an AP, or is this same situation happening in your test?

    Justin

  • Thank you Justin!

    My tests are not done with an AP, the setup is much cruder than that.
    I've been able to shave off about 10 samples of delay due to a error in my measurement, but if the PCM5242 contributes only 5, I guess I have a few more to find :)

    kalle