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.

AM62A3-Q1: Audio Codec routing to line out.

Part Number: AM62A3-Q1
Other Parts Discussed in Thread: TPA2012D2, TLV320AIC3106, SK-AM62A-LP

Hi,

I am using an audio amplifier in Right_LO and Left_LO of the audio codec IC.

What changes should be made in the device tree and amixer setting to route the audio to Line Out?

  • Hi Sathiya,

    Can you share what Audio Codec you are trying to use? 

    Please follow the instructions provided in the links below:

    https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/sound/simple-card.yaml

    https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/sound/widgets.txt

    To add the widgets and routing in the DTS file.

    Best Regards,

    Suren

  • Hi Suren,

    The audio codec I am trying to use is TLV320AIC3106. I want to use it with the TPA2012D2 amplifier.

  • Hi Sathiya, 

    I am routing your query to our Audio forum experts. You should be hearing back from them soon.

    In the meantime, See if the below thread helps change your Devicetree for TPA2012D2, although they are using a different amplifier, changes required are similar.

    https://e2e.ti.com/support/audio-group/audio/f/audio-forum/1028056/tas2563-device-tree-configuration-and-linux-driver

    Best Regards,

    Suren

  • Hi Guy,

    Kindly tell me which driver code you used and the kernel version. One more thing, have the aic3106 driver has been registered as the sound card successfully? 

  • Hi Shenghao,

    The aic3106 is successfully registered. I can able to hear the output from headphone jack (HPLOUT, HPROUT). Now I want to route the audio to both Headphones and Line Out.

    I am following the design in SK-AM62A-LP board. I am using SDK 9.1 which has ti-linux-6.1.y

  • Hi Shenghao,

    Yes, the aic3106 driver is successfully registered, enabling audio output through the headphone jack

  • In the code tlv320aic3x.c, we have defined the widgets and audio route for line out

    widget for lineout:

    SND_SOC_DAPM_MUX("Left DAC Mux", SND_SOC_NOPM, 0, 0,
    &aic3x_left_dac_mux_controls),

    .............................

    SND_SOC_DAPM_MUX("Right DAC Mux", SND_SOC_NOPM, 0, 0,
    &aic3x_right_dac_mux_controls),

    ................................................

    SND_SOC_DAPM_PGA("Left Line Out", LLOPM_CTRL, 0, 0, NULL, 0),

    SND_SOC_DAPM_PGA("Right Line Out", RLOPM_CTRL, 0, 0, NULL, 0),

    ..........

    SND_SOC_DAPM_OUTPUT("LLOUT"),
    SND_SOC_DAPM_OUTPUT("RLOUT"),

    route for lineout:

    /* Left DAC Output */
    {"Left DAC Mux", "DAC_L1", "Left DAC"},
    {"Left DAC Mux", "DAC_L2", "Left DAC"},
    {"Left DAC Mux", "DAC_L3", "Left DAC"},

    /* Right DAC Output */
    {"Right DAC Mux", "DAC_R1", "Right DAC"},
    {"Right DAC Mux", "DAC_R2", "Right DAC"},
    {"Right DAC Mux", "DAC_R3", "Right DAC"},

    /* Left Line Output */
    {"Left Line Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
    {"Left Line Mixer", "DACL1 Switch", "Left DAC Mux"},
    {"Left Line Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
    {"Left Line Mixer", "DACR1 Switch", "Right DAC Mux"},

    {"Left Line Out", NULL, "Left Line Mixer"},
    {"Left Line Out", NULL, "Left DAC Mux"},
    {"LLOUT", NULL, "Left Line Out"},

    /* Right Line Output */
    {"Right Line Mixer", "PGAL Bypass Switch", "Left PGA Mixer"},
    {"Right Line Mixer", "DACL1 Switch", "Left DAC Mux"},
    {"Right Line Mixer", "PGAR Bypass Switch", "Right PGA Mixer"},
    {"Right Line Mixer", "DACR1 Switch", "Right DAC Mux"},

    {"Right Line Out", NULL, "Right Line Mixer"},
    {"Right Line Out", NULL, "Right DAC Mux"},
    {"RLOUT", NULL, "Right Line Out"},

    you can try them with amixer command first before aplay.

  • Hi Ding,

    The following device tree routed audio to LIne Out

    codec_audio: sound {
    	compatible = "simple-audio-card";
    	simple-audio-card,name = "AM62Ax-SKEVM";
    	simple-audio-card,widgets =
    		"Headphone",	"Headphone Jack",
    		"Line",		"Line Out",
    		"Line",		"Line In",
    		"Microphone",	"Microphone Jack";
    	simple-audio-card,routing =
    		"Headphone Jack",	"HPLOUT",
    		"Headphone Jack",	"HPROUT",
    		"Line Out",		"LLOUT",
    		"Line Out",		"RLOUT",
    		"LINE1L",	"Line In",
    		"LINE1R",	"Line In",
    		"MIC3R",	"Microphone Jack",
    		"Microphone Jack",	"Mic Bias";
    	simple-audio-card,format = "dsp_b";
    	simple-audio-card,bitclock-master = <&sound_master>;
    	simple-audio-card,frame-master = <&sound_master>;
    	simple-audio-card,bitclock-inversion;
    
    	simple-audio-card,cpu {
    		sound-dai = <&mcasp1>;
    	};
    
    	sound_master: simple-audio-card,codec {
    		sound-dai = <&tlv320aic3106>;
    		clocks = <&tlv320_mclk>;
    	};
    };