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.

Why the ADC channel inactive

Other Parts Discussed in Thread: TLV320ADC3140

Hi,

I am using tlv320adc3140 to record audio file. But when I finished recording, there is no sound in my file. I checked the register dumped as below with the correct one (we have a correct settting dump). we found a problem that the DEV_STS0 and DEV_STS1 register showing that all the adc channels were powered down.  I checked my setting in related register(Like PWR_CFG,IN_CH_EN,ASI_OUT_CH_EN). I didn't find any problem. Do you know why?  

Our intention is using one channel to record mic input audio. 

000: 00
001: 00
002: 81
003: 00
004: 00
005: 05
006: 00
007: 40
008: 00
009: 00
00a: 00
00b: 00
00c: 20
00d: 02
00e: 03
00f: 04
010: 05
011: 06
012: 07
013: 02
014: 48
015: 48
016: 10
017: 00
018: 00
019: 00
01a: 00
01b: 00
01c: 00
01d: 00
01e: 00
01f: 40
020: 00
021: 22
022: 00
023: 00
024: 00
025: 00
026: 00
027: 00
028: 00
029: 00
02a: 00
02b: 00
02c: 00
02d: 00
02e: 00
02f: 00
030: 00
031: 00
032: 00
033: ff
034: 00
035: 00
036: 00
037: 00
038: 00
039: 00
03a: 00
03b: 60
03c: 00
03d: 00
03e: cf
03f: 80
040: 00
041: 00
042: 00
043: c9
044: 80
045: 00
046: 00
047: 00
048: c9
049: 80
04a: 00
04b: 00
04c: 00
04d: c9
04e: 80
04f: 00
050: 00
051: 00
052: c9
053: 80
054: 00
055: 00
056: 00
057: c9
058: 80
059: 00
05a: 00
05b: 00
05c: c9
05d: 80
05e: 00
05f: 00
060: 00
061: c9
062: 80
063: 00
064: 00
065: 00
066: 00
067: 00
068: 00
069: 00
06a: 00
06b: 01
06c: 48
06d: 7b
06e: 00
06f: 00
070: 3d
071: 00
072: 00
073: 80
074: 80
075: e0

  • Kindly measure the ws clk and bck during recording. Thanks

  • I can see bck and ws clk even before recording. 

  • And Dout also, there is always data in that pin even without recording. Is that correct?

  • Kindly post the clk waveform and what command you used?

    run amixer in shell to check how many kcontrols in the system for adc3140.

    One more thing, what mic you used, digital or analog mic?

  • The command is

    adsdev@RogueOne:~ $ arecord -Dhw:0,0 -d 10 -f dat -r 44100 -c 2 -t wav test.wav
    Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
    adsdev@RogueOne:~ $

    We use analog mic. 

    I don't know how to post the waveform here.


    adsdev@RogueOne:~ $ amixer controls
    numid=4,iface=MIXER,name='Master Playback Switch'
    numid=3,iface=MIXER,name='Master Playback Volume'
    numid=2,iface=MIXER,name='Capture Switch'
    numid=1,iface=MIXER,name='Capture Volume'

  • Hi Yang,

    Could you help to check the interrupt status(INT_LTCH0) during recording? Did you use the Linux driver of this link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/sound/soc/codecs/tlv320adcx140.c

    I found something different with this code, can you share me more about code and error log, I think maybe, because the unmute function has not been called.

    Thanks

  • Hi Yang,

    I don't think there will be data transfer in case of power down. Could you double check the registers dump during recording and share to us?

    Thanks

  • Hi Kevin,

    please find it below

    adsdev@RogueOne:~ $ sudo cat /sys/kernel/debug/regmap/1-004c/registers
    000: 00
    001: 00
    002: 81
    003: 00
    004: 00
    005: 05
    006: 00
    007: 40
    008: 00
    009: 00
    00a: 00
    00b: 00
    00c: 20
    00d: 02
    00e: 03
    00f: 04
    010: 05
    011: 06
    012: 07
    013: 02
    014: 48
    015: 44
    016: 10
    017: 00
    018: 00
    019: 00
    01a: 00
    01b: 00
    01c: 00
    01d: 00
    01e: 00
    01f: 40
    020: 00
    021: 22
    022: 00
    023: 00
    024: 00
    025: 00
    026: 00
    027: 00
    028: 00
    029: 00
    02a: 00
    02b: 00
    02c: 00
    02d: 00
    02e: 00
    02f: 00
    030: 00
    031: 00
    032: 00
    033: ff
    034: 00
    035: 00
    036: 80
    037: 00
    038: 00
    039: 00
    03a: 00
    03b: 60
    03c: 00
    03d: 00
    03e: cf
    03f: 80
    040: 00
    041: 00
    042: 00
    043: c9
    044: 80
    045: 00
    046: 00
    047: 00
    048: c9
    049: 80
    04a: 00
    04b: 00
    04c: 00
    04d: c9
    04e: 80
    04f: 00
    050: 00
    051: 00
    052: c9
    053: 80
    054: 00
    055: 00
    056: 00
    057: c9
    058: 80
    059: 00
    05a: 00
    05b: 00
    05c: c9
    05d: 80
    05e: 00
    05f: 00
    060: 00
    061: c9
    062: 80
    063: 00
    064: 00
    065: 00
    066: 00
    067: 00
    068: 00
    069: 00
    06a: 00
    06b: 01
    06c: 48
    06d: 7b
    06e: 00
    06f: 00
    070: 3d
    071: 00
    072: 00
    073: 70
    074: 80
    075: e0
    076: 00
    077: c0

  • Hi Kevin,

    I found when it is recording, 0x73(IN_CH_EN) is 0x70 which is wrong. When it is not recording, it is 0x80 which is correct. 

  • Hi,

    After restore to the original code(I modified something), it seems now the register about adc channel power up is correct. But still I can't hear any sound in my recorded file. Please help to see below register dump and ignore the previous one. 

    Another problem is about unmute function you mentioned about. Where is it?

    adsdev@RogueOne:~ $ sudo cat /sys/kernel/debug/regmap/1-004c/registers
    000: 00
    001: 00
    002: 81
    003: 00
    004: 00
    005: 05
    006: 00
    007: 40
    008: 00
    009: 00
    00a: 00
    00b: 00
    00c: 01
    00d: 02
    00e: 03
    00f: 04
    010: 05
    011: 06
    012: 07
    013: 02
    014: 48
    015: 44
    016: 10
    017: 00
    018: 00
    019: 00
    01a: 00
    01b: 00
    01c: 00
    01d: 00
    01e: 00
    01f: 40
    020: 00
    021: 22
    022: 00
    023: 00
    024: 00
    025: 00
    026: 00
    027: 00
    028: 00
    029: 00
    02a: 00
    02b: 00
    02c: 00
    02d: 00
    02e: 00
    02f: 00
    030: 00
    031: 00
    032: 00
    033: ff
    034: 00
    035: 00
    036: 00
    037: 00
    038: 00
    039: 00
    03a: 00
    03b: 60
    03c: 00
    03d: 00
    03e: c9
    03f: 80
    040: 00
    041: 00
    042: 00
    043: c9
    044: 80
    045: 00
    046: 00
    047: 00
    048: c9
    049: 80
    04a: 00
    04b: 00
    04c: 00
    04d: c9
    04e: 80
    04f: 00
    050: 00
    051: 00
    052: c9
    053: 80
    054: 00
    055: 00
    056: 00
    057: c9
    058: 80
    059: 00
    05a: 00
    05b: 00
    05c: c9
    05d: 80
    05e: 00
    05f: 00
    060: 00
    061: c9
    062: 80
    063: 00
    064: 00
    065: 00
    066: 00
    067: 00
    068: 00
    069: 00
    06a: 00
    06b: 01
    06c: 40
    06d: 7b
    06e: 00
    06f: 00
    070: e7
    071: 00
    072: 00
    073: f0
    074: 80
    075: e0
    076: f0
    077: e0
    078: 00

  • One more important found out is there is no data output in Dout pin. 

  • Hi Yang,

    I checked the registers dump and didn't see potential issues, we need to confirm whether your hardware is matched the configuration or not.

    BTW, I mixed the driver, this code have no mute function, and I didn't see the corresponding amixer kcontrol in the previous message, can you use the command of amixer contents to check, we should see below controls:

    Thanks

  • adsdev@RogueOne:~ $ amixer contents
    numid=4,iface=MIXER,name='Master Playback Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=on
    numid=3,iface=MIXER,name='Master Playback Volume'
    ; type=INTEGER,access=rw------,values=2,min=0,max=65536,step=1
    : values=65536,65536
    numid=2,iface=MIXER,name='Capture Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=on
    numid=1,iface=MIXER,name='Capture Volume'
    ; type=INTEGER,access=rw------,values=2,min=0,max=65536,step=1
    : values=65536,65536

  • adsdev@RogueOne:~ $ amixer -c 0 contents
    numid=8,iface=MIXER,name='AGC Max Gain'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=13,step=0
    : values=7
    | dBscale-min=3.00dB,step=3.00dB,mute=0
    numid=7,iface=MIXER,name='AGC Threshold'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=15,step=0
    : values=14
    | dBscale-min=-36.00dB,step=2.00dB,mute=0
    numid=1,iface=MIXER,name='Analog CH1 Mic Gain Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=42,step=0
    : values=0
    | dBscale-min=0.00dB,step=1.00dB,mute=0
    numid=2,iface=MIXER,name='Analog CH2 Mic Gain Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=42,step=0
    : values=0
    | dBscale-min=0.00dB,step=1.00dB,mute=0
    numid=3,iface=MIXER,name='Analog CH3 Mic Gain Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=42,step=0
    : values=0
    | dBscale-min=0.00dB,step=1.00dB,mute=0
    numid=4,iface=MIXER,name='Analog CH4 Mic Gain Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=42,step=0
    : values=0
    | dBscale-min=0.00dB,step=1.00dB,mute=0
    numid=30,iface=MIXER,name='CH1_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=39,iface=MIXER,name='CH1_DRE_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=31,iface=MIXER,name='CH2_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=40,iface=MIXER,name='CH2_DRE_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=32,iface=MIXER,name='CH3_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=41,iface=MIXER,name='CH3_DRE_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=33,iface=MIXER,name='CH4_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=42,iface=MIXER,name='CH4_DRE_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=34,iface=MIXER,name='CH5_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=35,iface=MIXER,name='CH6_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=36,iface=MIXER,name='CH7_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=37,iface=MIXER,name='CH8_ASI_EN Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=6,iface=MIXER,name='DRE Max Gain'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=12,step=0
    : values=11
    | dBscale-min=2.00dB,step=2.00dB,mute=0
    numid=5,iface=MIXER,name='DRE Threshold'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=9,step=0
    : values=7
    | dBscale-min=-66.00dB,step=1.00dB,mute=0
    numid=38,iface=MIXER,name='DRE_ENABLE Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    numid=48,iface=MIXER,name='Decimation Filter'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Linear Phase'
    ; Item #1 'Low Latency'
    ; Item #2 'Ultra-low Latency'
    : values=0
    numid=9,iface=MIXER,name='Digital CH1 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=10,iface=MIXER,name='Digital CH2 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=11,iface=MIXER,name='Digital CH3 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=12,iface=MIXER,name='Digital CH4 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=13,iface=MIXER,name='Digital CH5 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=14,iface=MIXER,name='Digital CH6 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=15,iface=MIXER,name='Digital CH7 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=16,iface=MIXER,name='Digital CH8 Out Volume'
    ; type=INTEGER,access=rw---R--,values=1,min=0,max=255,step=0
    : values=201
    | dBscale-min=-100.50dB,step=0.50dB,mute=0
    numid=43,iface=MIXER,name='IN1 Analog Mic Resistor'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 '2.5 kOhm'
    ; Item #1 '10 kOhm'
    ; Item #2 '20 kOhm'
    : values=0
    numid=44,iface=MIXER,name='IN2 Analog Mic Resistor'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 '2.5 kOhm'
    ; Item #1 '10 kOhm'
    ; Item #2 '20 kOhm'
    : values=0
    numid=45,iface=MIXER,name='IN3 Analog Mic Resistor'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 '2.5 kOhm'
    ; Item #1 '10 kOhm'
    ; Item #2 '20 kOhm'
    : values=0
    numid=46,iface=MIXER,name='IN4 Analog Mic Resistor'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 '2.5 kOhm'
    ; Item #1 '10 kOhm'
    ; Item #2 '20 kOhm'
    : values=0
    numid=22,iface=MIXER,name='MIC1 Analog Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=2
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    : values=0
    numid=26,iface=MIXER,name='MIC1M Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=18,iface=MIXER,name='MIC1P Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=23,iface=MIXER,name='MIC2 Analog Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=2
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    : values=0
    numid=27,iface=MIXER,name='MIC2M Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=19,iface=MIXER,name='MIC2P Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=24,iface=MIXER,name='MIC3 Analog Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=2
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    : values=0
    numid=28,iface=MIXER,name='MIC3M Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=20,iface=MIXER,name='MIC3P Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=25,iface=MIXER,name='MIC4 Analog Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=2
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    : values=0
    numid=29,iface=MIXER,name='MIC4M Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=21,iface=MIXER,name='MIC4P Input Mux'
    ; type=ENUMERATED,access=rw------,values=1,items=3
    ; Item #0 'Analog'
    ; Item #1 'Line In'
    ; Item #2 'Digital'
    : values=0
    numid=47,iface=MIXER,name='PDM Clk Div Select'
    ; type=ENUMERATED,access=rw------,values=1,items=4
    ; Item #0 '2.8224 MHz'
    ; Item #1 '1.4112 MHz'
    ; Item #2 '705.6 kHz'
    ; Item #3 '5.6448 MHz'
    : values=0
    numid=17,iface=MIXER,name='Phase Calibration Switch'
    ; type=BOOLEAN,access=rw------,values=1
    : values=off
    adsdev@RogueOne:~ $

  • Hi Yang,

    I saw the 'CH1_ASI_EN Switch' is turned off, can you turn on it and try again?

    Thanks

  • It is the same.

  • Hi Yang,

    I can share a configuration with only enabling one channel as following, could you use the i2cset tool the config registers manually during recording? Then see if there is dataout from the DOUT pin.

    98 is corresponding to i2c address, the second number is registers address, the 3rd one is value.

    # CHECKSUM 0
    # Generated by ADCx140EVM-SW v3.0.5
    # TLV320ADC3140 device configuration
    # -----------------------------------------------------------------------------
    # Reset
    # -----------------------------------------------------------------------------
    # Select Page 0
    w 98 00 00
    # Reset Device
    w 98 01 01
    # 1mS Delay
    # -----------------------------------------------------------------------------
    # Begin Device Memory
    # -----------------------------------------------------------------------------
    # Page 0 (0x00) Dump
    # Select Page 0
    w 98 00 00
    # Wake up and enable AREG
    w 98 02 81
    # ASI Configuration
    w 98 07 70
    # GPI Configuration
    w 98 3b 60
    #DSP configuration
    w 98 6c 48
    # Channel Input/Output Configuration
    w 98 73 80
    w 98 74 80
    # Power up/down
    # Select page 0
    w 98 00 00
    w 98 75 80

    Thanks

  • Hi Kevin,

    it can not be set.

    adsdev@RogueOne:~ $ i2cset -y 1 0x4c 0x00 0x00
    Error: Could not set address to 0x4c: Device or resource busy
    adsdev@RogueOne:~ $ sudo i2cdetect -r -y 1
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: 40 -- -- -- -- -- -- -- -- -- -- -- UU -- -- --
    50: -- -- -- -- 54 -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- 65 -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    adsdev@RogueOne:~ $ i2cset -y 1 0x4c 0x00 0x00
    Error: Could not set address to 0x4c: Device or resource busy

  • If remove tlv320adcx140 drive from kernel and set these config manually. They can be set as no one occupied the address. But I couldn't see DOUT having output. 

  • Hi Yang,

    Thanks for the confirmation, so that might not relate to the configuration, we can have short meeting to locate the issue, my email is kevin-lu@ti.com 

  • Hi Kevin,

    We found that with your script, only when we lower the clock of the bclk by Purepath to 3Mhz, and then it would work. 

    Sure, let's arrange a meeting.

  • Having almost the identical problem. What was the solution in the end?