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.

TLV320AIC3109-Q1: No sound in audio recording

Part Number: TLV320AIC3109-Q1


Hello,

I want to use the TLV320AIC3109 audio codec on my custom i.MX8M board.

I have two microphones connected on Line1 and Line2:

I configured the sound device in the device tree file:

sound-myboard {
    compatible = "simple-audio-card";
    simple-audio-card,bitclock-master = <&dailink_master>;
    simple-audio-card,format = "i2s";
    simple-audio-card,frame-master = <&dailink_master>;
    simple-audio-card,mclk-fs = <32>;
    simple-audio-card,name = "myboard";
    simple-audio-card,routing =
        "LINE1L", "Line In",
        "LINE1R", "Line In",
        "Line In", "Mic Bias";
    simple-audio-card,widgets =
        "Line", "Line In";

    dailink_master: simple-audio-card,cpu {
        sound-dai = <&sai2>;
    };

    simple-audio-card,codec {
        sound-dai = <&tlv320aic3109>;
    };
};

I enabled the codec SND_SOC_TLV320AIC3X in the kernel config.

I can see that the device found in the kernel messages:

[ 2.270140] ALSA device list:
[ 2.273127] #0: myboard

But when I try to test the recording with:

arecord -t wav -c 2 -r 44100 -f -d 5 S16_LE /tmp/test.wav

No sound is audible in the file.

amixer outputs the following settings:

numid=15,iface=MIXER,name='PCM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=127,step=0
  : values=80,80
  | dBscale-min=-63.50dB,step=0.50dB,mute=0
numid=29,iface=MIXER,name='Line DAC Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=7,iface=MIXER,name='Line Line2 Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=118,118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=28,iface=MIXER,name='Line PGA Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=35,iface=MIXER,name='Line Playback Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on
numid=34,iface=MIXER,name='Line Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=9,step=0
  : values=0,0
  | dBscale-min=0.00dB,step=1.00dB,mute=0
numid=12,iface=MIXER,name='Mono DAC Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=10,iface=MIXER,name='Mono Line2 Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=111,iface=MIXER,name='Mono Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=114,iface=MIXER,name='Mono Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=109,iface=MIXER,name='Mono Mixer Line2L Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=112,iface=MIXER,name='Mono Mixer Line2R Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=110,iface=MIXER,name='Mono Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=113,iface=MIXER,name='Mono Mixer PGAR Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=11,iface=MIXER,name='Mono PGA Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=13,iface=MIXER,name='Mono Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=14,iface=MIXER,name='Mono Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=9,step=0
  : values=0
  | dBscale-min=0.00dB,step=1.00dB,mute=0
numid=50,iface=MIXER,name='ADC HPF Cut-off'
  ; type=ENUMERATED,access=rw------,values=2,items=4
  ; Item #0 'Disabled'
  ; Item #1 '0.0045xFs'
  ; Item #2 '0.0125xFs'
  ; Item #3 '0.025xFs'
  : values=0,0
numid=40,iface=MIXER,name='AGC Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=off,off
numid=47,iface=MIXER,name='De-emphasis Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=off,off
numid=31,iface=MIXER,name='HP DAC Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=8,iface=MIXER,name='HP Line2 Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=30,iface=MIXER,name='HP PGA Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=37,iface=MIXER,name='HP Playback Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on
numid=36,iface=MIXER,name='HP Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=9,step=0
  : values=0,0
  | dBscale-min=0.00dB,step=1.00dB,mute=0
numid=33,iface=MIXER,name='HPCOM DAC Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=9,iface=MIXER,name='HPCOM Line2 Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=32,iface=MIXER,name='HPCOM PGA Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=118,step=0
  : values=71,71
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=39,iface=MIXER,name='HPCOM Playback Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on
numid=38,iface=MIXER,name='HPCOM Playback Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=9,step=0
  : values=0,0
  | dBscale-min=0.00dB,step=1.00dB,mute=0
numid=43,iface=MIXER,name='Left AGC Attack time'
  ; type=ENUMERATED,access=rw------,values=1,items=4
  ; Item #0 '8ms'
  ; Item #1 '11ms'
  ; Item #2 '16ms'
  ; Item #3 '20ms'
  : values=0
numid=45,iface=MIXER,name='Left AGC Decay time'
  ; type=ENUMERATED,access=rw------,values=1,items=4
  ; Item #0 '100ms'
  ; Item #1 '200ms'
  ; Item #2 '400ms'
  ; Item #3 '500ms'
  : values=0
numid=41,iface=MIXER,name='Left AGC Target level'
  ; type=ENUMERATED,access=rw------,values=1,items=8
  ; Item #0 '-5.5dB'
  ; Item #1 '-8dB'
  ; Item #2 '-10dB'
  ; Item #3 '-12dB'
  ; Item #4 '-14dB'
  ; Item #5 '-17dB'
  ; Item #6 '-20dB'
  ; Item #7 '-24dB'
  : values=0
numid=53,iface=MIXER,name='Left DAC Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=3
  ; Item #0 'DAC_L1'
  ; Item #1 'DAC_L3'
  ; Item #2 'DAC_L2'
  : values=0
numid=86,iface=MIXER,name='Left HP Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=21,iface=MIXER,name='Left HP Mixer DACR1 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=88,iface=MIXER,name='Left HP Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=89,iface=MIXER,name='Left HP Mixer Line2L Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=90,iface=MIXER,name='Left HP Mixer Line2R Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=3,iface=MIXER,name='Left HP Mixer Line2R Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=85,iface=MIXER,name='Left HP Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=87,iface=MIXER,name='Left HP Mixer PGAR Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=20,iface=MIXER,name='Left HP Mixer PGAR Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=98,iface=MIXER,name='Left HPCOM Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=25,iface=MIXER,name='Left HPCOM Mixer DACR1 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=100,iface=MIXER,name='Left HPCOM Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=101,iface=MIXER,name='Left HPCOM Mixer Line2L Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=102,iface=MIXER,name='Left HPCOM Mixer Line2R Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=5,iface=MIXER,name='Left HPCOM Mixer Line2R Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=97,iface=MIXER,name='Left HPCOM Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=99,iface=MIXER,name='Left HPCOM Mixer PGAR Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=24,iface=MIXER,name='Left HPCOM Mixer PGAR Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=54,iface=MIXER,name='Left HPCOM Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=3
  ; Item #0 'differential of HPLOUT'
  ; Item #1 'constant VCM'
  ; Item #2 'single-ended'
  : values=0
numid=74,iface=MIXER,name='Left Line Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=17,iface=MIXER,name='Left Line Mixer DACR1 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=76,iface=MIXER,name='Left Line Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=77,iface=MIXER,name='Left Line Mixer Line2L Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=78,iface=MIXER,name='Left Line Mixer Line2R Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=1,iface=MIXER,name='Left Line Mixer Line2R Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=73,iface=MIXER,name='Left Line Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=75,iface=MIXER,name='Left Line Mixer PGAR Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=16,iface=MIXER,name='Left Line Mixer PGAR Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=57,iface=MIXER,name='Left Line1L Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=2
  ; Item #0 'single-ended'
  ; Item #1 'differential'
  : values=0
numid=58,iface=MIXER,name='Left Line1R Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=2
  ; Item #0 'single-ended'
  ; Item #1 'differential'
  : values=0
numid=66,iface=MIXER,name='Left Line2L Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=2
  ; Item #0 'single-ended'
  ; Item #1 'differential'
  : values=0
numid=61,iface=MIXER,name='Left PGA Mixer Line1L Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=62,iface=MIXER,name='Left PGA Mixer Line1R Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=63,iface=MIXER,name='Left PGA Mixer Line2L Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=64,iface=MIXER,name='Left PGA Mixer Mic3L Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=65,iface=MIXER,name='Left PGA Mixer Mic3R Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=51,iface=MIXER,name='Output Driver Power-On time'
  ; type=ENUMERATED,access=rw------,values=1,items=12
  ; Item #0 '0us'
  ; Item #1 '10us'
  ; Item #2 '100us'
  ; Item #3 '1ms'
  ; Item #4 '10ms'
  ; Item #5 '50ms'
  ; Item #6 '100ms'
  ; Item #7 '200ms'
  ; Item #8 '400ms'
  ; Item #9 '800ms'
  ; Item #10 '2s'
  ; Item #11 '4s'
  : values=0
numid=52,iface=MIXER,name='Output Driver Ramp-up step'
  ; type=ENUMERATED,access=rw------,values=1,items=4
  ; Item #0 '0ms'
  ; Item #1 '1ms'
  ; Item #2 '2ms'
  ; Item #3 '4ms'
  : values=0
numid=49,iface=MIXER,name='PGA Capture Switch'
  ; type=BOOLEAN,access=rw------,values=2
  : values=on,on
numid=48,iface=MIXER,name='PGA Capture Volume'
  ; type=INTEGER,access=rw---R--,values=2,min=0,max=119,step=0
  : values=119,119
  | dBscale-min=0.00dB,step=0.50dB,mute=0
numid=44,iface=MIXER,name='Right AGC Attack time'
  ; type=ENUMERATED,access=rw------,values=1,items=4
  ; Item #0 '8ms'
  ; Item #1 '11ms'
  ; Item #2 '16ms'
  ; Item #3 '20ms'
  : values=0
numid=46,iface=MIXER,name='Right AGC Decay time'
  ; type=ENUMERATED,access=rw------,values=1,items=4
  ; Item #0 '100ms'
  ; Item #1 '200ms'
  ; Item #2 '400ms'
  ; Item #3 '500ms'
  : values=0
numid=42,iface=MIXER,name='Right AGC Target level'
  ; type=ENUMERATED,access=rw------,values=1,items=8
  ; Item #0 '-5.5dB'
  ; Item #1 '-8dB'
  ; Item #2 '-10dB'
  ; Item #3 '-12dB'
  ; Item #4 '-14dB'
  ; Item #5 '-17dB'
  ; Item #6 '-20dB'
  ; Item #7 '-24dB'
  : values=0
numid=55,iface=MIXER,name='Right DAC Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=3
  ; Item #0 'DAC_R1'
  ; Item #1 'DAC_R3'
  ; Item #2 'DAC_R2'
  : values=0
numid=23,iface=MIXER,name='Right HP Mixer DACL1 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=92,iface=MIXER,name='Right HP Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=94,iface=MIXER,name='Right HP Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=95,iface=MIXER,name='Right HP Mixer Line2L Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=4,iface=MIXER,name='Right HP Mixer Line2L Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=96,iface=MIXER,name='Right HP Mixer Line2R Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=91,iface=MIXER,name='Right HP Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=22,iface=MIXER,name='Right HP Mixer PGAL Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=93,iface=MIXER,name='Right HP Mixer PGAR Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=27,iface=MIXER,name='Right HPCOM Mixer DACL1 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=104,iface=MIXER,name='Right HPCOM Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=106,iface=MIXER,name='Right HPCOM Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=107,iface=MIXER,name='Right HPCOM Mixer Line2L Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=6,iface=MIXER,name='Right HPCOM Mixer Line2L Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=108,iface=MIXER,name='Right HPCOM Mixer Line2R Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=103,iface=MIXER,name='Right HPCOM Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=26,iface=MIXER,name='Right HPCOM Mixer PGAL Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=105,iface=MIXER,name='Right HPCOM Mixer PGAR Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=56,iface=MIXER,name='Right HPCOM Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=5
  ; Item #0 'differential of HPROUT'
  ; Item #1 'constant VCM'
  ; Item #2 'single-ended'
  ; Item #3 'differential of HPLCOM'
  ; Item #4 'external feedback'
  : values=0
numid=19,iface=MIXER,name='Right Line Mixer DACL1 Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=80,iface=MIXER,name='Right Line Mixer DACL1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=82,iface=MIXER,name='Right Line Mixer DACR1 Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=83,iface=MIXER,name='Right Line Mixer Line2L Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=2,iface=MIXER,name='Right Line Mixer Line2L Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=84,iface=MIXER,name='Right Line Mixer Line2R Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=79,iface=MIXER,name='Right Line Mixer PGAL Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=18,iface=MIXER,name='Right Line Mixer PGAL Bypass Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=0,max=118,step=0
  : values=118
  | dBscale-min=-59.00dB,step=0.50dB,mute=1
numid=81,iface=MIXER,name='Right Line Mixer PGAR Bypass Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=59,iface=MIXER,name='Right Line1L Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=2
  ; Item #0 'single-ended'
  ; Item #1 'differential'
  : values=0
numid=60,iface=MIXER,name='Right Line1R Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=2
  ; Item #0 'single-ended'
  ; Item #1 'differential'
  : values=0
numid=72,iface=MIXER,name='Right Line2R Mux'
  ; type=ENUMERATED,access=rw------,values=1,items=2
  ; Item #0 'single-ended'
  ; Item #1 'differential'
  : values=0
numid=68,iface=MIXER,name='Right PGA Mixer Line1L Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=67,iface=MIXER,name='Right PGA Mixer Line1R Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=69,iface=MIXER,name='Right PGA Mixer Line2R Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=70,iface=MIXER,name='Right PGA Mixer Mic3L Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off
numid=71,iface=MIXER,name='Right PGA Mixer Mic3R Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=off

Is there some way to debug why there is no sound in my audio file? Thank you for your help.

  • Add log in the two probe functions in 3109 driver code to check whether both probes have been called.

  • It seems both probe functions are called and executed until end:

    root [ /tmpfs/root ] $ dmesg | grep aic
    [    1.846790]  aic3x_i2c_probe enter
    [    1.850696]  aic3x_i2c_probe exit
    [    2.145669]  aic3x_probe enter
    [    2.148886]  aic3x_probe exit

  • What's the return value in aic3x_prob? Is your system Linux or Android?

  • share the tlv320aic3109 define in DTS

  • The aic3x_probe function executes until the end and returns 0.

    I'm on the Linux Freescale kernel 5.10.72.

  • &i2c4 {
        clock-frequency = <400000>;
        pinctrl-names = "default", "gpio";
        pinctrl-0 = <&pinctrl_i2c4>;
        pinctrl-1 = <&pinctrl_i2c4_gpio>;
        sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        status = "okay";
    
        tlv320aic3109: codec@18 {
            compatible = "ti,tlv320aic3x";
            ai3x-micbias-vg = <MICBIAS_2_0V>;
            pinctrl-names = "default";
            reg = <0x18>;
            #sound-dai-cells = <0>;
            /* Regulators */
            DRVDD-supply = <&reg_3p3v>;
            AVDD-supply = <&reg_3p3v>;
            IOVDD-supply = <&reg_1p8v>;
            DVDD-supply = <&reg_1p8v>;
        };
    };

  • I have not seen the dai-link definition, like following

  • I have slightly adapted my sound card defintion:

    sound-myboard {
        compatible = "simple-audio-card";
        simple-audio-card,name = "myboard";
        simple-audio-card,routing =
            "LINE1L", "Line In",
            "LINE1R", "Line In",
            "Line In", "Mic Bias";
        simple-audio-card,widgets =
            "Line", "Line In";
    
        simple-audio-card,dai-link@0 {
            format = "i2s";
            bitclock-master = <&sound0_master>;
            frame-master = <&sound0_master>;
            mclk-fs = <32>;
            sound0_master: cpu {
                sound-dai = <&sai2>;
            };
            codec {
                sound-dai = <&tlv320aic3109>;
            };
        };
    };
    
    &i2c4 {
        clock-frequency = <400000>;
        pinctrl-names = "default", "gpio";
        pinctrl-0 = <&pinctrl_i2c4>;
        pinctrl-1 = <&pinctrl_i2c4_gpio>;
        sda-gpios = <&gpio5 21 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        scl-gpios = <&gpio5 20 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
        status = "okay";
    
        tlv320aic3109: codec@18 {
            compatible = "ti,tlv320aic3x";
            ai3x-micbias-vg = <MICBIAS_2_0V>;
            pinctrl-names = "default";
            reg = <0x18>;
            #sound-dai-cells = <0>;
            /* Regulators */
            DRVDD-supply = <&reg_3p3v>;
            AVDD-supply = <&reg_3p3v>;
            IOVDD-supply = <&reg_1p8v>;
            DVDD-supply = <&reg_1p8v>;
        };
    };
    
    &sai2 {
        assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
        assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
        assigned-clock-rates = <12288000>;
        clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI2_IPG>,
             <&clk IMX8MP_CLK_DUMMY>,
             <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI2_MCLK1>,
             <&clk IMX8MP_CLK_DUMMY>,
             <&clk IMX8MP_CLK_DUMMY>,
             <&clk IMX8MP_AUDIO_PLL1_OUT>,
             <&clk IMX8MP_AUDIO_PLL2_OUT>;
        clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
        fsl,sai-synchronous-rx;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_sai2>;
        status = "okay";
        #sound-dai-cells = <0>;
    };

    Still the same problem. Sound card is found during boot, arecord seems to be working but no audio to hear in the recorded sound file.

  • Kindly measure the I2S clk both bit bck and WS clk with scope and share the waveform.

  • This is the output for the whole 1 second record:

    1-sec-record

    The clocks look like this:

    clocks

  • Hi Guy

    I can not see your clock and 1-sec-record icons

  • Hi

    I can't confirm the freq of bck and WS clk. One more thing, dump the register with me. thanks.

  • Hi,

    here is the register dump of the device:

    root [ /tmpfs/root ] $ i2cdump -y -f 3 0x18
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 20    ...??......?...
    10: 20 ff ff 00 78 78 00 78 78 46 00 fe 00 00 fe 00     ...xx.xxF.?..?.
    20: 00 00 00 00 22 00 00 00 40 00 00 af af 2f 2f af    ...."...@..??//?
    30: 00 00 00 0c 2f 2f af 00 00 00 0c 00 00 00 2f 2f    ...?//?...?...//
    40: af 0c 00 00 00 2f 2f af 0c 2f 2f af 2f 2f af 08    ??...//??//?//??
    50: 2f 2f af 00 00 00 08 00 00 00 2f 2f af 08 00 00    //?...?...//??..
    60: 00 03 00 00 00 00 02 00 00 00 00 00 00 00 00 00    .?....?.........
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    80: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 20    ...??......?...
    90: 20 ff ff 00 78 78 00 78 78 46 00 fe 00 00 fe 00     ...xx.xxF.?..?.
    a0: 00 00 00 00 22 00 00 00 40 00 00 af af 2f 2f af    ...."...@..??//?
    b0: 00 00 00 0c 2f 2f af 00 00 00 0c 00 00 00 2f 2f    ...?//?...?...//
    c0: af 0c 00 00 00 2f 2f af 0c 2f 2f af 2f 2f af 08    ??...//??//?//??
    d0: 2f 2f af 00 00 00 08 00 00 00 2f 2f af 08 00 00    //?...?...//??..
    e0: 00 03 00 00 00 00 02 00 00 00 00 00 00 00 00 00    .?....?.........
    f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................

    I will recheck my measures and see if I made a mistake.

  • Dear Shenghao Ding, I have found the issue:

    It was this setting in the i.MX8 SAI interface:

    fsl,sai-synchronous-rx;

    After removing this setting, sound is correctly recorded.

    Thank you for your help!