AnsweredAssumed Answered

Two audio codecs on an i.MX6Q

Question asked by christian_s on Jul 31, 2015
Latest reply on Jun 29, 2016 by Nguyen Anh Duc

Hello community,

 

we are currently trying to bring up a custom i.MX6Q board with two TI TLV320AIC3106 codecs based on Linux 3.10.17.

Both codecs are I2S slaves and attached via SSI1<->AUDMUX3 and SSI2<->AUDMUX4.

I have written a machine driver and audio playback works on each of the codecs - but only when one of the two is enabled in the DT.

If I enable both codecs still only one works:

 

aplay -D "plughw:0,0" /some.wav

Playing WAVE '/some.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono

ALSA sound/core/pcm_lib.c:1944 playback write error (DMA or IRQ trouble?)

aplay: pcm_write:1603: write error: Input/output error

The reason for this is that I do not have any activity on any of the I2S lines of the first codec when both codecs are enabled, and I don't understand why.

 

Here is (the relevant part of) my DT:

 

/ {

        sound1 {

                compatible = "fsl,imx-audio-tlv320aic3x";

                model = "CODEC1";

                ssi-controller = <&ssi1>;

                audio-codec = <&codec1>;

                audio-routing =

                        "Microphone 1",      "LINE1L",

                        "Microphone 1",      "LINE1R",

                        "Microphone 2",      "LINE2L",

                        "Microphone 2",      "LINE2R",

                        "Piezo Loudspeaker", "LLOUT";

                mux-int-port = <1>;

                mux-ext-port = <3>;

        };

 

        sound2 {

                compatible = "fsl,imx-audio-tlv320aic3x";

                model = "CODEC2";

                ssi-controller = <&ssi2>;

                audio-codec = <&codec2>;

                audio-routing =

                        "Microphone 1", "LINE1L",

                        "Microphone 1", "LINE1R",

                        "Microphone 2", "LINE2L",

                        "Microphone 2", "LINE2R",

                        "Loudspeaker",  "LLOUT",

                        "Loudspeaker",  "RLOUT";

                mux-int-port = <2>;

                mux-ext-port = <4>;

        };

};

 

&audmux {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_audmux_4>;

        status = "okay";

};

 

&i2c1 {

        clock-frequency = <100000>;

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_i2c1_2>;

        status = "okay";

 

        codec1: tlv320aic3x@01b {

                compatible = "ti,tlv320aic3x";

                reg = <0x01b>;

                gpio-reset = <&gpio5 18 GPIO_ACTIVE_LOW>;

        status = "okay";

 

        clocks = <&clks 201>;

        clock-names = "cko";

        clock-frequency = <25000000>;

       

        AVDD-supply = <&reg_audio>;

        IOVDD-supply = <&reg_audio>;

        DRVDD-supply = <&reg_audio>;

        DVDD-supply = <&reg_audio>;

        HPVDD-supply = <&reg_audio>;

        SPRVDD-supply = <&reg_audio>;

        SPLVDD-supply = <&reg_audio>;

        };

 

        codec2: tlv320aic3x@018 {

                compatible = "ti,tlv320aic3x";

                reg = <0x018>;

                gpio-reset = <&gpio5 18 GPIO_ACTIVE_LOW>;

        status = "okay";

 

        clocks = <&clks 201>;

        clock-names = "cko";

        clock-frequency = <25000000>;

       

        AVDD-supply = <&reg_audio>;

        IOVDD-supply = <&reg_audio>;

        DRVDD-supply = <&reg_audio>;

        DVDD-supply = <&reg_audio>;

        HPVDD-supply = <&reg_audio>;

        SPRVDD-supply = <&reg_audio>;

        SPLVDD-supply = <&reg_audio>;

        };

};

 

&iomuxc {

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_audmux_4>;

 

    audmux {

        pinctrl_audmux_4: audmux-4 {

            fsl,pins = <

                                MX6QDL_PAD_SD2_DAT0__AUD4_RXD  0x130b0

                                MX6QDL_PAD_SD2_DAT3__AUD4_TXC  0x130b0

                                MX6QDL_PAD_SD2_DAT2__AUD4_TXD  0x110b0

                                MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0

                                MX6QDL_PAD_CSI0_DAT7__AUD3_RXD  0x130b0

                                MX6QDL_PAD_CSI0_DAT4__AUD3_TXC  0x130b0

                                MX6QDL_PAD_CSI0_DAT5__AUD3_TXD  0x110b0

                                MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0

            >;

        };

    };

};

 

&ssi1 {

        fsl,mode = "i2s-master";

        status = "okay";

};

 

&ssi2 {

        fsl,mode = "i2s-master";

        status = "okay";

};

 

As said: If i disable sound1, sound2 will work and vice versa. Both active, only sound2 will work.

 

Does anybody have an idea what I might be missing?

 

Thanks in advance!

 

Chris

Outcomes