How to use the same clock for two i2s-slave in tegra TX2?

We connected two microphone(SPH0615) to I2S1 and I2S2 with corresponding clocks and were able to record the audio. But, when tried to use the i2s1 clock as common for both i2s1 and i2s2. We can able to hear the recorded audio in i2s1 but i2s2 is showing some errors.

Test setup:
we loopback the word select and clock of i2s1 and i2s2.
The device used for recording is SPH0615
Command used to record:

I2S1:
amixer -c tegrasndt186ref sset "ADMAIF1 Mux" "I2S1"
arecord -D hw:tegrasndt186ref,0 -r 48000 -f S32_LE -c 2 -d 10 i2s1.wav
I2S2:
amixer -c tegrasndt186ref sset "ADMAIF1 Mux" "I2S2"
arecord -D hw:tegrasndt186ref,1 -r 48000 -f S32_LE -c 2 -d 10 i2s2.wav

CASE 1:
Error details in I2S2:

Simple mixer control 'ADMAIF2 Mux',0
  Capabilities: enum
  Items: 'None' 'ADMAIF1' 'ADMAIF2' 'ADMAIF3' 'ADMAIF4' 'ADMAIF5' 'ADMAIF6' 'ADMAIF7' 'ADMAIF8' 'ADMAIF9' 'ADMAIF10' 'ADMAIF11' 'ADMAIF12' 'ADMAIF13' 'ADMAIF14' 'ADMAIF15' 'ADMAIF16' 'I2S1' 'I2S2' 'I2S3' 'I2S4' 'I2S5' 'I2S6' 'SFC1' 'SFC2' 'SFC3' 'SFC4' 'MIXER1-1' 'MIXER1-2' 'MIXER1-3' 'MIXER1-4' 'MIXER1-5' 'AMX1' 'AMX2' 'AMX3' 'AMX4' 'ARAD1' 'SPDIF1-1' 'SPDIF1-2' 'AFC1' 'AFC2' 'AFC3' 'AFC4' 'AFC5' 'AFC6' 'OPE1' 'SPKPROT1' 'MVC1' 'MVC2' 'IQC1-1' 'IQC1-2' 'IQC2-1' 'IQC2-2' 'DMIC1' 'DMIC2' 'DMIC3' 'DMIC4' 'ADX1-1' 'ADX1-2' 'ADX1-3' 'ADX1-4' 'ADX2-1' 'ADX2-2' 'ADX2-3' 'ADX2-4' 'ADX3-1' 'ADX3-2' 'ADX3-3' 'ADX3-4' 'ADX4-1' 'ADX4-2' 'ADX4-3' 'ADX4-4' 'ADMAIF17' 'ADMAIF18' 'ADMAIF19' 'ADMAIF20' 'ASRC1-1' 'ASRC1-2' 'ASRC1-3' 'ASRC1-4' 'ASRC1-5' 'ASRC1-6'
  Item0: 'I2S2'
Recording WAVE 'i2s2.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
arecord: pcm_read:2103 read error: input/output error

dtb

rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&spdif_dit0>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};
		nvidia,dai-link-2 {
			link-name = "spdif-dit-1";
			cpu-dai = <&tegra_i2s2>;
			codec-dai = <&spdif_dit1>;
			cpu-dai-name = "I2S2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-master;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "y";
			status = "okay";
		};

CASE 2:
Error details in I2S2:

[   69.465292] tegra210-i2s tegra210-i2s.1: Failed at I2S1_RX sw reset
[   69.471947] tegra210-i2s tegra210-i2s.1: ASoC: PRE_PMU: I2S2 DAP RX event failed: -22

dtb

rt565x_dai_link: nvidia,dai-link-1 {
			link-name = "rt565x-playback";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&spdif_dit0>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-slave;
			frame-slave;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <0>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};
		nvidia,dai-link-2 {
			link-name = "spdif-dit-1";
			cpu-dai = <&tegra_i2s2>;
			codec-dai = <&spdif_dit1>;
			cpu-dai-name = "I2S2";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-master;
			frame-master;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			bclk_ratio = <1>;
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "y";
			status = "okay";
		};

Hello!

The above does not appear to be correct because both I2S1 and I2S2 are connected to the ‘ADMAIF1 Mux’. Please ensure they are connected to different ADMAIFs.

Is there any difference in the DT configuration between case 1 and case 2? Otherwise what is the difference? Just different failure messages?

You also need to check that the ‘input-enable’ bit in the pinmux registers is set for the I2S2 FS and SCLK pins in order to receive the frame-sync and bit-clock. To check verify that bit 6 is set, per the below it is not by default. To update the pinmux configuration please see the L4T documentation.

$ sudo grep "dap2" /sys/kernel/debug/tegra_pinctrl_reg
Bank: 0 Reg: 0x02434000 Val: 0x00000458 -> dap2_din_pc3
Bank: 0 Reg: 0x02434008 Val: 0x00000400 -> dap2_dout_pc2
Bank: 0 Reg: 0x02434010 Val: 0x00000400 -> dap2_fs_pc4
Bank: 0 Reg: 0x02434018 Val: 0x00000400 -> dap2_sclk_pc1

Regards,
Jon

Thank you for your replay Jonathan

  1. There are some differences in case 1 and case 2 dtbs. The changes are in line number 27 and 28 in both the dtbs.
  2. As you mentioned, we tried ADMAIF1 for i2s1 and ADMAIF2 for i2s2. It also showing the same error.
  3. We also checked the pin-mux values as you mentioned above. It is already in the input state.
  4. $ sudo grep "dap2" /sys/kernel/debug/tegra_pinctrl_reg
    Bank: 0 Reg: 0x02434000 Val: 0x00000450 -> dap2_din_pc3
    Bank: 0 Reg: 0x02434008 Val: 0x00000440 -> dap2_dout_pc2
    Bank: 0 Reg: 0x02434010 Val: 0x00000440 -> dap2_fs_pc4
    Bank: 0 Reg: 0x02434018 Val: 0x00000440 -> dap2_sclk_pc1
    Bank: 0 Reg: 0x02434004 Val: 0x01616000 -> drive_dap2_din
    Bank: 0 Reg: 0x0243400c Val: 0x01616000 -> drive_dap2_dout
    Bank: 0 Reg: 0x02434014 Val: 0x01616000 -> drive_dap2_fs
    Bank: 0 Reg: 0x0243401c Val: 0x01616000 -> drive_dap2_sclk
    

Hello!

Yes I see the difference now. My advice would be to stick case 1. Do you have the fsync from I2S1 connected to I2S2?

If so then I would try the following as a test …

amixer -c tegrasndt186ref sset "ADMAIF1 Mux" "I2S1"
amixer -c tegrasndt186ref sset "ADMAIF2 Mux" "I2S2"
arecord -D hw:tegrasndt186ref,0 -r 48000 -f S32_LE -c 2 -d 10 i2s1.wav &
sleep 1
arecord -D hw:tegrasndt186ref,1 -r 48000 -f S32_LE -c 2 -d 5 i2s2.wav

If the above test works, then probably what is happening is either the I2S1 is not turning on quick enough for I2S2 or the I2S1 is turning off to soon before I2S2 finishes. Basically, we need to ensure that the I2S1 clock/fsync is active while I2S2 is capturing data. It can be possible to make some driver changes so we do not need these sleeps.

Regards,
Jon

Thank you for your replay Jonathan

We have error while run the above command as a script.

Simple mixer control 'ADMAIF1 Mux',0
  Capabilities: enum
  Items: 'None' 'ADMAIF1' 'ADMAIF2' 'ADMAIF3' 'ADMAIF4' 'ADMAIF5' 'ADMAIF6' 'ADMAIF7' 'ADMAIF8' 'ADMAIF9' 'ADMAIF10' 'ADMAIF11' 'ADMAIF12' 'ADMAIF13' 'ADMAIF14' 'ADMAIF15' 'ADMAIF16' 'I2S1' 'I2S2' 'I2S3' 'I2S4' 'I2S5' 'I2S6' 'SFC1' 'SFC2' 'SFC3' 'SFC4' 'MIXER1-1' 'MIXER1-2' 'MIXER1-3' 'MIXER1-4' 'MIXER1-5' 'AMX1' 'AMX2' 'AMX3' 'AMX4' 'ARAD1' 'SPDIF1-1' 'SPDIF1-2' 'AFC1' 'AFC2' 'AFC3' 'AFC4' 'AFC5' 'AFC6' 'OPE1' 'SPKPROT1' 'MVC1' 'MVC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ADMAIF20' 'ASRC1-1' 'ASRC1-2' 'ASRC1-3' 'ASRC1-4' 'ASRC1-5' 'ASRC1-6'
  Item0: 'I2S3'
Recording WAVE 'i2s1.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
Recording WAVE 'i2s2.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
arecord: pcm_read:2032: read error: Input/output error

I2S BLOCK DIAGRAM.jpg

Hello!

Before you run the test can you execute the following command …

echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable

Run the test and after the test completes can you run the following command …

sudo cat /sys/kernel/debug/tracing/trace > audio.log

And attach the ‘audio.log’ file to this thread?

Thanks
Jon

In the above I see I2S3 and not I2S2? Can you make sure you are using I2S2?

Regards,
Jon

By the way, the diagram shows that the Mics are connected to the SOM. Are they really connected directly to the SOM or are you using the Jetson TX2 devkit and connecting them to headers J21 (I2S1) and J26 (I2S2)?

Please note that if you are using the Jetson TX2 devkit, then you need to make sure that J24 is in position 2-3, otherwise I2S1 will operate at 3.3V and I2S2 will operate at 1.8V. Both need to be 1.8V.

Regards,
Jon

Thank you Jonathan

By mistake, I attached the logs.We are testing with both I2S2 and I2S3.

We are using the custom carrier board. I have attached the connection diagram and audio trace log.

audio.log (6.4 KB)

I2S POWER CONNECTION.jpg

Thanks. From looking at the log I see …

  1. I2S1 capture start
  2. 1 second later I2S2 capture start (as expected)
  3. 9 seconds later I2S1 capture finishes
  4. 1 second later I2S2 capture finishes

The above is not going to work, because I2S2 needs to start after I2S1 and finish before I2S1. I2S2 capture is reporting an error because I2S1 as turned off the clocks before I2S2 has finished.

If you look at the test I suggesteed in comment #4, I2S2 should only capture for 5 seconds and not 10 seconds and I2S1 should capture for 10 seonds. Yes I understand that you probably want both to capture for the same amount of time, but just to prove it works, I want to see that if I2S2 finishes before I2S1 then you do not get any errors. Please try the test again as shown in comment #4 and let me know if you still see errors.

Thanks
Jon

Thanks for your response Jonathan

Still We got the same error, I used the following commands and attached the log with this.

amixer -c tegrasndt186ref sset "ADMAIF1 Mux" "I2S1"
amixer -c tegrasndt186ref sset "ADMAIF2 Mux" "I2S2"
arecord -D hw:tegrasndt186ref,0 -r 48000 -f S32_LE -c 2 -d 30 i2s1.wav &
sleep 5
arecord -D hw:tegrasndt186ref,1 -r 48000 -f S32_LE -c 2 -d 5 i2s2.wav

audio.log (6.4 KB)

Thanks and by same error you mean …

arecord: pcm_read:2103 read error: input/output error

And not …

[   69.465292] tegra210-i2s tegra210-i2s.1: Failed at I2S1_RX sw reset
[   69.471947] tegra210-i2s tegra210-i2s.1: ASoC: PRE_PMU: I2S2 DAP RX event failed: -22

The 2nd error message, when the sw reset fails, indicates that the I2S is not receiving the bit clock. So if you are not seeing this, we know I2S2 is seeing the bit clock. However, now I am wondering if I2S2 is not seeing the frame-sync?

From the log I can see that the I2S2 does start after I2S1 and does finish before I2S1.

Can you run the above test again, but this time before you start the test run the following commands …

echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
echo snd_pcm_update_hw_ptr | sudo tee /sys/kernel/debug/tracing/set_ftrace_filter
echo snd_pcm_update_hw_ptr0 | sudo tee /sys/kernel/debug/tracing/set_ftrace_filter
echo function | sudo tee /sys/kernel/debug/tracing/current_tracer

If the function snd_pcm_updaate_hw_ptr/snd_pcm_updaate_hw_ptr0 is being called then we know we are receiving data. We should see these being called for both arecord processes. If it is only being called for I2S1, then it will indicate that maybe there is a problem with the frame-sync.

Regards,
Jon

Thank you for your quick response Jonathan

In our som, I can’t able to find /sys/kernel/debug/tracing/set_ftrace_filter file.

tee: /sys/kernel/debug/tracing/set_ftrace_filter: Permission denied
snd_pcm_update_hw_ptr

# ls /sys/kernel/debug/tracing/set_ftrace_filter 
ls: cannot access '/sys/kernel/debug/tracing/set_ftrace_filter': No such file or directory

Then “echo function | sudo tee /sys/kernel/debug/tracing/current_tracer” this command is showing Invalid argument.

tee: /sys/kernel/debug/tracing/current_tracer: Invalid argument

# cat available_tracers 
nop

How to create this file?

Hello!

You need to have the kernel function tracer enabled in the kernel configuration. You can check if it is enabled by …

$ zcat /proc/config.gz | grep FUNCTION_TRACER
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_FUNCTION_TRACER=y

So if you do not have this, you need to enabled in the kernel configuration (tegra_defconfig) and rebuild the kernel. Please see the L4T documentation for rebuilding the kernel.

Regards,
Jon

Thanks for your response Jonathan

We changed the Image and we are able to get the logs. Please find the attachment below.

Script:

amixer -c tegrasndt186ref sset "ADMAIF1 Mux" "I2S1"
amixer -c tegrasndt186ref sset "ADMAIF2 Mux" "I2S2"
arecord -D hw:tegrasndt186ref,0 -r 48000 -f S32_LE -c 2 -d 30 i2s1.wav &
echo 0 | sudo tee /sys/kernel/debug/tracing/trace
echo 0 | sudo tee /sys/kernel/debug/tracing/events/enable
echo 1 | sudo tee /sys/kernel/debug/tracing/tracing_on
echo 1 | sudo tee /sys/kernel/debug/tracing/events/asoc/snd_soc_dapm_widget_power/enable
echo snd_pcm_update_hw_ptr | sudo tee /sys/kernel/debug/tracing/set_ftrace_filter
echo snd_pcm_update_hw_ptr0 | sudo tee /sys/kernel/debug/tracing/set_ftrace_filter
echo function | sudo tee /sys/kernel/debug/tracing/current_tracer
sleep 5
echo snd_pcm_update_hw_ptr | sudo tee /sys/kernel/debug/tracing/set_ftrace_filter
echo snd_pcm_update_hw_ptr0 | sudo tee /sys/kernel/debug/tracing/set_ftrace_filter
echo function | sudo tee /sys/kernel/debug/tracing/current_tracer
arecord -D hw:tegrasndt186ref,1 -r 48000 -f S32_LE -c 2 -d 10 i2s2.wav

Error log:

Simple mixer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SFC2' 'SFC3' 'SFC4' 'MIXER1-1' 'MIXER1-2' 'MIXER1-3' 'MIXER1-4' 'MIXER1-5' 'AMX1' 'AMX2' 'AMX3' 'AMX4' 'ARAD1' 'SPDIF1-1' 'SPDIF1-2' 'AFC1' 'AFC2' 'AFC3' 'AFC4' 'AFC5' 'AFC6' 'OPE1' 'SPKPROT1' 'MVC1' 'MVC2' 'IQC1-1' 'IQC1-2' 'IQC2-1' 'IQC2-2' 'DMIC1' 'DMIC2' 'DMIC3' 'DMIC4' 'ADX1-1' 'ADX1-2' 'ADX1-3' 'ADX1-4' 'ADX2-1' 'ADX2-2' 'ADX2-3' 'ADX2-4' 'ADX3-1' 'ADX3-2' 'ADX3-3' 'ADX3-4' 'ADX4-1' 'ADX4-2' 'ADX4-3' 'ADX4-4' 'ADMAIF17' 'ADMAIF18' 'ADMAIF19' 'ADMAIF20' 'ASRC1-1' 'ASRC1-2' 'ASRC1-3' 'ASRC1-4' 'ASRC1-5' 'ASRC1-6'
  Item0: 'I2S2'
Recording WAVE 'i2s1.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
0
0
1
1
snd_pcm_update_hw_ptr
snd_pcm_update_hw_ptr0
function
snd_pcm_update_hw_ptr
snd_pcm_update_hw_ptr0
function
Recording WAVE 'i2s2.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
arecord: pcm_read:2032: read error: Input/output error

audio.log (258 KB)

Thanks! From looking at the log, you can see that only the hwptr for arecord process associated with I2S1 is being updated. In other words, the circular buffer for I2S2 is not being filled as no data is received and so eventually I2S2 timeouts and reports an IO error.

So this does point the finger at the frame sync signal or timing in some way for I2S2. Looking back at comment #3 the pinmux configuration looks good.

Looking back at comment #1, I see that …

I2S1 has ‘bclk_ratio = <0>’ and I2S2 has ‘bclk_ratio = <1>’. Can you make sure the bclk_ratio are the same? 0 should be fine.

Also can you check …

$ amixer -c tegrasndt186ref cget name="I2S1 fsync width"
$ amixer -c tegrasndt186ref cget name="I2S2 fsync width"

Both should be ‘31’ for 32-bit I2S.

Regards,
Jon

Thanks for your response Jonathan

We changed the bclk_ratio to 0 in both i2s1 and i2s2.

While running your commmand. we got some errors.

$ amixer -c tegrasndt186ref cget name="I2S1 fsync width" 
amixer: Cannot find the given element from control hw:1

Checking the controls in amixer:

$ amixer controls | grep I2S1
numid=572,iface=MIXER,name='I2S1 Channels'
numid=568,iface=MIXER,name='I2S1 Loopback'
numid=661,iface=MIXER,name='I2S1 Mux'
numid=574,iface=MIXER,name='I2S1 RX mono to stereo conv'
numid=573,iface=MIXER,name='I2S1 RX stereo to mono conv'
numid=571,iface=MIXER,name='I2S1 Sample Rate'
numid=576,iface=MIXER,name='I2S1 TX mono to stereo conv'
numid=575,iface=MIXER,name='I2S1 TX stereo to mono conv'
numid=570,iface=MIXER,name='I2S1 codec bit format'
numid=569,iface=MIXER,name='I2S1 input bit format'

Then we added the entry in dtb as :

fsync-width = <31>;

Sorry, these have been added in a up-coming release and are not part of the release you are using. So ignore that. So for now yes just make the changes in DT and let me know how that goes.

Jon

Thanks for your reponse
We are getting the same error:

Simple mixer control 'ADMAIF1 Mux',0
  Capabilities: enum
  Items: 'None' 'ADMAIF1' 'ADMAIF2' 'ADMAIF3' 'ADMAIF4' 'ADMAIF5' 'ADMAIF6' 'ADMAIF7' 'ADMAIF8' 'ADMAIF9' 'ADMAIF10' 'ADMAIF11' 'ADMAIF12' 'ADMAIF13' 'ADMAIF14' 'ADMAIF15' 'ADMAIF16' 'I2S1' 'I2S2' 'I2S3' 'I2S4' 'I2S5' 'I2S6' 'SFC1' 'SFC2' 'SFC3' 'SFC4' 'MIXER1-1' 'MIXER1-2' 'MIXER1-3' 'MIXER1-4' 'MIXER1-5' 'AMX1' 'AMX2' 'AMX3' 'AMX4' 'ARAD1' 'SPDIF1-1' 'SPDIF1-2' 'AFC1' 'AFC2' 'AFC3' 'AFC4' 'AFC5' 'AFC6' 'OPE1' 'SPKPROT1' 'MVC1' 'MVC2' 'IQC1-1' 'IQC1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' 'ASRC1-2' 'ASRC1-3' 'ASRC1-4' 'ASRC1-5' 'ASRC1-6'
  Item0: 'I2S2'
Recording WAVE 'i2s1.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
0
0
1
1
snd_pcm_update_hw_ptr
snd_pcm_update_hw_ptr0
function
snd_pcm_update_hw_ptr
snd_pcm_update_hw_ptr0
function
Recording WAVE 'i2s2.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
arecord: pcm_read:2032: read error: Input/output error

Hello!

Can you run the following and send the output …

amixer -c tegrasndt186ref sset "ADMAIF1 Mux" "I2S1"
amixer -c tegrasndt186ref sset "ADMAIF2 Mux" "I2S2"
arecord -D hw:tegrasndt186ref,0 -r 48000 -f S32_LE -c 2 -d 30 i2s1.wav &
sleep 5
arecord -D hw:tegrasndt186ref,1 -r 48000 -f S32_LE -c 2 -d 5 i2s2.wav &
sleep 1
sudo cat /sys/kernel/debug/regmap/tegra210-i2s.0/registers
sudo cat /sys/kernel/debug/regmap/tegra210-i2s.1/registers

Thanks
Jon