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.

TLV320AIC3100: Microphone audio was not coming in the tlv320aic3100 codec

Part Number: TLV320AIC3100

Hi,

Configured the tlv320aic3100 codec configuration in the nxp imx8mm board, Speaker was working fine but the microphone was not coming up.

Can you please help us to configure the microphone features in the tlv320aic3100 codec?

Anything we need to add in the device tree?

sound-tlv320aic31xx {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "tlv320aic31xx-codec";
+ simple-audio-card,format = "i2s";
+ simple-audio-card,frame-master = <&cpudai2>;
+ simple-audio-card,bitclock-master = <&cpudai2>;
+ /*simple-audio-card,mclk-fs=<256>;*/
+ simple-audio-card,widgets =
+ "Speaker", "Speaker Jack";   => Need to add?
+ simple-audio-card,routing =
+ "Speaker Jack", "SPK";     => Need to add?
+
+ cpudai2:simple-audio-card,cpu {
+ sound-dai = <&sai2>;
+ };
+
+ simple-audio-card,codec {
+ sound-dai = <&tlv320aic31xx>;
+ system-clock-frequency = <24000000>;
+ };
+ };

Anything we need to add in the alsa mixer settings?

root@pico-imx8mm:~# amixer -c 0
Simple mixer control 'Speaker',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Speaker Analog',0
Capabilities: pvolume pvolume-joined
Playback channels: Mono
Limits: Playback 0 - 127
Mono: Playback 0 [0%] [-63.50dB]
Simple mixer control 'Speaker Driver',0
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
Playback channels: Mono
Limits: Playback 0 - 3
Mono: Playback 0 [0%] [6.00dB] [off]
Simple mixer control 'Mic PGA',0
Capabilities: cvolume cvolume-joined
Capture channels: Mono
Limits: Capture 0 - 119
Mono: Capture 0 [0%] [0.00dB]
Simple mixer control 'ADC',0
Capabilities: cvolume cvolume-joined cswitch cswitch-joined
Capture channels: Mono
Limits: Capture 0 - 64
Mono: Capture 24 [38%] [-8.00dB] [off]
Simple mixer control 'ADC Fine',0
Capabilities: cvolume cvolume-joined
Capture channels: Mono
Limits: Capture 0 - 4
Mono: Capture 4 [100%] [0.40dB]
Simple mixer control 'DAC',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 175
Mono:
Front Left: Playback 87 [50%] [-20.00dB]
Front Right: Playback 87 [50%] [-20.00dB]
Simple mixer control 'DAC Left Input',0
Capabilities: enum
Items: 'Off' 'Left Data' 'Right Data' 'Mono'
Item0: 'Left Data'
Simple mixer control 'DAC Right Input',0
Capabilities: enum
Items: 'Off' 'Right Data' 'Left Data' 'Mono'
Item0: 'Right Data'
Simple mixer control 'HP Analog',0
Capabilities: pvolume
Playback channels: Front Left - Front Right
Limits: Playback 0 - 127
Mono:
Front Left: Playback 0 [0%] [-63.50dB]
Front Right: Playback 0 [0%] [-63.50dB]
Simple mixer control 'HP Driver',0
Capabilities: pvolume pswitch
Playback channels: Front Left - Front Right
Limits: Playback 0 - 9
Mono:
Front Left: Playback 0 [0%] [0.00dB] [off]
Front Right: Playback 0 [0%] [0.00dB] [off]
Simple mixer control 'HP Left',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'HP Output Driver Power-On time',0
Capabilities: enum
Items: '0us' '15.3us' '153us' '1.53ms' '15.3ms' '76.2ms' '153ms' '304ms' '610ms' '1.22s' '3.04s' '6.1s'
Item0: '304ms'
Simple mixer control 'HP Output Driver Ramp-up step',0
Capabilities: enum
Items: '0ms' '0.98ms' '1.95ms' '3.9ms'
Item0: '3.9ms'
Simple mixer control 'HP Right',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'MIC1LM M-Terminal',0
Capabilities: enum
Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
Item0: 'Off'
Simple mixer control 'MIC1LM P-Terminal',0
Capabilities: enum
Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
Item0: 'Off'
Simple mixer control 'MIC1LP P-Terminal',0
Capabilities: enum
Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
Item0: 'Off'
Simple mixer control 'MIC1RP P-Terminal',0
Capabilities: enum
Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
Item0: 'Off'
Simple mixer control 'Output Left From Left DAC',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Output Left From MIC1LP',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Output Left From MIC1RP',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Output Right From MIC1RP',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Output Right From Right DAC',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [off]
Simple mixer control 'Volume Soft Stepping',0
Capabilities: enum
Items: 'fast' 'slow' 'disabled'
Item0: 'fast'

Below the link TI teams supported for the Speaker from the tlv320aic3100. If any doubt for my configuration please check the below link.

e2e.ti.com/.../4836287

Regards,

SanthanaKumarS

  • Hi Kumar,

    You should open the mic control which's type is enum as below image, Then once you record any wav file, the ADC channel will be configured and powered up, Kindly share us the register dump if you find any issue during recording, we can quickly locate the soft issue through that.

    Thanks

    Kevin

  • Hi Kevin,

    We have able to capture the audio but it is very noisy. Plese support us to resolve the issue.

    Below the alsamixer configuration

    root@picoimx8mm:/home/ubuntu# amixer -c 0
    Simple mixer control 'Speaker',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    Simple mixer control 'Speaker Analog',0
    Capabilities: pvolume pvolume-joined
    Playback channels: Mono
    Limits: Playback 0 - 127
    Mono: Playback 116 [91%] [-5.50dB]
    Simple mixer control 'Speaker Driver',0
    Capabilities: pvolume pvolume-joined pswitch pswitch-joined
    Playback channels: Mono
    Limits: Playback 0 - 3
    Mono: Playback 3 [100%] [24.00dB] [on]
    Simple mixer control 'Mic PGA',0
    Capabilities: cvolume cvolume-joined
    Capture channels: Mono
    Limits: Capture 0 - 119
    Mono: Capture 93 [78%] [46.50dB]
    Simple mixer control 'ADC',0
    Capabilities: cvolume cvolume-joined cswitch cswitch-joined
    Capture channels: Mono
    Limits: Capture 0 - 64
    Mono: Capture 59 [92%] [9.50dB] [on]
    Simple mixer control 'ADC Fine',0
    Capabilities: cvolume cvolume-joined
    Capture channels: Mono
    Limits: Capture 0 - 4
    Mono: Capture 1 [25%] [0.10dB]
    Simple mixer control 'DAC',0
    Capabilities: pvolume
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 175
    Mono:
    Front Left: Playback 157 [90%] [15.00dB]
    Front Right: Playback 157 [90%] [15.00dB]
    Simple mixer control 'DAC Left Input',0
    Capabilities: enum
    Items: 'Off' 'Left Data' 'Right Data' 'Mono'
    Item0: 'Right Data'
    Simple mixer control 'DAC Right Input',0
    Capabilities: enum
    Items: 'Off' 'Right Data' 'Left Data' 'Mono'
    Item0: 'Right Data'
    Simple mixer control 'HP Analog',0
    Capabilities: pvolume
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 127
    Mono:
    Front Left: Playback 86 [68%] [-20.50dB]
    Front Right: Playback 86 [68%] [-20.50dB]
    Simple mixer control 'HP Driver',0
    Capabilities: pvolume pswitch
    Playback channels: Front Left - Front Right
    Limits: Playback 0 - 9
    Mono:
    Front Left: Playback 7 [78%] [7.00dB] [on]
    Front Right: Playback 7 [78%] [7.00dB] [on]
    Simple mixer control 'HP Left',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    Simple mixer control 'HP Output Driver Power-On time',0
    Capabilities: enum
    Items: '0us' '15.3us' '153us' '1.53ms' '15.3ms' '76.2ms' '153ms' '304ms' '610ms' '1.22s' '3.04s' '6.1s'
    Item0: '304ms'
    Simple mixer control 'HP Output Driver Ramp-up step',0
    Capabilities: enum
    Items: '0ms' '0.98ms' '1.95ms' '3.9ms'
    Item0: '3.9ms'
    Simple mixer control 'HP Right',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    Simple mixer control 'MIC1LM M-Terminal',0
    Capabilities: enum
    Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
    Item0: 'Off'
    Simple mixer control 'MIC1LM P-Terminal',0
    Capabilities: enum
    Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
    Item0: 'Off'
    Simple mixer control 'MIC1LP P-Terminal',0
    Capabilities: enum
    Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
    Item0: 'FFR 10 Ohm'
    Simple mixer control 'MIC1RP P-Terminal',0
    Capabilities: enum
    Items: 'Off' 'FFR 10 Ohm' 'FFR 20 Ohm' 'FFR 40 Ohm'
    Item0: 'Off'
    Simple mixer control 'Output Left From Left DAC',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    Simple mixer control 'Output Left From MIC1LP',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    Simple mixer control 'Output Left From MIC1RP',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    Simple mixer control 'Output Right From MIC1RP',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [off]
    Simple mixer control 'Output Right From Right DAC',0
    Capabilities: pswitch pswitch-joined
    Playback channels: Mono
    Mono: Playback [on]
    Simple mixer control 'Volume Soft Stepping',0
    Capabilities: enum
    Items: 'fast' 'slow' 'disabled'
    Item0: 'disabled'
    root@picoimx8mm:/home/ubuntu#

    i2cdump registers:( After playing audio)

    root@picoimx8mm:/home/ubuntu# ./i2cdump -f -y 1 0x18
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 00 00 01 66 03 21 07 14 90 00 00 08 02 00 80 80 ..?f?!???..??.??
    10: 08 00 08 02 80 80 04 00 00 00 01 00 00 00 08 00 ?.?????...?...?.
    20: 00 00 00 00 00 00 11 6a 00 00 00 00 00 00 00 00 ......?j........
    30: 00 00 00 02 32 12 03 02 02 11 10 00 01 04 00 26 ...?2??????.??.&
    40: 0c 1e 1e 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3 ???.o8.....???~?
    50: 00 00 30 23 00 00 00 00 7f 00 00 00 00 00 00 00 ..0#....?.......
    60: 00 00 00 00 00 00 00 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 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 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 ................

  • Hi Kumar,

    Firstly pls make sure the sample rate and clocks are same as playback, 

    From the regdump, we can see both ADC and DAC are powered down, can you share some more information, like registers before and after arecord command, the logs during recording ?

    Thanks

    Kevin

  • Resolved the issue by doing powered down the DAC *& captured the audio. It was played as expected.

    How can I powered on the ADC & DAC for doing the playback & capture?

  • Hi Kumar,

    Using aplay or arecord .command for playback & capture, I believe the register setting is integrated in driver, just because you finish the recording, the device is powered down automatically, Can you capture the registers value when you was recording audio?

    Thanks

    Kevin

  • Hi,

    We can able to record the audio and it working as expected but there is noise coming in the recorded file. 

    Playing the audio. & attached file having some noise coming, We are suspecting the issue as the alsamixer Settings. Can you please help out the correct settings for recording the audio & don't have issue in playing the audio.

    In the wav file, You can see every 3 or 5 secs, some noise was coming, It should not come. Can you please help us to resolve the issue by amixer settings or?

    Note: Linux driver TLV320aic3100 did not handle the microphone/Speaker settings, we are doing by setting the amixer command only.

    Below the register settings loaded the driver

    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............
    10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 ...............?
    20: 06 3e 00 44 00 80 07 7f 06 06 00 00 20 86 00 b2 ?>.D.?????.. ?.?
    30: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @...............
    40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 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 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 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 ................
    root@picoimx8mm:/home/ubuntu#

    Below the amixer command is used to record the audio from the headphone.

    amixer -c 0 cset name='ADC Capture Switch' on
    amixer -c 0 sset 'ADC' 40
    amixer -c 0 sset 'Mic PGA' 50
    amixer -c 0 sset "Output Left From MIC1LP" off
    amixer -c 0 sset "Output Left From MIC1RP" off
    amixer -c 0 sset "Output Right From MIC1RP" off
    amixer -c 0 sset 'MIC1LM P-Terminal' 'FFR 10 Ohm'
    amixer -c 0 sset "DAC" 0 off
    amixer -c 0 sset 'Speaker Analog' 0 off
    amixer -c 0 sset "HP Analog" 0 off
    amixer -c 0 sset "HP Left" off
    amixer -c 0 sset "HP Right" off
    amixer -c 0 sset "HP Driver" off
    amixer -c 0 sset "Output Left From Left DAC" off
    amixer -c 0 sset "Output Right From Right DAC" off

    After given the above amixer settings command, then below attacjhed registers

    root@picoimx8mm:/home/ubuntu# ./i2cdump -f -y 1 0x18
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?...............
    10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 14 ...............?
    20: 06 3e 00 00 7f 7f 7f 7f 02 02 00 00 20 86 00 b2 ?>..??????.. ?.?
    30: 00 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .?..............
    40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    60: 00 00 00 00 00 00 00 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 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 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 ................
    root@picoimx8mm:/home/ubuntu#

    arecord -f S16_LE -c2 -r44100 -d20 aud_rec.wav
    Recording WAVE 'aud_rec.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

    After recording the audio, the below register settings are

    root@picoimx8mm:/home/ubuntu# ./i2cdump -f -y 1 0x18
    No size specified (using byte-data access)
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: 00 00 01 66 03 21 07 14 90 00 00 08 02 00 80 80 ..?f?!???..??.??
    10: 08 00 08 02 80 80 04 00 00 00 01 00 00 00 08 00 ?.?????...?...?.
    20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    30: 00 00 00 02 32 12 03 02 02 11 10 00 01 04 00 14 ...?2??????.??.?
    40: 0c 81 81 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3 ???.o8.....???~?
    50: 00 00 00 1c 00 00 00 00 7f 00 00 00 00 00 00 00 ...?....?.......
    60: 00 00 00 00 00 00 00 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 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
    e0: 00 00 00 00 00 00 00 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 ................
    root@picoimx8mm:/home/ubuntu#

    Regards,
    SanthanaKumarS

  • Hi Kumar,

    I will involve our codec AE Peter to comment the noise reason.

    Thanks

    Kevin

  • This sounds like hiss from your setup either this is a dynamic microphone you are using or some interference from monitors etc.

    First try to record using audacity to compare if hiss is heard with the tool, second try with another microphone for example an ECM/condenser mic. 

  • The issue is resolved by adding changes in resistor from the microphone line because if we are connecting the external microphone, the microphone voltage was dropping. Anyway it fixes in hardware.

  • OK good to know, we'll close this thread.