Hi,nvidia:
I’m trying to porting realtek’s 5639 codec to Nano, with nano’s I2S and I2C interface.When i use aplay to play test.wav, The following problems occur:
The headphones can hear the sound,but the sound from the headphones is very quiet;
The headphones hear a lot of noise, the correct sound is very low.
Here is my debug log:
aplay cmd:
~# aplay -D plughw:CARD=tegrasndt210ref,DEV=0 test.wav
Playing WAVE ‘test.wav’ : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
It appears to be a clock related issue. However the clock rates for FS, MCLK and SCLK are as expected. Did you actually probe these clocks or these are from clock tree dump?
Please note that, driver change is required to setup sysclk for codec.
Can you please attach kernel logs, DT and driver changes you made to confirm if setup is OK?
Hi spujar.
Thank you very much for your reply.
The clock is measured by means of an oscilloscope, and make sure it’s right.
tegra_machine_driver_mobile.c:
Setup wise it looks good and you get expected clock rates. Can you please attach scopes of clock signals? Sometimes if signal is weak or distorted, it can have impact over the audio quality. It would be good to double check this.
You can attach the scopes of I2S signals with or without the audio codec connected.
Hi spujar.
Thank you very much for your reply.
The output signal of I2S4 is stable and correct,
We connected the I2S4 directly to the PCM5100A(a simple CODEC compared to RT5639), and we could hear perfect sound all the time.
This confirms that the clock and driver configurations are fine from SoC point of view. Also since you strongly believe the clock and signal strength to be fine (with RT5639 board connected), I don’t have a reason to doubt these anymore. There is some problem with your RT5639 codec board or the related driver. Please confirm if you see the same behavior with another RT5639 board as well.
Did you happen to make any changes to RT5639 driver? Please share in case you have done any changes.