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.

PCM9211: Output data format(part2)

Part Number: PCM9211

Tool/software:

Hi ,

I am using this script from codec control [SPDIF Record via TAS1020 through RXIN2 in MainOutput.txt] , 

my configuration is :  Audio precision[.ac3 file] --> spdif in --> pcm9211[Master mode] --> i2s out --> mydevice[slave mode] .

Basically I am playing a .ac3 file from AP and want iec frames on i2s out , 

I can see in my output initially I am receiving proper iec frames with pa - pb etc , but after some frames pcm9211 is transmitting junk pcm samples in between it can be noise or something , wanted to check if this is acceptable or there is some issue with my configuration , The pattern is somewhat symmetric let say 30 iec frames and then some 10 junk pcm frame, considering 1frame to be of 1536 samples, my .ac3 file is at 48khz and it transmits 1536 samples in every 32msec as well as slave device is configured to receive the data at 48khz .   

Requesting some suggestion and direction to resolve the issue so that pcm samples can be avoided as I am playing .ac3 there should be no scope of getting anything in between .

  • After further debugging , I can notice that the frame which I thought was junk pcm is a IEC frame only , but there is a bit flip that is happenning , instead of 0xf872 I am receving 0x7872 , so my start bit is flipped from 1 to 0 , wanted to understand what can be probable cause and suitable fix to avoid bit fliping .

    correct pa pb --> f8724e1f
    received pa pb --> 78729c3e

    4e1f --> 1001 1100 0011 1110
    9c3e --> 0100 1110 0001 1111

     

    f872 --> 1111 1000 0111 0010
    7872 --> 0111 1000 0111 0010

    As pa pb is added by pcm9211 module , why 1bit shift is there and it is not continous comes and goes, it recovers also on its own , what can we do to avoid this bit shifting .

    Thanks,

  • Hi Shivam,

     From the above,  the first bit of pa is flipped and there is a shift in pb. I have never heard of this problem so i need to think about it a bit . Give me a couple of days. We may need to reach out to a wider audience in audio teams to find out the root cause.

    Regards,

    Arash

  • Hi Shivam,

    I went through the post again and I have few questions :

    Are you reading the above shifted/flipped  output after the slave device ( not the PCM9211)?

    Can you play a 1KHz sinewave and use the EVM to loopback to the AP and plot fft to see what you get ( the correct 1KHz tone?)

    You mentioned you are using I2S at output of PCM9211, then what are the pa and pb here, I am not following it- as I2S has left and right channels.

    Regards,

    Arash

  • **Are you reading the above shifted/flipped  output after the slave device ( not the PCM9211)?

    Yes as PCM9211 is pushing data over i2s , I have a slave device in i2s slave mode to receive the data and I am reading data on my slave device.

    **Can you play a 1KHz sinewave and use the EVM to loopback to the AP and plot fft to see what you get ( the correct 1KHz tone?)

    I have played 1khz sine tone and received the data on my slave device the fft shows exact 1khz there is no issues when playing sine/.wav file as it is transmitted as pcm from 9211 device.

    **You mentioned you are using I2S at output of PCM9211, then what are the pa and pb here, I am not following it- as I2S has left and right channels.

    yes I2s has left and right but I am playing .ac3 file here , so pcm9211 uses iec format and according to that pcm9211 detects that its a non pcm data and adds a sync word at the start of frame , this pa - pb - pc - pd is added by pcm9211 on every output frame whenever it detects a non pcm data , I have observed that there is no shift in pc - pd but shift only occurs in pa - pb , this shift comes and resolves on it own , as pa - pb - pc - pd is 16 bit each , they are transmitted as PA(f872) PB (4e1f) PC(0001) PD(3000) , so left channel pa will come as f872 and right channel will have pb as 4e1f and so on .

  • Hi Shivam,

    Thanks for the update. Arash will be back in office on Monday U.S. time to follow up with you.

    Thanks for your patience,
    Jeff McPherson

  • Hi Shivam, The fact that a sinewave (PCM data) works fine confirms the setup and the part is working correctly with expected format  ( ie, I2S) . I am not sure the datasheet explicitly say that it would work with non-pcm data . My understanding is that it can detect non-pcm and flag it (section Non-PCM Data Detection) but not necessarily process it correctly.

    Regards,

    Arash

  • Hi Arash ,

    I tried few things to narrow down the issue , 

    I gave input pcm data with all zero's to understand if  pcm9211 module can process it without any drift or glitch , I have found it works perfectly [spdif in to pcm9211 and i2s out from pcm9211 works perfectly ] .

    Then I used my slave device and gave same pcm data with all zero's this also worked perfectly [ i2s in to slave device and i2s out from slave works perfectly].

    Now I can clearly see the drift issue occurs only when I connect pcm9211 module with my slave device [ spdif in to pcm9211 --> i2s out from pcm9211 --> i2s in to slave device --> i2s out from slave device ].

    A). Now to resolve this further , I need your help to understand , when I use this script [SPDIF Record via TAS1020 through RXIN2 in MainOutput.txt] , what is expected voltage level on i2s gpio's [mclk , bclk , dataout as well as lrclk pins] , I need this information to understand if this can be logic level issue for TTL while infefacing i2s between 2 different devices .

    B). Can you help me with the required changes in this script [SPDIF Record via TAS1020 through RXIN2 in MainOutput.txt] , so that I can run PCM9211 module in slave mode and derive the i2s clock from my slave device instead of internal xti clock of pcm9211 , Also please share the pin details where on evaluation board I can pass this external clock from slave device to pcm9211 module .

    Thanks ,

  • Hi Shivan, 

    One thing that I need clarification: the I2S directly from another source ( say AP for example) works fine but a perfectly working I2S ( which is coming from PCM9211) will not work correctly when is fed to your slave device? I have done this type of configuration (with different devices ) in the past and  never had an issue.

    The clks out of PCM can be monitored at the main output port and should have the same voltage level as the digital supply. 

    Can you share your schematic with me, maybe we can find the fix without any need to make the pcm SLAVE-- as  you might break something else or problem does not go away. 

    Also please show the I2s signals in one screen so we can look at that as well.

    If you have a DAC handy, it would be useful to feed the I2S from PCM9211 to this DAC , and check the reconstructed waveform. 

    Regards,

    Arash

  • Hi Arash ,

    I did a small change in the script which might have fixed the distortion in PA-PB for me , Sharing for your reference:

    Updated 30h register, PSCKAUTO bit to Enable for automatic PLL SCK dividing ratio .

    But I need to still do some more testing to understand what was the real fix , for now good news is everything is working perfectly .

    Also because I was using jumper cables to get the data from PCM9211 module to my slave board , not having proper grounding , loose cables and different logic levels on the slave device can also be the reason behind distortion in received data .