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.

Linux/LM49350: PCM no sounds. please help to check

Part Number: LM49350

Tool/software: Linux

I have a loopback PCM module connected to LM49350.  when I test there is no sound,  and when I test  AUX out  directy by  left/right  MIC input , that's ok.  I thinks maybe where same wrong ADC/DAC configration. please help check.

LM49350 slave.    mclk 2M, L/R frame rate 128K.  

lm49350 basic setting.

snd_soc_write(codec, 0x00, 0x00);
       snd_soc_write(codec, 0x01, 0x00);
       snd_soc_write(codec, 0x02, 0x0c);  //from 2.048M to 300KHz (6.5*2-1=12=0xc)
   
       snd_soc_write(codec, 0x03, 0x00);
       snd_soc_write(codec, 0x10, 0x00);   //spk , all off
       snd_soc_write(codec, 0x11, 0x03);   // DAC to headphone L
       snd_soc_write(codec, 0x12, 0x03);   // DAC to headphone R
       snd_soc_write(codec, 0x13, 0x03);   // DAC  to aux out
       snd_soc_write(codec, 0x15, 0x0c);   //ADC input select , MIC
    snd_soc_write(codec, 0x16, 0x0f);   //mic level l 36db
    snd_soc_write(codec, 0x17, 0x0f);   //mic level r 36db
   
       snd_soc_write(codec, 0x20, 0x03);   //ADC_BASIC mono with 128 OSR, mclk as default
       snd_soc_write(codec, 0x21, 0x01);   //ADC_CLOCK    2048  / [2*128(osr)*8(8K sample)]
      
       snd_soc_write(codec, 0x30, 0x01);   //128  OSR  &  MCLK source
       snd_soc_write(codec, 0x31, 0x01);   // dived 1
    snd_soc_write(codec, 0x40, 0x12);   //port level  port1&&port2 0db
    snd_soc_write(codec, 0x41, 0x00);   // adc level all 0db
    snd_soc_write(codec, 0x42, 0x25);   //mono from adc
       snd_soc_write(codec, 0x44, 0x09);  //select port1 l&r to DAC, need recheck remove R for mono mode??
    //snd_soc_write(codec, 0x45, 0x09);  //???
       snd_soc_write(codec, 0x50, 0x3e);  //AUDIO_PORT1_BASIC
       snd_soc_write(codec, 0x51, 0x1f); 
       snd_soc_write(codec, 0x53, 0x0a);  //mono 16bits && sync width 1 clocks  looks like msm01 receipt only 32bits data  37 or 0a?
       snd_soc_write(codec, 0x54, 0x1b); //tx rx both 16bit
       snd_soc_write(codec, 0x55, 0x02); //rx mode, MSB, PCM short
       snd_soc_write(codec, 0x56, 0x02); //tx mode, MSB, PCM short
      // snd_soc_write(codec, 0x23, 0x0f);  //ADC_MIXER    ??
       snd_soc_write(codec, 0x80, 0x00);  //ADC_EFFECTS_HPF
       snd_soc_write(codec, 0x84, 0x0a);
       snd_soc_write(codec, 0x85, 0x0a);
       snd_soc_write(codec, 0x86, 0x0a);
       snd_soc_write(codec, 0x87, 0x1f);
       snd_soc_write(codec, 0x89, 0x33);
       snd_soc_write(codec, 0x8A, 0x33);
       snd_soc_write(codec, 0xA0, 0x02);
       snd_soc_write(codec, 0xA0, 0x0a);
       snd_soc_write(codec, 0xa4, 0x0a);
       snd_soc_write(codec, 0xa5, 0x0a);
       snd_soc_write(codec, 0xa6, 0x33);
       snd_soc_write(codec, 0xa8, 0x1f);  //  DAC level left
       snd_soc_write(codec, 0xa9, 0x1f);   // DAC level   right  
    snd_soc_write(codec, 0xf0, 0x00);
    snd_soc_write(codec, 0x00, 0x01);
  
       pmc_clk_d=snd_soc_read(codec, 0x02);
    pr_err("I2C read of PMC_CLK_DIV:%d\n",pmc_clk_d);
lm49350 route setting.
   snd_soc_write(codec, 0x11, 0x00);
   snd_soc_write(codec, 0x12, 0x00);
   snd_soc_write(codec, 0x13, 0x03);
  • I also paste the final register settings when I do the test

    msm8953_64:/sys/kernel/debug/regmap/2-001a# cat registers
    00: 01
    01: 00
    02: 0c
    03: 00
    04: 00
    05: 00
    06: 00
    07: 00
    08: 00
    09: 00
    0a: 00
    0b: 00
    0c: 00
    0d: 00
    0e: 00
    0f: 00
    10: 00
    11: 00
    12: 00
    13: 03
    14: 00
    15: 08
    16: 0f
    17: 0f
    18: 00
    19: 00
    1a: 00
    1b: 00
    1c: 00
    1d: 00
    1e: 00
    1f: 00
    20: 03
    21: 01
    22: 00
    23: 00
    24: 00
    25: 00
    26: 00
    27: 00
    28: 00
    29: 00
    2a: 00
    2b: 00
    2c: 00
    2d: 00
    2e: 00
    2f: 00
    30: 01
    31: 01
    32: 00
    33: 00
    34: 00
    35: 00
    36: 00
    37: 00
    38: 00
    39: 00
    3a: 00
    3b: 00
    3c: 00
    3d: 00
    3e: 00
    3f: 00
    40: 12
    41: 00
    42: 25
    43: 00
    44: 09
    45: 00
    46: 00
    47: 00
    48: 00
    49: 00
    4a: 00
    4b: 00
    4c: 00
    4d: 00
    4e: 00
    4f: 00
    50: 3e
    51: 1f
    52: 00
    53: 0a
    54: 1b
    55: 02
    56: 02
    57: 00
    58: 00
    59: 00
    5a: 00
    5b: 00
    5c: 00
    5d: 00
    5e: 00
    5f: 00
    60: 01
    61: 00
    62: 00
    63: 00
    64: 00
    65: 00
    66: 00
    67: 01
    68: 01
    69: 00
    6a: 01
    6b: 00
    6c: 00
    6d: 00
    6e: 00
    6f: 02
    70: 02
    71: 00
    72: 00
    73: 00
    74: 00
    75: 00
    76: 00
    77: 00
    78: 00
    79: 80
    7a: bb
    7b: 80
    7c: bb
    7d: 00
    7e: 00
    7f: 00
    80: 00
    81: 00
    82: 00
    83: 00
    84: 0a
    85: 0a
    86: 0a
    87: 1f
    88: 0f
    89: 33
    8a: 33
    8b: 33
    8c: 73
    8d: 33
    8e: 73
    8f: 33
    90: 73
    91: 33
    92: 73
    93: 33
    94: 73
    95: 33
    96: 73
    97: 33
    98: 00
    99: 00
    9a: 00
    9b: 00
    9c: 00
    9d: 00
    9e: 00
    9f: 00
    a0: 0a
    a1: 00
    a2: 00
    a3: 00
    a4: 0a
    a5: 0a
    a6: 33
    a7: 00
    a8: 1f
    a9: 1f
    aa: 00
    ab: 00
    ac: 00
    ad: 00
    ae: 00
    af: 00
    b0: 00
    b1: 00
    b2: 00
    b3: 00
    b4: 00
    b5: 00
    b6: 00
    b7: 00
    b8: 00
    b9: 00
    ba: 00
    bb: 00
    bc: 00
    bd: 00
    be: 00
    bf: 00
    c0: 00
    c1: 00
    c2: 00
    c3: 00
    c4: 00
    c5: 00
    c6: 00
    c7: 00
    c8: 00
    c9: 00
    ca: 00
    cb: 00
    cc: 00
    cd: 00
    ce: 00
    cf: 00
    d0: 06
    d1: 00
    d2: 08
    d3: 54
    d4: 14
    d5: 0d
    d6: 0d
    d7: 14
    d8: 60
    d9: 00
    da: 00
    db: 00
    dc: 00
    dd: 00
    de: 00
    df: 00
    e0: 00
    e1: 00
    e2: 00
    e3: 00
    e4: 00
    e5: 00
    e6: 00
    e7: 00
    e8: 00
    e9: 00
    ea: 00
    eb: 00
    ec: 00
    ed: 00
    ee: 00
    ef: 00
    f0: 00
    f1: 00
    f2: 00
    f3: 00
    f4: 00
    f5: 00
    f6: 00
    f7: 00
    f8: 00
    f9: 00
    fa: 00
    fb: 00
    fc: 00
    fd: 00
    fe: 00
  • Flyer,

    can you clarify your first post?

    you say the L/R frame rate is 128k? This doesn't seem right to me, especially since you seem to be referencing a frame rate of 8k later on in the script.

    additionally, you seem to set the OSR for 128, but in 0x21 and ox31 you seem to set it up for 256 (assuming 2.048Mhz MCLK)

    please clarify what you are trying to do. and we can go from there.

    -Steve Wilson
  • Flyer,

    I think i see now. Your PORT1_CLK is 128K, and your Sync Clock is 8k, correct?

    I will take a look at your configuration and get right back to you
    -STeve
  • hi  Steve-Wilson:

    Steve-Wilson said:
    Flyer,

    I think i see now. Your PORT1_CLK is 128K, and your Sync Clock is 8k, correct?

    I will take a look at your configuration and get right back to you
    -STeve

     yes, I didn't descrip clearly,   LM48350  MCLK 2.048M  PCM: SCLK 128k,  SYNC 8k.   and IN/OUT about  ~24K,  all these data are measured by osclilloscope. 

    I want to ask a question if I  short PCM  in/out data (means connect them direclty, and disconnect from my pcm loopback device), and only supply these three MCLK、SCLK,SYNC CLK from pcm loopback device,    could LM49350  do ADC/DAC ?   so I can confirm my pcm loopback device is ok or not ?

  • Flyer,

    Yes, you can route the SDO to the SDI and you should be able to pass the ADC audio to the DAC.

    best regards,
    -Steve
  • the whole route is
    1 mic to ADC --- 0x15 register bit[3:2]
    2 ADC to PORT 1 TX --- 0x42 register bit[3:0] == b0101
    3 PORT1 TX to PORT 1 RX ----by hardware connect the port 1 SDO&SDI
    4 PORT 1 RX ---ADC ---by setting 0x44 bit0 and bit3
    5 ADC ---to HPL/AUX by setting 0x11/0x12/0x13 select DAC_HPL/DAC_* bit[1:0]

    this is my understanding.

    "you can route the SDO to the SDI and you should be able to pass the ADC audio to the DAC"
    I can't understand this clearly. you mean by modify 0x15[1:0] to b11?

    the ADC/DAC(0x20,0x30,0x50) basic setting, I am not confirm, is my configration correct ?
  • I connect the SDO/SDI , all are nosie.
  • Flyer,

    Do you see Data on the SDO line? ie are bits toggling?

    best regards,
    -STeve Wilson
  • STeve Wilson:

      yes, there are signals both on SDO and SDI 

  • Flyer,

    What is the amplitude of the noise?
    best regards,
    -STeve Wilson
  • STeve Wilson,
    only noise and very large