I have been attempting to port the audio codec rt5640 to the Orin NX platform.
Below is the hardware schematic, where GPIO11 is connected to the GPIO1/IRQ of rt5640.
Additionally, based on this [forum post], I have set the pull parameter to TEGRA_PIN_PULL_DOWN for the
following nodes:
soc_gpio41_ph7
soc_gpio42_pi0
soc_gpio43_pi1
soc_gpio44_pi2
soc_gpio59_pac6
Replaced the original files with tegra234-mb1-bct-gpio-p3767-dp-a03.dtsi in /Linux_for_Tegra/bootloader and tegra234-mb1-bct-pinmux-p3767-dp-a03.dtsi in /Linux_for_Tegra/bootloader/t186ref/BCT.
After replacing the files, I flashed the Orin NX.
Note: Modified tegra234-mb1-bct-gpio-p3767-dp-a03.dtsi and tegra234-mb1-bct-pinmux-p3767-dp-a03.dtsi are included in the attachment.
Used tegra234-p3737-audio-codec-rt5640.dtbo to overwrite the system’s dtb file.
I made the following modifications to tegra234-p3737-audio-codec-rt5640.dtbo:
Changed the location of rt5640 from 31e0000 to 3160000.
Changed i2s1_dap_ep and i2s1_to_codec in fixups to i2s2_dap_ep and i2s2_to_codec.
Note: Modified tegra234-p3737-audio-codec-rt5640.dtbo and the decompiled using dtc are included in the attachment.
Configured various ALSA mixer controls using a script file, which is included in the attachment.
The following tests have been conducted on the system:
Used i2cdetect to detect and confirm that rt5640 is being called by the kernel module.
After overlay, snd-soc-rt5640 appears in the lsmod output.
When I use “amixer” to modify registers, such as by executing “source setHPout.sh”,
or when I use “aplay” to play an MP3 file, like “aplay sound.mp3”,
I observe that the voltages on the I2C, I2S, and interrupt of the rt5640 do not change, as seen on the oscilloscope.
Here are the specific observations:
SCL and SDA:
Upon power-on, both SCL and SDA transition from 0 to 1 automatically.
When “amixer” commands are executed, there is no change in SCL and SDA.
When the “i2cdetect” command is executed, changes will occur in SCL and SDA
MCLK:
After power-on, MCLK waveform remains at a constant frequency.
DACDAT1 and ADCDAT1:
While using “aplay” to play an MP3 file, there is no change in DACDAT1 and ADCDAT1.
GPIO/IRQ:
Starting or stopping playback using “aplay” does not lead to any changes in GPIO/IRQ.
Could this be a problem caused by incorrect sound card settings?
If so, I would like to ask for your assistance in configuring the sound card.