Audio codec TLV320AIC3100 interface with Imx8mp custom board

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Audio codec TLV320AIC3100 interface with Imx8mp custom board

2,413 Views
Adi99
Contributor I

Hello Nxp,

I am interfacing TLV320AIC3100 audio codec chip with imx8mp custom board.

I have refer some forum and written device tree  as per below. but I am getting error.

************************************************************************************************************

/{

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,widgets =
"Speaker", "Speaker Jack";
simple-audio-card,routing =
"Speaker Jack", "SPK";

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

simple-audio-card,codec {
sound-dai = <&codec1>;
system-clock-frequency = <12288000>;
};
};

}

************************************************************************************************************

&I2C3{

codec1: codec@18 {
compatible = "ti,tlv320aic3100";
reg = <0x18>;
//pinctrl-0 = <&pinctrl_audio_reset_31xx>;
reset-gpios = <&gpio4 1 GPIO_ACTIVE_LOW>;
#sound-dai-cells = <0>;
ai31xx-micbias-vg = <1>;
HPVDD-supply = <&reg_3p3v>;
SPRVDD-supply = <&reg_3p3v>;
SPLVDD-supply = <&reg_3p3v>;
AVDD-supply = <&reg_3p3v>;
IOVDD-supply = <&reg_3p3v>;
DVDD-supply = <&reg_1p8v>;
};

};

************************************************************************************************************

&sai3 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
fsl,sai-mclk-direction-output;
status = "okay";
};

************************************************************************************************************

ERROR (phandle_references): /sound-tlv320aic31xx/simple-audio-card,codec: Reference to non-existent node or label "codec1"

 

In any other dts file I need to add that node or not?

0 Kudos
Reply
6 Replies

2,336 Views
Adi99
Contributor I

Hi @Sanket_Parekh 

thanks for the reply. but its not work as you suggested.

I am able to detect the chip tlv320aic3100 and get card entry in file system.

card info in debugg log:

1 [tlv320aic31xxCo]: tlv320aic31xx-C - tlv320aic31xx-Codec
tlv320aic31xx-Codec

*******************************************************************************

/sys/kernel/debug/asoc/tlv320aic31xx-Codec/tlv320aic31xx-codec.2-0018/dapm/Speaker

>>  Speaker: Off in 0 out 1
out "static" "SPK ClassD"

********************************************************************

when I play sample .wav file it is showing ...

tinyplay sngl44s.wav 
>> Playing sample: 2 ch, 44100 hz, 32 bit 2359272 bytes

>> Error playing sample

what is the issue ?

0 Kudos
Reply

1,820 Views
Wobaffet
Senior Contributor I

Hello Thomas,

Could you please share your DT configuration for the TLV320AIC31XX codec? I am trying to port the same codec but having some issues with the dai-link configuration.

Thank you in advance!

Best Regards.

Tags (1)
0 Kudos
Reply

1,806 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @Wobaffet,

Yes, Sure, I have shared an example for the same below.
Please refer to that.

&i2c1 {
tlv320aic31xx: codec@1a {
compatible = "ti,tlv320aic31xx";
reg = <0x1a>;
// Other codec-specific properties

// Link to the CPU DAI
dai-link-0 {
format = "i2s";
cpu {
sound-dai = <&i2s>;
};
codec {
sound-dai = <&tlv320aic31xx>;
};
};
};
};

&i2s {
status = "okay";
// Other I2S configuration properties
};

I hope this helps!
For more queries I suggest please raise a new query, I will be glad to help you there.

Thanks & Regards,
Sanket Parekh

1,792 Views
Wobaffet
Senior Contributor I

Hello, Thank you for sharing.

I've already opened up a new query for my status. But I have questions regarding your configration.

Is it okay to have dai-link-0 node to have as a child node at the i2c bus. How should the node at the root node be for the codec in your configuration? Is the below configuration okay?

/ {
...
        sound-tlv320aic31xx {
                compatible = "simple-audio-card";
                simple-audio-card,name = "tlv320aic31xx-Codec";
                simple-audio-card,format = "i2s";
                simple-audio-card,frame-master = <&codec_dai>;
                simple-audio-card,bitclock-master = <&codec_dai>;

                simple-audio-card,widgets =
                "Speaker", "SPEAKER";
                simple-audio-card,routing =
                "SPEAKER", "SPK";
        };
};

Thank you in advance!

Best Regards.

0 Kudos
Reply

2,322 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @Adi99 

I hope you are doing well.

->Please take a reference from this link
https://community.nxp.com/t5/i-MX-Processors/IMX8MP-speaker-test-error-message-while-trying-to-play-...

It will help you!

Thanks & Regards,

Sanket Parekh

0 Kudos
Reply

2,362 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @Adi99 

I hope you are doing well.

->The error message shows that the device tree node codec1 does not exist.
sound-dai = <&codec1>;
This line is correct but the reference is missing.

->Because It may be possible that one has not created the node yet.
->To create the node, please follow the below steps.

codec1 {
                #sound-dai-cells = <1>;
                    sound-dai = <&tlv320aic3104>;
};


->Please refer to this file for reference.
<Linux_src_code>/Documentation/devicetree/bindings/sound/tlv320aic31xx.txt

I hope this information helps!

Thanks & Regards,

Sanket Parekh

0 Kudos
Reply