AnsweredAssumed Answered

Problem with third sgtl5000 codec

Question asked by Caio Pereira on Oct 27, 2016
Latest reply on Oct 28, 2016 by Caio Pereira

I'm using IMX6Solo with 3 codecs (SGTL5000).

 

First Codec is in the SOM (Toradex Colibri IMX6Solo 256MB)  is connected to the i2c-2 and ssi1 - Working Ok

Second Codec is in the base board is connected to the i2c-4 and ssi2 - Working Ok

Third Codec is in the base board is connected to the i2c-1 and ssi3 - Not Working 

 

 

 

To test the codecs I'm using the aplay.

 

 aplay /usr/share/sounds/mysound/ringtone1.wav -V mono -Dhw:0,0 -v              ( Ok )

 

 aplay /usr/share/sounds/mysound/ringtone1.wav -V mono -Dhw:1,0 -v              ( Ok )

 

 aplay /usr/share/sounds/mysound/ringtone1.wav -V mono -Dhw:2,0 -v             ( Ok )

 

When I test with -Dhw:2,0 the aplay freeze and crash.

I'm trying to find the problem in my devicetree, maybe could be a problem with SSI3 Pinout Routing.

root@colibri-imx6:~# aplay /usr/share/sounds/mysound/ringtone1.wav -V mono -Dhw:2,0 -v
Playing WAVE '/usr/share/sounds/mysound/ringtone1.wav' : Signed 16 bit Little Endian, Rate 32000 Hz, Stereo
Hardware PCM card 2 'imx6-colibri-sgtl5000' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 32000
exact rate : 32000 (32000/1)
msbits : 16
buffer_size : 16000
period_size : 4000
period_time : 125000
tstamp_mode : NONE
period_step : 1
avail_min : 4000
period_event : 0
start_threshold : 16000
stop_threshold : 16000
silence_threshold: 0
silence_size : 0
boundary : 2097152000
appl_ptr : 0
hw_ptr : 0
#######+ | 12%aplay: pcm_write:1947: write error: Input/output error

 

aplay -L

root@colibri-imx6:~# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=imx6colibrisgtl
imx6-colibri-sgtl5000,
Default Audio Device
sysdefault:CARD=imx6colibrisgtl
imx6-colibri-sgtl5000,
Default Audio Device
default:CARD=imx6colibrisg_1
imx6-colibri-sgtl5000,
Default Audio Device
sysdefault:CARD=imx6colibrisg_1
imx6-colibri-sgtl5000,
Default Audio Device
default:CARD=imx6colibrisg_2
imx6-colibri-sgtl5000,
Default Audio Device
sysdefault:CARD=imx6colibrisg_2
imx6-colibri-sgtl5000,
Default Audio Device

 

Device Tree 

 

&audmux {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux_t1 &pinctrl_audmux_mclk_2 &pinctrl_mic_gnd &pinctrl_audmux_t2 &pinctrl_audmux_t3 >;

status = "okay";
};

 

audmux {

pinctrl_audmux_t1: audmux-t1 {
fsl,pins = <
MX6QDL_PAD_KEY_COL0__AUD5_TXC 0x130b0
MX6QDL_PAD_KEY_ROW0__AUD5_TXD 0x130b0
MX6QDL_PAD_KEY_COL1__AUD5_TXFS 0x130b0
MX6QDL_PAD_KEY_ROW1__AUD5_RXD 0x130b0
>;
};


pinctrl_audmux_t2: audmux-t2 {
fsl,pins = <
MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x130b0
MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x130b0
MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0
MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x130b0
>;
};

pinctrl_audmux_t3: audmux-t3 {
fsl,pins = <
MX6QDL_PAD_SD2_DAT3__AUD4_TXC 0x130b0
MX6QDL_PAD_SD2_DAT2__AUD4_TXD 0x130b0
MX6QDL_PAD_SD2_DAT1__AUD4_TXFS 0x130b0
MX6QDL_PAD_SD2_DAT0__AUD4_RXD 0x130b0
>;
};

};

 

sound {
status = "okay";
compatible = "fsl,imx6-colibri-sgtl5000",
"fsl,imx-audio-sgtl5000";
model = "imx6-colibri-sgtl5000";
ssi-controller = <&ssi1>;
audio-codec = <&codec>;
audio-routing =
"MIC_IN", "Mic Jack",
"Mic Jack", "Mic Bias",
"Headphone Jack", "HP_OUT",
"AIFOUT", "ADC",
"DAC", "AIFIN";
mux-int-port = <1>;
mux-ext-port = <5>;
};

sound2 {
status = "okay";
compatible = "fsl,imx6-colibri-sgtl5000",
"fsl,imx-audio-sgtl5000";
model = "imx6-colibri-sgtl5000";
ssi-controller = <&ssi2>;
audio-codec = <&codec2>;
audio-routing =
"MIC_IN", "Mic Jack",
"Mic Jack", "Mic Bias",
"Headphone Jack", "HP_OUT",
"AIFOUT", "ADC",
"DAC", "AIFIN";
mux-int-port = <2>;
mux-ext-port = <3>;
};

sound3 {
status = "okay";
compatible = "fsl,imx6-colibri-sgtl5000",
"fsl,imx-audio-sgtl5000";
model = "imx6-colibri-sgtl5000";
ssi-controller = <&ssi3>;
audio-codec = <&codec3>;
audio-routing =
"MIC_IN", "Mic Jack",
"Mic Jack", "Mic Bias",
"Headphone Jack", "HP_OUT",
"AIFOUT", "ADC",
"DAC", "AIFIN";
mux-int-port = <3>;
mux-ext-port = <4>;
};

 

/ { (...)

                clocks {

                               audioclk: ccodec {

                                               compatible = "fsl,imx-ccodec", "fixed-clock";

                                               #clock-cells = <0>;

                                               clock-frequency = <12288000>;

                               };            

                               audioclk1: ccodec {

                                               compatible = "fsl,imx-ccodec", "fixed-clock";

                                               #clock-cells = <0>;

                                               clock-frequency = <12288000>;

                               };

                };

(...)

}

 

&i2c1 {

                clock-frequency = <100000>;

                pinctrl-names = "default";         

                pinctrl-0 = <&pinctrl_i2c1_2>;  

                status = "okay";

 

        codec3: sgtl5000@0a {

                status = "okay";

                compatible = "fsl,sgtl5000";

                reg = <0x0a>;

                clocks = <&audioclk 0>;

                //VDDA-supply = <&reg_2p5v>;

                VDDA-supply = <&reg_3p3v>;

                VDDIO-supply = <&reg_3p3v>;

                micbias-voltage-m-volts = <2500>;

                micbias-resistor-k-ohms = <2>;

        };

}

 

&i2c4 {

                clock-frequency = <100000>;

                pinctrl-names = "default";

                pinctrl-0 = <&pinctrl_i2c4_1>;

                status = "okay";

               

                codec2: sgtl5000@0a {

                               status = "okay";

                               compatible = "fsl,sgtl5000";

                               reg = <0x0a>;                   

                               clocks = <&audioclk 0>;                               

                               //VDDA-supply = <&reg_2p5v>;

                               VDDA-supply = <&reg_3p3v>;

                               VDDIO-supply = <&reg_3p3v>;

                micbias-voltage-m-volts = <2500>;

                micbias-resistor-k-ohms = <2>;

                };            

 

};

 

Thank you very much!

 

Regards,

 

Caio Pereira

Outcomes