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.

Problem with LMX9838 pcm-slave audio

I'm working with the LMX9838 chip and I'm trying to get the PCM-slave mode to work with an audio codec, MAX9860. I have two LMX9838 EVM dongles and two audio adapter boards with the OKI codec. When using the OKI boards on both sides I can connect and use the HSP profile to relay sound back and forth.
When I replace one of the OKI boards with a connection to a max9860 codec and use the PCM-slave mode in the LMX9838 no sound is transmitted. Attached is an image of the scope screen I use to monitor the output from the max9860. The signals look good to me so I'm surprised that the LMX does not pick it up. The frame signal is in blue, clock in magenta and data from max9860 in yellow.
I've tried various settings, long and short frame signal, different clock rates etc but to no avail. It appears to me that the LMX codec isn't running at all since the STD output has no signal even if an HSP link is active with another dongle. On the other dongle I hear a quiet noise once the SCO link has been established but nothing from the microphone connected to the max9860 (the PCM signal from max9860 clearly changes when the microphone is excited ).
I have selected PCM-slave mode in the LMX audio settings and the LMX PCM config I use for signals shown on the attached image are:
use slot 0
2 slots per frame
16bit linear
Long frame sync
16 bit word length
Normal frame sync
512kHz clock
PCM settings: 0x03E43F
Can you give me some hints on how to get this to work or how to proceed?
Best regards,
Gunnar.
  • hi , we will assign the query to BT expert and get back to you
    Saurabh
  • Hi Gunnar,

    Can you please check the PCM Slave settings you have?
    Please use:

    "Read PCM slave settings"
    02,52,72,03,00,C7,B2,00,03,03

    You shall read:
    Rx: Event: Read NVS, Status: 00, Address: B200, Data: E4033F

    I am wondering if you do not have the PcmSlaveConfig bytes swapped.

    Regards,
    Julian
  • Hi Julian

    Thanks for your reply.

    I tried reversing the bytes but still no luck. I've tried long and short frame syncs but neither works.

    When I use the Motorola MC145483 and run the MAX9860 as a slave I get the sound through. This is however not optimal since the mode uses only 13 bits of the data instead of 16. For this setup to work I must use PLL mode in the MAX9860 to lock onto the LRCLK signal. Configuring the LRCLK as 8kHz doesn't work.

    I'm wondering if the same applies to the PCM mode, i.e. that configuring PCM-slave mode with the 512kHz bit-clock frequency used by the MAX9860 does not work? The frequencies of the signals generated by the MAX9860 are 7.99991kHz and 511.994kHz for the LRCLK and bit-clock respectively.

    Do you know if the LMX9838 and MAX9860 should work together? 

    I stumbled on a comment in the MAX9860 linux driver regarding the max9860 slave mode:

    /*
    * Check if Integer Clock Mode is possible, but avoid it in slave mode
    * since we then do not know if lrclk is derived from pclk and the
    * datasheet mentions that the frequencies have to match exactly in
    * order for this to work.
    */

    Best regards,

    Gunnar.

  • Do you know the latest firmware version for LMX9838? I'm using firmware 2.12, patch 2.

    The printout in simply blue on device reset is:
    Rx: Event: SimplyBlue Ready, SW Version: 0212 (Patch 2)
  • Hi Gunnar,

    1. The version presented by the LMX9838 on reset is the latest one and is correct.
    2. I still would like to know what is the result of reading PCM Slave settings.
    Please use:

    Read PCM slave settings: 02,52,72,03,00,C7,B2,00,03,03

    and let me know the result.

    3. Please correct your frame signal. It should be 16 bit (one slot) long.

    Regards,
    Julian
  • Hi Gunnar,

    I confirm the PCM slave settings must be E4033F so the reading from SimplyBlueCommander shall look like this:

    Rx: Event: Read NVS, Status: 00, Address: B200, Data: E4033F

     

    We run our test at 520kHz clock so our Fcps was 64 = 0x40 and PCM settings were E40340. The reason of the problem is an incorrect 32 bits long frame. The frame shall be set to 16 bits as explained in chapter 5.5.3.1.2 Using PCM Slave.

     

    Incorrect, 32 bits long frame example for which the slave is not receiving data.


     

    Correct, 16 bits long frame example for which the slave is receiving data correctly.

     

     

    Regards,

    Julian

     

  • Hi Julian

    Thanks for your reply. I've been busy with other things so I couldn't try this out any sooner.

    The value returned by read pcm slave config for the Long frame configuration is:

    Rx: Event: Read NVS, Status: 00, Address: B200, Data: E4033F
    

    The long frame signal generated by the MAX9860 chip is a left/right clock signal. Hence I can't configure it to frame the 16 bits of data as you suggest. The data of interest is the left channel which has 16 bits of data framed by a 32 bit frame. I thought that this should be possible since the pcm-slave can be configured to have 2 slots per frame?

    I also tried it with the master running in short frame pulse mode, without any luck. The pcm-slave configuration I used is:

      Rx: Event: Read NVS, Status: 00, Address: B200, Data: 64033F

    In this mode the master sends the left and right channels in the first 32bits following the frame pulse.

    As a side note to all of this: I am a bit perplexed by the pcm-slave configuration. The command to configure the slave that is included in the Commands.dir collection, which is included with simply blue commander, has a reversed byte order as compared to what you suggest. The command name is "Set PCMSlave: slot0, 1slot, 13bitlin, longfr, 16bit, normal, 520kHz", the read pcm-slave command returns this after sending the pcm-slave config 

      Rx: Event: Read NVS, Status: 00, Address: B200, Data: 03B040
    Best regards,
    Gunnar.
  • Hi Gunnar,

    You are correct about the command.dir file. The bytes should be swapped.

    I'm attaching the corrected file.

    Thanks,

    Julian

    Commands.dir

  • Hi Gunnar,

    The PCM slave settings for long frame are correct but the frame is not and this is the cause of the problem. The PCM Slave has its requirements and one of them is the frame length.

    May I ask for a more detailed view of the short frame length and position? It has to be one clock period long which looks like correct on the scope screen but it also shall have its rising edge on the clock rising edge. It is hard to see but is it not on the falling edge instead?

    The correct sequence for positive short frame is shown below.

    Regards,

    Julian