I am facing Chip ID read error for my SGTLCodec5000. This error is pointing the sgtl5000 driver .c file.
Please let us know what might be the reason for this. One observation we made on the hardware side is, we are seeing SINE wave on the M_CLK line( 49 MHz) instead of 12 MHz externally coming from SOM module to the SGTL5000 codec on our customized carrier board.
Should we modify this clock value explictly in some driver file ( .c or .h), please let us know.
I am attaching the sound dtsi file, I have modified for reference.
Ok. Is it something to do with the hardware loose connection of codec to I2C or something else?
I added the two functions that are documented here, but it is having some errors due to mismatch of the function “tegra_machine_fepi_init” that is called with out any parameter and it is defined with a parameter. To call this function “tegra_machine_fepi_init” with parameter with *rtd , not finding “struct snd_soc_pcm_runtime *rtd” variable in the function “tegra_machine_fepi_init”.
Cannot we fix this 120000 MHz issue in the device tree file itself, by hard coding the clock rate = 120000, inside the sound { } node ? to avoid the machine_driver.c file changes.
Ok. Disabled it back. Can I know the difference between this and Sound { } node ? I thought we need to enable this graph also for making the audio chain complete for enabling the audio functionality.
As I am getting the clock from AUD_MCLK from my SOM module to the SGTL5000 codec, I commented the sgtl5000_mlck, which was supposed to be used, if we are sending a fixed frequency from on onboard codec oscillator as per my understanding.
Earlier we had connected out SGTL5000 codec on our customized board to I2C0, It was not working.
But later we tried connecting it to I2C4, to see, if it works fine.
I can do this after doing code changes in machine_driver.c file.
Please find the tegra_machine_driver.c file attached FYI. I have added those two functions in the documentation and commented it temporarily as they are giving errors:
Replace with below, prefix property should not be removed and replace sound-dai-cells with <0> inside sgtl5000.7-000a@0a when you make below change: &i2s4_to_codec { link-name = "fe-pi-audio-z-v2"; bitclock-master; frame-master; codec { sound-dai = <&sgtl5000>; prefix = "H40-SGTL"; }; };
No need of “nvidia,dai-link-1” node inside sound node .
Hope you had disabled “sound-graph” node as mentioned in comment #3.
If still doesnt work, share the updated DT alongwith dmesg logs.
Earlier, I was feeding the clock to the sgtl5000 codec structure through dummy clock structure node( actually this is applicable only for on board oscillator on codec board but here I am getting AUD_MCLK from my SOM module). Now, I removed this and started to send assign clock from the
MCLK from SOM module as shown below:
Actually If I enable prefix here also, I get compile error, as this prefix " prefix = “H40-SGTL”;" would already taken from the sgtl5000: sgtl5000.7-000a@0a { } node.
Please see the documentation for the same in the below link: where it says, we can enable prefix in either of the nodes.
However when I changed the name to " sound-name-prefix " from just “prefix”, it compiled fine.
Will this fix the 12 MHz issue, that we need to send for AUD_MCLK.
Also what should be “nvidia-audio-card,mclk-fs = <256>;”
Read it should be changed to 0 so that it will inturn effect our AUD_MCLK to get 12 MHz, as we are using fe-pi module as we were not able to do the source code changes in machine_driver.c
The change you had done above, is trying to set PLLA_OUT0 parent as AUD_MCLK and that is not possible and that’s why you are getting error messages for PLLA_OUT0.
This is not required to be modified.
For machine driver change, it will be already part of tegra_codecs.c. Please check with link-name compatible.
Ok. I had set it to 0. I will revert it back 256, Does this effect my audio mic in, speaker out, line out etc working/functionalities in the next phase of testing.
Yes. I saw tegra_codecs.c file. They have function “tegra_machine_fepi_init” incorporated already to handle fe-pi module based sgtl codecs.
I have one more query. I am not able to see the sgtl5000 clk value in the /sys/kernel/debug/clck/clk_summary. Any idea?
As I am feeding AUD_MCLK as clock input inside sgtl5000.7-000a@0a node, it should also list.
I am remember it was listing some times, before.
AUD_MCLK is showing 49 Hz in the clk_summary, after reverting back the changes for Clocks inside Sound { } node.
But we need 12 MHz to be feeded to the codec. Will this effect our audio functionality on i2s and codec input/output lines
Thanks a lot for the response.
I will change “mclk-fs” to 256 and share the updated DT and dmesg log.
But have some queries:
Should it be 256 or 0 for correction audio functionality? because as of now line-in, line-out is not working, even though the Sound+Card APE is registered successfully.
Are there any commands that we need to execute after Sound card registration for bringing up Audio In and Audio out? as per the below link:
Did not understand, what does use case mean here?
As per our hardware team , we are not running any usecase. The sampling rate was 0 in this build.
I will try to modify it so 256 and let you know.
We see that APE sound card is getting registered successfully. But not able to heard sound when we test( by playing sound) it through ALSAMIXER.
Also we tried the below steps from the below link as part of diagnosing, but we are not getting any output when execute this below command to determine whether DAPM path is completed or not by using the command: