Codec SGTL5000 can not work

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

Codec SGTL5000 can not work

Jump to solution
2,585 Views
wangtsungli
Contributor IV

Hi Community,

I'm working on i.MX6 Quad sabre-SD and build Android 6.0 for my image.

I'm trying to porting codec sgtl5000 on my self designed platform.

In menuconfig I enabled following settings:

 CONFIG_SND_SOC_IMX_SGTL5000=y

 CONFIG_SND_SOC_SGTL5000=y

In boot/dts/FX100_DEV.dtsi I set following settings:

sound {
compatible = "fsl,imx6q-nitrogen6x-sgtl5000",
"fsl,imx-audio-sgtl5000";
model = "fsl,imx-audio-sgtl5000";
ssi-controller = <&ssi2>;
audio-codec = <&codec>;
audio-routing =
"MIC_IN", "Mic Jack",
"Mic Jack", "Mic Bias",
"Line Out Jack", "Line In Jack";
mux-int-port = <2>;
mux-ext-port = <3>;
mic-det-gpios = <&gpio1 9 1>;
};

&ssi2 {
status = "okay";
};

&i2c1 {
   clock-frequency = <100000>;
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_i2c1>;
   status = "okay";

   codec: sgtl5000@0a {
      compatible = "fsl,sgtl5000";
      reg = <0x0a>;
      clocks = <&clks 201>;
      VDDA-supply = <&reg_2p5v>;
      VDDIO-supply = <&reg_3p3v>;
   };

};

&audmux {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_audmux>;
   status = "okay";
};

&iomuxc {

   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_hog>;

   pinctrl_hog: hoggrp {
      fsl,pins = <
      /   * SGTL5000 sys_mclk */
      MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x030b0
      >;
   };

   pinctrl_audmux: audmuxgrp {
      fsl,pins = <
         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
      >;
   };

};

pastedImage_3.png

If the picture is not clear, please click following link.

Imgur: The magic of the Internet 

 

After all this settings, I still can not broadcast my music.

My line out and line in can not work.

What else did I miss?

Or

Is my dtsi settings wrong?

Thanks in Advanced!

Labels (5)
0 Kudos
1 Solution
2,015 Views
wangtsungli
Contributor IV

Hi igorpadykov

Thanks for your previous support.

I've found solution.

There are many codecs that freescale had supported in path hardware/imx/alsa/ .

But like you said freescale BSP did not support SGTL5000 in HAL.

So I found a link that said "how to add a new codec in Android BSP" showed as below.

How to port new audio codec into Android.docx 

This file will teach you how to design a header file for your codec and modify some place in tinyalsa_hal.c .

After all this work, my codec can play in Android system and even playback via command "tinyplay" with format mp3、wav、mp4 and so on...

Wish can help other people who is struggled with new codec that Freescale patch does not support.

View solution in original post

0 Kudos
7 Replies
2,014 Views
igorpadykov
NXP Employee
NXP Employee

Hi tsung

sgtl5000 is used on boundary devices and one can look at its dts example

linux-imx6/imx6qdl-sabrelite.dtsi at boundary-imx_4.1.15_2.0.0_ga · boundarydevices/linux-imx6 · Git... 

GitHub - boundarydevices/linux-imx6 at boundary-imx-m6.0.1_1.0.0-ga 

Audio output selection under Linux on i.MX6 - Boundary Devices 

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

0 Kudos
2,014 Views
wangtsungli
Contributor IV

Hi igorpadykov

boundary device did not set Line In and Line Out.

I can not take this as reference.

Is there any additional suggestion?

0 Kudos
2,014 Views
igorpadykov
NXP Employee
NXP Employee

you can verify sgtl5000 settings with i.MX6Q baremetal sdk found on

SMP Enable in IMX6 

then compare them in linux.

Best regards
igor

0 Kudos
2,014 Views
wangtsungli
Contributor IV

Hi igorpadykov

Now I can play music.wav by command "tinyplay".

Cause this result I can sure that my driver and hardware design is correct.

But I get a new issue.

When I use Android default Music player to play Music.wav, It would show "not support this type".

Even I tried to play other type of music such as mp3, it still show the same error.

And I had found out that under path "hardware/imx/alsa" has no sgtl5000.h supported in HAL.

Is NXP has sgtl5000 patch on HAL、 JNI or all the upper layer that sgtl5000 woule need?

0 Kudos
2,014 Views
igorpadykov
NXP Employee
NXP Employee

nxp does not support sgtl5000 for i.mx6 bsps and has not patches for it.

Best regards
igor

0 Kudos
2,016 Views
wangtsungli
Contributor IV

Hi igorpadykov

Thanks for your previous support.

I've found solution.

There are many codecs that freescale had supported in path hardware/imx/alsa/ .

But like you said freescale BSP did not support SGTL5000 in HAL.

So I found a link that said "how to add a new codec in Android BSP" showed as below.

How to port new audio codec into Android.docx 

This file will teach you how to design a header file for your codec and modify some place in tinyalsa_hal.c .

After all this work, my codec can play in Android system and even playback via command "tinyplay" with format mp3、wav、mp4 and so on...

Wish can help other people who is struggled with new codec that Freescale patch does not support.

0 Kudos
2,014 Views
wangtsungli
Contributor IV

Hi igorpadykov

Thanks for your reply.

I think I should ask codec agent for it?

0 Kudos