Audio playback noise on I2S via Realtek ACL5639 codec

Hi,
We had our customized PCBA with TX1.
And we use RT5639 as our audio decoder.
The interface is I2S.

Now we can hear the line out but it has noise.
For example, if we go to ‘Settings → Audio’ and select rt5639 as sound output, and use ‘Test sound’.
You can hear ‘from left’ or ‘from right’ testing sound but it has noise.

Is there anyone can help ?

Hi Tonie,
When playing WAV files, does it happen to all sample rate such as 32kHz, 44.1kHz, 48kHz?

Hi, DaneLLL,

Could you please tell how I can play it with different sample rate ?

Hi Tonie,
Please check if you hear noise in 48k and 44.1k cases.
amixer -c 1 sset ‘MIXER1-1 Mux’ ‘ADMAIF1’
amixer -c 1 sset ‘I2S1 Mux’ ‘MIXER1-1’

48kHz wav
http://www.kozco.com/tech/soundtests.html
aplay -Dhw:1,0 piano2.wav

44.1kHz wav

aplay -Dhw:1,0 Kurzweil-K2000-Big-Mono-Bass-C1.wav

Hi Tonie,
Please apply the following line and give it a try.

diff --git a/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c b/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c
index 4f71ac8..b914900 100644
--- a/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c
+++ b/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c
@@ -198,7 +198,7 @@ static int tegra_t210ref_dai_init(struct snd_soc_pcm_runtime *rtd,
        case 176000:
                /* aud_mclk, 256 times the sample rate */
                clk_out_rate = clk_rate << 8;
-               mclk = 11289600 * 4;
+               mclk = 11289600 * 2;
                break;
        case 8000:
        case 16000:

Hi, DaneLLL,

Thanks for your response.
I would like to announce that we use rt5639 mobile driver, not the one you shown. (rt565x).
And I tried to setup amixer as your suggestion, it looks audio has gone.

Regards,

Hi, DaneLLL,

I tried to play those two wav files without setting amixer.
The one of 44.1 Hz sounds much better.
The file of 48 Hz has noise.

Do you have other suggestion?

Thanks.

Tonie

Hi Tonie,
Please check if you run sound\soc\tegra-alt\tegra_t210ref_mobile_alt.c. If yes, please apply the clock settings from tegra_t210ref_mobile_rt565x_alt.c.

Hi, DaneLLL,

I did modification as your suggestion on that file.
It sounds ok. No nosie anymore.

May I know the reason ?

Thanks.

Tonie

Hi Tonie,
The rootcause is under investigation. Will update once we have new findings.

Hi Tonie,
Please refer to the patch and the commit message attached.
0001-ASoC-tegra-alt-fix-noisy-audio-issue.patch.txt (3.84 KB)

Hi, DaneLLL

I’ve updated it and now it sounds OK

Thanks

Hi, DaneLLL,

I found that the MIC input is failed.
Could you please help to advise this ?

Thanks.

Hi Tonie,

Your MIC input is failed?
Please describe it more specifically, then we could provide the suggestion.

Thanks

Hi, DaneLLL,

We had a customized board and the connections are :

  1. Line out has detected pin which connects to rt5639 pin 8 (JD2).
  2. MIC input has detected pin which connects to rt5639 pin 6 (JD1).
  3. TX1 GPIO_PE6 is used to as IRQ GPI which connects to rt5639 pin 40 (GPIO1_IRQ1).
    TX1 will get IRQ from GPIO_PE6 if rt5639 detects if Line out/MIC has plugged in/out.

Till now, I found that :

  1. Line out plugs in, TX1 will get interrupt.
  2. MIC plugs in, TX1 gets nothing.

I also compared all register values on rt5639 if MIC is connected or not, all register values are same.
In the other words, no matter if I plug MIC in or out, the registers on rt5639 won’t be changed.

P.S.: The way I got those register values from rt5639 is using 'cat /sys/kernel/debug/asoc/tegra-snd-t210ref-mobile-rt5639/rt5639.0-001c/codec_reg

Thanks for your help and looking forward your suggestion…

Tonie

Hi Tonie,
Please refer to the thread to make correct audio routing.
[url]https://devtalk.nvidia.com/default/topic/985516/jetson-tx1/acl5639-audio-codec-on-tx1/post/5049189/#5049189[/url]

Hi, I did try but same result

It is clarified ‘#!/bin/bash’ is required in beginning of /etc/amixer_settings. The link is updated:
[url]https://devtalk.nvidia.com/default/topic/985516/jetson-tx1/acl5639-audio-codec-on-tx1/post/5049189/#5049189[/url]