Problem with third sgtl5000 codec

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with third sgtl5000 codec

Jump to solution
1,245 Views
caiopereira
Contributor III

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

Labels (4)
Tags (2)
1 Solution
640 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Caio

seems for ssi3 "int-port" should be 7, not 3 as described in

Table 80. AUDMUX Port Allocation i.MX6SDL Datasheet

http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6SDLCEC.pdf

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

3 Replies
640 Views
devikar
Contributor II

Hi,

We have setup Yocto project 4.9.11_1.0.0 on a imx6qpsabresd based custom board which has two of wm8962 audio codecs.

We have customized device tree file imx6qdl-sabresd.dtsi for dual audio codec configuration.(same as how it is done for sgtl500 above). But we are getting kernel panic and it is not detecting two sound cards.

Do we need to modify board files and driver files (imx-wm8962.c and wm8962.c).

Please let us know how we have to take care of dts and driver files for dual audio codec configuaration.

Thanks,

Devika

0 Kudos
641 Views
igorpadykov
NXP TechSupport
NXP TechSupport

Hi Caio

seems for ssi3 "int-port" should be 7, not 3 as described in

Table 80. AUDMUX Port Allocation i.MX6SDL Datasheet

http://cache.freescale.com/files/32bit/doc/data_sheet/IMX6SDLCEC.pdf

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

640 Views
caiopereira
Contributor III

Works!

Thank you very much!

0 Kudos