Question about audio playback with ssi as i2s slave on i.mx6sx

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

Question about audio playback with ssi as i2s slave on i.mx6sx

1,594 Views
sevenlin
Contributor II

Hi,

My codec is tas5756m, and the codec is master.
However, by measuring BCLK and WCLK is no signal output while playback an audio file.

(MCLK & SDIN have signal output)

My code is modified as follows:

dts:
sound {
compatible = "fsl,imx6sx-fpa-tas5756", "fsl,imx-audio-tas5756";
model = "tas5756-audio";
cpu-dai = <&ssi2>;
audio-codec = <&codec>;
mux-int-port = <2>;
mux-ext-port = <6>;
codec-master;
};


&ssi2 {
assigned-clocks = <&clks IMX6SX_CLK_PLL4>,
<&clks IMX6SX_PLL4_BYPASS>,
<&clks IMX6SX_CLK_SSI2_SEL>;
assigned-clock-parents = <&clks IMX6SX_CLK_OSC>,
<&clks IMX6SX_CLK_PLL4>,
<&clks IMX6SX_CLK_PLL4_AUDIO_DIV>;
assigned-clock-rates = <737280000>, <0>, <0>;
status = "okay";
};

pinctrl_audmux: audmuxgrp {
fsl,pins = <
MX6SX_PAD_CSI_DATA00__AUDMUX_AUD6_TXC 0x130b0
MX6SX_PAD_CSI_DATA01__AUDMUX_AUD6_TXFS 0x130b0
MX6SX_PAD_CSI_HSYNC__AUDMUX_AUD6_TXD 0x120b0
MX6SX_PAD_CSI_VSYNC__AUDMUX_AUD6_RXD 0x130b0
MX6SX_PAD_CSI_PIXCLK__AUDMUX_MCLK 0x130b0

code:

int_port--;
ext_port--;
if (data->is_codec_master) {
tmp_port = int_port;
int_port = ext_port;
ext_port = tmp_port;
}

ret = imx_audmux_v2_configure_port(ext_port,
IMX_AUDMUX_V2_PTCR_SYN |
IMX_AUDMUX_V2_PTCR_TFSEL(int_port) |
IMX_AUDMUX_V2_PTCR_TCSEL(int_port) |
IMX_AUDMUX_V2_PTCR_TFSDIR |
IMX_AUDMUX_V2_PTCR_TCLKDIR,
IMX_AUDMUX_V2_PDCR_RXDSEL(int_port));
if (ret) {
dev_err(&pdev->dev, "audmux internal port setup failed\n");
goto fail;
}
ret = imx_audmux_v2_configure_port(int_port,
IMX_AUDMUX_V2_PTCR_SYN,
IMX_AUDMUX_V2_PDCR_RXDSEL(ext_port));
if (ret) {
dev_err(&pdev->dev, "audmux external port setup failed\n");
goto fail;
}

dai_format = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF | SND_SOC_DAIFMT_C

BS_CFS;

My audio layout between codec and CSI as below:  

TAS5756MDCAR.JPG

MCIMX6X4CVM08AC.JPG


Please give me some advice, thanks.

Labels (1)
Tags (2)
0 Kudos
6 Replies

1,166 Views
sevenlin
Contributor II

Hello,

Does anyone have information to update about my problem and memtool dump value?

Thanks.

0 Kudos

1,166 Views
igorpadykov
NXP Employee
NXP Employee

Hi 愷宥 林 

what bsp used in the case, one can look at nxp WM8962 example from Code Aurora git repositories 

linux/arch/arm/boot/dts/imx6sx-sdb.dtsi

imx6sx-sdb.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

and description of codec drivers in Table 28-1. Stereo Codec SoC Driver Files attached Linux Manual.

For BCLK and WCLK signals one can attach jtag debugger and check SSI registers,

use sect.62.8.4.1 SSI Clock and Frame Sync Generation i.MX6SX Reference Manual.

http://www.nxp.com/docs/en/reference-manual/IMX6SXRM.pdf 

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

0 Kudos

1,166 Views
sevenlin
Contributor II

Hi igorpadykov,


BSP: Linux_4.9.88-r0.

Sice we don't have jtag debugger, we use memtool to dump SSI registers value as below:

Capture.JPG


root@imx6sxsabresd:/unit_tests# ./memtool -32 202C000 12
E
Reading 0x12 count starting at address 0x0202C000

0x0202C000: 00000000 00000000 00000000 00000000
0x0202C010: 00001190 00003003 00003003 00000369
0x0202C020: 00000349 00040100 00040100 00880088
0x0202C030: 00000000 00000000 00000000 00000000
0x0202C040: 00000000 00000000


Could you help us to check it whether it is normal?

Thanks.

0 Kudos

1,166 Views
sevenlin
Contributor II

Sorry, I should dump the register while playback.

The dump table is under no audio file playback.

Update my dump with playback audio:

[playback]

root@imx6sxsabresd:/unit_tests# ./memtool -32 202C000 12
E
Reading 0x12 count starting at address 0x0202C000


0x0202C000: 0000F83B 0000F83B 00000000 00000000
0x0202C010: 000011BB 000030A0 009031A3 000003E9
0x0202C020: 00000349 0000E101 00040100 0B880B88
0x0202C030: 0000111B 00000000 00000000 00000000
0x0202C040: 00000000 00000000

Please help us to check whether it is normal.

Thanks.

0 Kudos

1,166 Views
sevenlin
Contributor II

Hi,

I also have some questions.
My codec is codec-master, so it is i2s slave to CPU, right?

That means it would be i2s-slave, right?

&ssi2 {
fsl,mode = "i2s-slave";

.

.

According to my memtool dump during playback,
for 0x0202C010, and its value is 000011BB and map it to i.MX6SX Reference Manual,
we could get the i2s mode selection is "I2S master mode" (Refer to Table 62-5)

So, where I need to modify to change i2s mode to be slave?
or do I have a misunderstanding about the definition of i2s slave?

Please correct me, thanks.

0 Kudos

1,166 Views
sevenlin
Contributor II

Hi,

Currently, LRCK/FS and SCLK have no signal output, however, MCLK & SDIN have signal output, we are so confused.
Please help to check memtool dump register while playback an audio file

root@imx6sxsabresd:/unit_tests# ./memtool -32 202C000 12
E
Reading 0x12 count starting at address 0x0202C000

0x0202C000: 0000F83B 0000F83B 00000000 00000000
0x0202C010: 000011BB 000030A0 009031A3 000003E9
0x0202C020: 00000349 0000E101 00040100 0B880B88
0x0202C030: 0000111B 00000000 00000000 00000000
0x0202C040: 00000000 00000000

Is there any abnormal value in it?

Also,
for 0x0202C010, and its value is 000011BB and map it to i.MX6SX Reference Manual,
we could get the i2s mode selection is "I2S master mode" (Refer to Table 62-5)
So, where I need to modify to change i2s mode to be slave?


Thanks.

0 Kudos