TI TAS2552 ClassD amplifier i2s slave no sound.

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

TI TAS2552 ClassD amplifier i2s slave no sound.

ソリューションへジャンプ
2,160件の閲覧回数
aduskett
Contributor II

Hey guys;

 

I am trying to bring up a board with two audio codecs on it.  

 

Chip 1: SGTL5000 in master mode connected to which works AUD3 and ssi1, this works fine.

Chip 2: Texas Instruments TAS2552 ClassD amplifier connected to AUD4 and SSI2 that we want to use in slave mode.

 

Here is the datasheet to the TAS2552: http://www.ti.com/lit/ds/symlink/tas2552.pdf 

 

I understand we need our own imx6 specific codec driver for the TAS2552, and as such I have created one, it will be attached at the bottom.

 

Here is our issue:

 

Running speaker-test I am able to confirm that MCLK, WCLK (TXFS), BCLK (TXC), and DIN (TXD), are all being produced, but DOUT (RXD) is not being produced and therefor I am not able to get static.

 

I have poured over all the registers and am able to determine that they are all supposedly setup correctly, so perhaps this is a driver issue?  I am not sure, and that is why I am asking for help from the experts.  

 

Below is the schematic for this particular section:

 

166252_166252.jpgtas2552_schematic.jpg

 

As you can see, mclk0 is tied into mclk1, the sgtl is using mclk0 and it works perfectly fine with speaker-test.

 

Below is what I am using for my DTSI file:

 

#ifdef SGTL5000
sound-sgtl5500 {
   compatible     = "fsl,imx-audio-sgtl5000";
   model             = "imx-sgtl5500";
   ssi-controller  = <&ssi1>;
   audio-codec  = <&sgtl5000>;
   audio-routing =
      "MIC_IN", "Mic Jack",
      "LINE_IN", "Line In Jack",
      "Headphone Jack", "HP_OUT";
   mux-int-port = <1>;
   mux-ext-port = <3>;
};
#endif

 

#ifdef TAS2552
sound-tas2552 {
   compatible = "fsl,imx-audio-tas2552";
   model = "ti-tas2550";
   ssi-controller = <&ssi2>;
   audio-codec = <&tas2552>;
   audio-routing =
      "In", "DAC",
      "Ext Spk", "OUT";
   mux-int-port = <2>;
   mux-ext-port = <4>;
};
#endif

 

 

#ifdef SGTL5000
sgtl5000: sgtl5000@0a {
   compatible =       "fsl,sgtl5000";
   reg =                    <0x0a>;
   clocks =               <&clksIMX6QDL_CLK_CKO>;
   VDDA-supply =   <&sw4_reg>;
   VDDIO-supply = <&vgen4_reg>;
};

#endif

 

#ifdef TAS2552
tas2552: tas2552@41 {
   compatible =    "ti,tas2552";
   reg =                  <0x41>;
   avdd-supply =   <&vgen4_reg>;
   iovdd-supply =  <&sw4_reg>;
   vbat-supply =    <&reg_4p2v>;
   clocks =            <&clks IMX6QDL_CLK_CKO>;
   enable-gpio =   <&gpio1 11 GPIO_ACTIVE_HIGH>;
};

#endif

 

&ssi1 {
   status = "okay";
};

 

&ssi2 {
   fsl,mode = "i2s-master";
   status = "okay";
};

 

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

 

 

pinctrl_audmux: audmuxgrp1 {
   fsl,pins = <
   #ifdef SGTL5000
      MX6QDL_PAD_CSI0_DAT4__AUD3_TXC    0x130b0
      MX6QDL_PAD_CSI0_DAT5__AUD3_TXD    0x110b0
      MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS  0x130b0
      MX6QDL_PAD_CSI0_DAT7__AUD3_RXD    0x130b0
   #endif

 

   #ifdef TAS2552
      MX6QDL_PAD_SD2_DAT0__AUD4_RXD    0x130b0
      MX6QDL_PAD_SD2_DAT1__AUD4_TXFS  0x130b0
      MX6QDL_PAD_SD2_DAT2__AUD4_TXD    0x110b0
      MX6QDL_PAD_SD2_DAT3__AUD4_TXC    0x130b0
   #endif
   >;
};

 

Here is my dmesg output:

 

 

[ 3.685819] Adding route DAC IN -> direct -> DAC
[ 3.689151] Adding route DAC -> Digital -> Input selection
[ 3.693345] Adding route IN -> Analog -> Input selection
[ 3.697415] Adding route Input selection -> direct -> ClassD
[ 3.701779] Adding route ClassD -> direct -> OUT
[ 3.705141] Adding route PLL -> direct -> ClassD
[ 3.708502] ASoC: probe ti-tas2550 dai link 0 late -2
[ 3.712259] ASoC: probe ti-tas2550 dai link 0 late -1
[ 3.716086] ASoC: probe ti-tas2550 dai link 0 late 0
[ 3.719756] ASoC: probe ti-tas2550 dai link 0 late 1
[ 3.723422] ASoC: probe ti-tas2550 dai link 0 late 2
[ 3.750046] imx-tas2552 sound-tas2552: tas2552-amplifier <-> 202c000.ssi mapping ok
[ 3.756505] Adding route OUT -> direct -> Ext Spk
...
[ 3.824546] ALSA device list:
[ 3.826227] #0: ti-tas2550

 

Here is the output of speaker test:

 

 

# speaker-test

speaker-test 1.1.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)

 

##### tas2552_hw_params #####

#####  tas2552_setup_pll  #####
Pll_clk == 24576000
pll_clkin == 24000000

 

Buffer size range from 64 to 16384
Period size range from 32 to 8192

Using max buffer size 16384

Periods = 4

 


##### tas2552_prepare #####


##### tas2552_mute #####
Register 0x1 set to 0x10
Register 0x2 set to 0xee
Register 0x3 set to 0x5d
Register 0x4 set to 0x0
Register 0x5 set to 0x0
Register 0x6 set to 0x0
Register 0x7 set to 0xc8
Register 0x8 set to 0x20
Register 0x9 set to 0x0
Register 0xa set to 0x0
Register 0xb set to 0x8f
Register 0xc set to 0x80
Register 0xe set to 0x28
Register 0xf set to 0x4
Register 0x10 set to 0x0
Register 0x11 set to 0x1
Register 0x12 set to 0x16
Register 0x13 set to 0x40
Register 0x14 set to 0x3
Register 0x16 set to 0x8
Register 0x19 set to 0x0
Register 0x0 set to 0x0
was set period_size = 4096
was set buffer_size = 16384
0 - Front Left
Time per period = 2.657305
0 - Front Left

 

Still no output from the speaker.

 

Any thoughts?

Original Attachment has been moved to: imx-tas2552.c.zip

ラベル(3)
0 件の賞賛
1 解決策
1,203件の閲覧回数
aduskett
Contributor II

Just an update, I did get the amplifier to work!  The main problem was on the schematic.  The Address line is set to ground and IOVDD.  As soon as I removed R172 i2c worked and the tas instantly started producing sound.

This was primarily a failure of the tas2552.c driver not verifying weather or not the i2c writes were successful. 

元の投稿で解決策を見る

4 返答(返信)
1,204件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi Adam

one can check SGTL5000 on i.MX6 in I2S master mode

No sound captured with SGTL5000 on i.MX6 in I²S master mode - Patchwork 

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

0 件の賞賛
1,204件の閲覧回数
aduskett
Contributor II

Hey igor;

Unfortuantly that did not help;

As you can see in the driver I wrote; I am setting everything to slave for the tas2552.  I get the following frequencies:

MCLK: 24mhz

BCLK: 3.061mhz

WCLK: 48khz (I am sending a 48Khz signal using speaker test.)

Those numbers look correct, however no sound is coming out of the speaker.  This is in slave mode.

Edit*  Here are some pictures so you can verify:

wclk vs bclk:

tas2552_bclk.jpg

Data:

tas2552_data.jpg

0 件の賞賛
1,204件の閲覧回数
aduskett
Contributor II

Just an update, I did get the amplifier to work!  The main problem was on the schematic.  The Address line is set to ground and IOVDD.  As soon as I removed R172 i2c worked and the tas instantly started producing sound.

This was primarily a failure of the tas2552.c driver not verifying weather or not the i2c writes were successful. 

1,204件の閲覧回数
shabeerbadarudh
Contributor IV

Hi Adam Duskett,

In Which Linux kernel you tested tas2552 audio?

We are facing some issues with default 4.1.15 tas driver. But when we modify the register configuration with YOUR settings taken from above log (disabled "snd_soc_xxx" functions from tas driver and overwrite the register values from "tas mute" routine using I2C write APIs), Audio is working perfectly.

Thanks in advance,

Shabeer

0 件の賞賛