The audio ALC5640 can't work on I2S0 and I2C2 for Xaiver NX

Hi lcc0610,
Can you try with the fixes applied on the attached dtsi file.
tegra194-audio-se70.dtsi (2.2 KB)

20210616-2.log (62.6 KB)
Hi mkumard,
I tried the dtsi file but audio still no work. Attached dmesg file for check. Thank you!

Hi lcc0610,
The Widget routing issue is still not resolved from the log.

Can you please override with the below audio routing entries in the dtsi file and check again.

		nvidia,audio-routing =
						"x Headphone", "x HPOR",
						"x Headphone", "x HPOL",
						"x Int Spk", "x SPORP",
						"x Int Spk", "x SPORN",
						"x Int Spk", "x SPOLP",
						"x Int Spk", "x SPOLN",
						"x IN1P", "x Mic",
						"y Headphone", "y OUT",
						"y IN", "y Mic";

Please attach dmesg and output dump of command " amixer -c 1"

20210617.log (62.1 KB)
20210617-amixer.log (235.0 KB)
tegra194-audio-se70.dtsi (2.3 KB)
Hi mkumard,
After made these changes, we can see widget router for RT5640 in the system. But it seems no audio output. How cloud we check the audio and speaker functions work? Thank you!

Hi lcc0610,
That’s great news to hear.

The no audio issue would be related to not setting right mixer controls for the codec playback. Can you please provide the details on mixer controls set before the playback.

Please provide output of command " amixer -c 1 controls"

20210617-amixer-ctrl.log (52.7 KB)
Hi mkumard,
This is the log for command " amixer -c 1 controls". Thanks for your help!

Hi lcc0610,
Can you give a try by setting below commands before starting the playback.

#For speaker playback
      amixer -c 1 cset name="x Stereo DAC MIXL DAC L1 Switch" "1"
      amixer -c 1 cset name="x Stereo DAC MIXR DAC R1 Switch" "1"
      amixer -c 1 cset name="x Speaker L Playback Switch" "1"
      amixer -c 1 cset name="x Speaker R Playback Switch" "1"
      amixer -c 1 cset name="x SPOL MIX SPKVOL L Switch" "1"
      amixer -c 1 cset name="x SPOR MIX SPKVOL R Switch" "1"
      amixer -c 1 cset name="x SPOL MIX DAC L1 Switch" "1"
      amixer -c 1 cset name="x SPOR MIX DAC R1 Switch" "1"
      amixer -c 1 cset name="x Speaker Playback Volume" "0x20"

#For headphone playback
      amixer -c 1 cset name="x Stereo DAC MIXL DAC L1 Switch" "1"
      amixer -c 1 cset name="x Stereo DAC MIXR DAC R1 Switch" "1"
      amixer -c 1 cset name="x HPO MIX HPVOL Switch" "1"
      amixer -c 1 cset name="x HP L Playback Switch" "1"
      amixer -c 1 cset name="x HP R Playback Switch" "1"
      amixer -c 1 cset name="x HPO MIX DAC1 Switch" "1"
      amixer -c 1 cset name="x HP Playback Volume" "0x20"

Hi mkumard,
Good news, we try these commands let headphone can play voice now. And we would find a speaker for try also.
Please also adive how to check input micphone? Thank you!

Hi lcc0610,
From the mixer controls details shared for codec, We are seeing below control might help in Mic capture. Please give a try with it.

amixer -c 1 cset name="x RECMIXL BST1 Switch" "1"
amixer -c 1 cset name="x RECMIXR BST1 Switch" "1"
amixer -c 1 cset name="x Stereo ADC MIXL ADC1 Switch" "1"
amixer -c 1 cset name="x Stereo ADC MIXR ADC1 Switch" "1"

20210617-mic.log (83.7 KB)

Hi mkumard,
We try to recording voice from the microphone, but play the record file no hear any voice. Please help! I attached the dmesg and terminal also.

Hi lcc0610,
The log file has the below errors which points to playing or capturing at unsupported sampling rate for codec. Can you try with 48000 Hz sampling rate for Playback and Capture.

[ 823.323434] rt5640 0-001c: Unsupported clock setting 44100 for DAI 0
[ 823.323582] rt5640 0-001c: ASoC: can’t set rt5640-aif1 hw params: -22
[ 823.323697] tegra-asoc: sound: ASoC: PRE_PMU: I2S5 DAP Transmit-x AIF1 Playback event failed: -22

Also please make sure to set mixer controls for both Playback and Capture provided earlier.

Looking at your terminal snap shot, shows the arecord is performed at 48KHz, but the log file pointing to different errors. Can you provide us the dmesg log again after the reboot and usecase execution.

20210617-arecord.log (67.6 KB)
20210617-boot.log (67.2 KB)
20210617-csetamixer.log (67.4 KB)

Hi mkumard,
20210617-boot.log after reboot
20210617-csetamixer.log after cset
20210617-arecord.log after arecord.log

Hi lcc0610,
From the log, seems like one more change was missing from dts file. The codec sysclk was not set to right clock rate. Can you please add the below change in the dts file. The below change configure codec sysclk as 256*fs. If you want to change to any specific value please do as per your need.

		nvidia,xbar = <&tegra_axbar>;

+		mclk-fs = <256>;

		nvidia,dai-link-1 {
			name-prefix = "y";
		};

The above change might avoid the errors seen on the dmesg log.

20210618.log (62.2 KB)
Hi mkumard,
After add “mclk-fs = <256>;” in the dts file, there is no error message in the upload dmesg, but still no voice for recorded data. Please advice the microphone function. Thank you!

Hi lcc0610,
Can you please try with the below list of commands. If you still face the issue, We would recommend you to contact realtek team to get exact information on the controls needed for capture.

amixer -c 1 cset name="x ADC Capture Switch" "1"
amixer -c 1 cset name="x ADC IF1 Data Switch" "1"
amixer -c 1 cset name="x RECMIXL BST1 Switch" "1"
amixer -c 1 cset name="x RECMIXR BST1 Switch" "1"
amixer -c 1 cset name="x Stereo ADC MIXL ADC1 Switch" "1"
amixer -c 1 cset name="x Stereo ADC MIXR ADC1 Switch" "1"

Hi mkumard,
I tried these commands but microphone still not work. Even we check the waveform is also no any data from the microphone. Any other directions? Or what should we contact with realtek for clarify? Thank you!

Hi lcc0610,
It would be better to contact realtek team to check if any change is missing on dtsi or mixer control side to verify capture data. What we suggested was from the mixer control log you have provided. So we are limited here to provide more suggestions.


Hi
After add mic and micbias configurations into DTS as shown in picture. The microphone function is worked. We checked the record data can replay voice normally. Update the result for sync to you. Thank you!

Hi lcc0610,
This is great news to hear. Thanks for updating the fix, this could help for future references.

I believe we can close this thread now as fixes were working.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.