We are currently porting the ALC5616 audio codec to our custom carrier board with the Thor SOM, and we have encountered some issues during the process.
The RT5616 driver is successfully probed and correctly registered under the APE node. When playing audio (e.g., YouTube), the I2S4 data waveform changes according to the volume level, which indicates that I2S data output is functioning properly.
However, when measuring the analog outputs (AUDIO_HPO_R/L and LOUTL_P/N), there is no analog audio signal at all.
We would like to confirm whether there are still missing modifications in the device tree or source code (attached file: rt5616.tar.gz).
In addition, the MCLK signal we measured does not look correct. We referenced the RT5640 implementation on the NVIDIA reference board and configured the codec to use an external MCLK, but the measured MCLK waveform looks more like noise and its frequency seems incorrect.
From the dump, I could see I2S4 at 3.07MHz and AUD_MCLK at 49.152MHz, these both rates are correct for a multiple of 8KHz rate playback. I believe your playback is with 48KHz, 2ch, 32bit format.
So, BCLK is matching with the scope data. I believe the MCLK is showing 26.99MHz on ur scope image which seems not matching with the clock summary dump.
The dump shows Aud_MCLK is not in enabled state. We need to check the Codec DT node on whether we pass the aud_mclk entry to make use of it
Hi
I think the correct MCLK frequency should be 12 MHz,but the orange signal’s frequency MCLK is much lower than the signal’s yellow’s frequency BCLK(3MHZ) frequency. It seems that the MCLK is not being activated at all.
That’s right, MCLK is not being enabled is the issue, this clock is handled by codec driver. Could you enable the print and check if clock enable is indeed called in codec driver side.
Your info shows machine driver is requesting 12.28MHz which is correct for 48KHz with 256Fs scaling for MCLK.
After adding the following function in my driver , the MCLK can now be successfully enabled (12MHZ). However, the MCLK remains enabled all the time, even when no audio is being played, and the analog audio output is still not present.
You can try moving this into pm runtime resume/suspend callback, so MCLK would be enabled only during the usecase enabled. Need to enable clock in resume and disable in suspend to maintain refcount.
Are you saying even after enabling MCLK clock, the audio output was not there?