register of I2s not work I2S_AXBAR_TX_SOFT_RESET_0 (audio)

Hi

  1. I work with tx1+SDK 28.2; the speaker device is tas5751 with i2s4(0-4), it always sound less. I have no idear to debug it!! help help help
  2. kernel show trace as follow :
    [ 18.067337] tegra210-i2s tegra210-i2s.0: Failed at I2S0_RX sw reset
    [ 18.082612] tegra210-i2s tegra210-i2s.0: ASoC: PRE_PMU: I2S1 DAP RX event failed: -22
  3. my dts as follow:
    4)additional important info : aplay can not work until few seconds going on
    trace as follow:
    ALSA lib pcm_hw.c:1700:(_snd_pcm_hw_open) Invalid value for card
    aplay: main:722: audio open error: No such device

DTS:

gpio: gpio@6000d000 {
gpio-init-names = “default”;
gpio-init-0 = <&gpio_default>;

gpio_default: default {

/* Transfer pins from GPIO to I2S for audio. /
gpio-to-sfio = < /
GPIO# TX1-PIN TX1-FUNC/ERA-FUNC CODEC-PIN /
TEGRA_GPIO(B, 0) /
8 H1 I2S0_LRCLK/SFSYNC R335/3 /
TEGRA_GPIO(B, 1) /
9 G1 I2S0_SDIN R339/5 /
TEGRA_GPIO(B, 2) /
10 H2 I2S0_SDOUT R337/4 /
TEGRA_GPIO(B, 3) /
11 G2 I2S0_CLK/SRCLK R334/2 /
TEGRA_GPIO(K, 0) /
80 D13 I2S1_LRCLK/SFSYNC /
TEGRA_GPIO(K, 1) /
81 C14 I2S1_SDIN /
TEGRA_GPIO(K, 2) /
82 D14 I2S1_SDOUT /
TEGRA_GPIO(K, 3) /
83 C15 I2S1_CLK/SRCLK /
TEGRA_GPIO(BB, 0) /
216 F1 AUDIO_MCLK R1/R332/1 */

;
};

};

sound_card: sound {
compatible = “nvidia,tegra-audio-t210ref-mobile-rt565x”;
nvidia,model = “tegra-snd-t210ref-mobile-rt565x”;

clocks = <&tegra_car TEGRA210_CLK_PLL_P_OUT1>,
<&tegra_car TEGRA210_CLK_PLL_A>,
<&tegra_car TEGRA210_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA210_CLK_D_AUDIO>,
<&tegra_car TEGRA210_CLK_CLK_M>,
<&tegra_car TEGRA210_CLK_EXTERN1>;
clock-names = “pll_p_out1”, “pll_a”, “pll_a_out0”, “ahub”,
“clk_m”, “extern1”;

assigned-clocks = <&tegra_car TEGRA210_CLK_PLL_A>,
<&tegra_car TEGRA210_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA210_CLK_D_AUDIO>,
<&tegra_car TEGRA210_CLK_EXTERN1>;
assigned-clock-rates = <368640000>, <36864000>,
<36864000>, <12288000>;

nvidia,num-codec-link = <2>;

nvidia,audio-routing =
“x Headphone”, “x OUT”,
“x IN”, “x Mic”,
“y Headphone”, “y OUT”,
“y IN”, “y Mic”,
“l Headphone”, “l OUT”,
“l IN”, “l Mic”,
“s Headphone”, “s OUT”,
“s IN”, “s Mic”,
“w Headphone”, “w OUT”,
“w IN”, “w Mic”,
“z IN”, “z Mic”;

nvidia,xbar = <&tegra_axbar>;

/* The codec-dai here is initialized to dummy and will be /
/
replaced with rt565x codec-dai on detecting super-module */
nvidia,dai-link-1 {
link-name = “rt565x-playback”;
cpu-dai = <&tegra_i2s1>;
codec-dai = <&spdif_dit4>;
cpu-dai-name = “I2S1”;
codec-dai-name = “dit-hifi”;
format = “i2s”;
bitclock-master;
frame-master;
bitclock-noninversion;
frame-noninversion;
bit-format = “s16_le”;
bclk_ratio = <2>;
srate = <96000>;
num-channel = <2>;
ignore_suspend;
name-prefix = “y”;
};

nvidia,dai-link-2 {
link-name = “tas5751-playback”;
cpu-dai = <&tegra_i2s5>;
codec-dai = <&tas5751>;
cpu-dai-name = “I2S5”;
codec-dai-name = “tas5751-speaker”;
format = “i2s”;
bitclock-slave;
frame-slave;
bit-format = “s16_le”;
bclk_ratio = <2>;
srate = <96000>;
num-channel = <2>;
ignore_suspend;
name-prefix = “x”;
};

cat /sys/kernel/debug/clk/clk_summary, i2s4_sync seemed not enalbe, How to enable it ?

i2s4_sync 0 0 24576000 24576000 0 0
i2s3_sync 0 0 24000000 24000000 0 0
i2s2_sync 0 0 24000000 24000000 0 0
i2s1_sync 0 0 24000000 24000000 0 0
i2s0_sync 0 0 24000000 24000000 0 0
i2s4 1 1 752639 1536000 0 0
i2s3 0 0 752639 1536000 0 0
i2s2 0 0 752639 1536000 0 0
i2s1 0 0 752639 1536000 0 0
i2s0 0 0 752639 1536000 0 0

Hello!

To begin with, I want to make sure I understand exactly how you have this setup.

  1. Can you tell me which header the TAS5751 is connected to on the Jetson TX1?
  2. Your DT snippet, does not include the node for the ‘tas5751’. Where is this defined?
  3. I don’t see a Linux driver for TAS5751? Do you have a driver for this device?

Thanks
Jon

Hi jonathanh

Thanks for your reply.
backgroud of all: Tas5751 is work well int TX1 + 24.2.1 package on my hardware; I am working for porting tas5751 into latest package 28.2 with my hardware. unfortunately the clk or DAMP of audio system was not work when I only modify DTS of 28.2.

  1. TAS5751 is connect to i2s5@702d1400 which include from tegra210-soc-base.dtsi:
    tegra_i2s5: i2s{
    compatible = “nvidia,tegra210-i2s”;
    reg = <0x702d1400 0x100>;
    nvidia,ahub-i2s-id = <4>;
    status = “okay”;
    };

  2. TAS5751 is a I2C codec, I use it to be a speaker; The dts about TAS5751 is that:
    i2c@7000c500 {
    tas5751: tas5751.2-002a@2a {
    compatible = “ti,tas5751”;
    reg = <0x2a>;
    status = “okay”;
    };

             bmi160@68 {
                     compatible = "bosch,bmi160";
                     reg = <0x68>;
                     status = "okay";
             };
    
     };
    

    i2c3: i2c@7000c500 {
    #address-cells = <1>;
    #size-cells = <0>;
    compatible = “nvidia,tegra210-i2c”;
    reg = <0x0 0x7000c500 0x0 0x100>;
    interrupts = <0 92 0x04>;
    iommus = <&smmu TEGRA_SWGROUP_PPCS>;
    status = “okay”;
    clock-frequency = <100000>;
    };

3) TAS5751 have been drived successfully on TX1+242.1 package; I think it work well.

  1. I have attched my source code.tegra_t210ref_mobile_rt565x_alt.c have been some debug & change in tegra_t210ref_dai_init() for clk init

tegra_t210ref_mobile_rt565x_alt.c (33.1 KB)
tas5751.c (50.7 KB)

Hi jonathanh
I take i2s1 to be a capture and i2s to be a playback

root@tegra-ubuntu:/home/nvidia# cat /sys/kernel/debug/regmap/tegra210-i2s.0/registers 
00: 00000000
04: XXXXXXXX
0c: XXXXXXXX
10: XXXXXXXX
14: 00000003
18: 00000000
1c: 00000000
20: 00007700
24: 00000100
28: 00000000
2c: 00000000
34: 00000000
40: 00000000
44: XXXXXXXX
4c: XXXXXXXX
50: XXXXXXXX
54: 00000003
58: 00000000
5c: 00000000
60: 03113300
64: 00000100
68: 00000000
6c: 00000000
74: 00000000
80: 00000001
84: 00000000
88: 00000001
8c: 00000000
90: XXXXXXXX
a0: 1f000003
a4: 0000001f
a8: 00000000
ac: 00000000
b0: 00000000
root@tegra-ubuntu:/home/nvidia# cat /sys/kernel/debug/regmap/tegra210-i2s.4/registers 
00: 00000001
04: 00000000
0c: 00000001
10: 00000000
14: 00000003
18: 00000000
1c: 00000000
20: 03111100
24: 00000100
28: 00000000
2c: 00000000
34: 00000000
40: 00000000
44: 00000000
4c: 00000002
50: 00000000
54: 00000003
58: 00000000
5c: 00000000
60: 00007700
64: 00000100
68: 00000000
6c: 00000000
74: 00000000
80: 00000001
84: 00000000
88: 00000001
8c: 00000000
90: 00000000
a0: 1f000401
a4: 0000000f
a8: 00000000
ac: 00000000
b0: 00000001

Somebody of NVidia can help me ?

So the above tells me that it is trying to enable I2S1 although you wish to use I2S5. This is probably because the ‘I2S1 Mux’ and ‘I2S5 Mux’ are routed to the same ADMAIF interface. Can you attach the output from …

alsactl store -f asound.state

Can you tell me the exact aplay command you are using?

Thanks
Jon

Hi jonathanh

Thansk very much for your reply.

1)asound.state would been attached, please check
2)I play music just use “aplay chengdu.wav” which is same with 24.3
3) caputure is worked and play is not, after config gpio refer to https://devtalk.nvidia.com/default/topic/949616/jetson-tx1/setting-audio_mclk-to-output/1:

echo 216 > /sys/class/gpio/export #AUD_MCLK
echo 8 > /sys/class/gpio/export #LR 
echo 9 > /sys/class/gpio/export #Data in
echo 11 > /sys/class/gpio/export #BCLK
echo 8 > /sys/class/gpio/unexport
echo 9 > /sys/class/gpio/unexport
echo 11 > /sys/class/gpio/unexport
echo 216 > /sys/class/gpio/unexport
  1. I think it is due to clk that sound less. But I don not knonw how to config I2S clk on package 28.2

amixer_settings.txt (1.82 KB)
asound.state.txt (139 KB)

Yes so you have ‘I2S1 Mux’ mapped to ADMAIF1 and ‘I2S5 Mux’ not routed to anything.

Can you try …

amixer -c tegrasndt210ref cset name="I2S1 Mux" "None"
amixer -c tegrasndt210ref cset name="I2S5 Mux" "ADMAIF1"

Can you tell me the output from …

ls -l /etc/asound.conf

Regards,
Jon

root@tegra-ubuntu:/boot# ls -l /etc/asound.conf
lrwxrwxrwx 1 root root 32 Jun 19 10:03 /etc/asound.conf -> /etc/asound.conf.tegrasndt210ref

asound.conf.tegrasndt210ref.txt (1.31 KB)

Hi jonathanh
Thanks very much.This issue is fixed. changed as followed:
1)adapt pin mux to 28.2

diff --git a/kernel-dts/tegra210-jetson-cv-base-p2597-2180-a00.dts b/kernel-dts/tegra210-jetson-cv-base-p2597-2180-a00.dts
index d1046a3e3d22..10729ec8a48f 100644
--- a/kernel-dts/tegra210-jetson-cv-base-p2597-2180-a00.dts
+++ b/kernel-dts/tegra210-jetson-cv-base-p2597-2180-a00.dts
@@ -77,6 +77,27 @@
 		};
 	};
 
+	gpio@6000d000 {
+		p2597-j21-audio {
+			gpio-hog;
+			function;
+			gpios = <
+				TEGRA_GPIO(B, 0) 0
+				TEGRA_GPIO(B, 1) 0
+				TEGRA_GPIO(B, 2) 0
+				TEGRA_GPIO(B, 3) 0
+				TEGRA_GPIO(BB, 0) 0
+				TEGRA_GPIO(E, 4) 0
+				TEGRA_GPIO(E, 5) 0
+				>;
+			label = "I2S0_LRCLK", "I2S0_SDIN",
+				"I2S0_SDOUT", "I2S0_CLK",
+				"AUDIO_MCLK", "DMIC3_CLK",
+				"DMIC3_DAT";
+			status = "okay";
+		};
+	};
+
 	pinmux@700008d4 {
 		/* Dynamic pinmux config for DMIC3 */
 		dmic3_dap_active_state: dmic3_dap_active {

2)enable clk of all