Es8316

es8316.c (39.2 KB)
tegra_machine_driver_mobile.c (24.3 KB)
tegra_asoc_machine_alt.c (112.8 KB)
tegra_asoc_machine_virt_alt.c (22.0 KB)


ReceivedTofile-COM4-2022_4_22_星期五_下午_4-39-51.DAT (113.3 KB)

Hello,There is a problem that CodeC cannot work normally. Now you have provided my information. Please help to solve it
tegra194-p3668-common.dtsi (12.2 KB)
tegra194-audio-p3668.dtsi (2.4 KB)

Our team will do the investigation and provide suggestions soon.

In the meanwhile, please check NVIDIA Jetson Linux Developer Guide : Audio Setup and Development | NVIDIA Docs

Thanks

Unfortunately, I consulted this document, but still didn’t get anything, so I asked for help.

On 4/25/2022 06:56,kayccc via NVIDIA Developer Forumsnvidia@discoursemail.com wrote:

Hi Francis001

From the subject of the query it is not clear what issue you are facing. It can help some one else if it has more description.

Please share the behaviour your currently see. Like any error logs.
Refer to troubleshooting section and share relevant logs.

ES8316 is brought up earlier on Xavier NX. Please refer to the query. You may find the discussion relevant or at least provide some clues.

Thanks,
Sameer.

Hi Spujar,
The error is as follows. I checked the forum, but it is still not solved

On 4/25/2022 06:56,kaycccdmesg | grep “asoc”
[ 2.368661] tegra-e[01;31me[Kasoce[me[K: sound: ASoC: CODEC DAI es8316-hifi not registered
[ 2.368667] tegra-e[01;31me[Kasoce[me[K: sound: snd_soc_register_card failed (-517)
[ 3.642912] tegra-e[01;31me[Kasoce[me[K: sound: ASoC: CODEC DAI es8316-hifi not registered
[ 3.644254] tegra-e[01;31me[Kasoce[me[K: sound: snd_soc_register_card failed (-517)
[ 3.647828] tegra-e[01;31me[Kasoce[me[K: sound: ASoC: CODEC DAI es8316-hifi not registered
[ 3.649165] tegra-e[01;31me[Kasoce[me[K: sound: snd_soc_register_card failed (-517)
[ 4.824359] tegra-e[01;31me[Kasoce[me[K: sound: ASoC: CODEC DAI es8316-hifi not registered
[ 4.825794] tegra-e[01;31me[Kasoce[me[K: sound: snd_soc_register_card failed (-517)
[ 5.787167] tegra-e[01;31me[Kasoce[me[K: sound: ASoC: CODEC DAI es8316-hifi not registered
[ 5.788737] tegra-e[01;31me[Kasoce[me[K: sound: snd_soc_register_card failed (-517)
[ 5.798784] tegra-e[01;31me[Kasoce[me[K: sound: ASoC: CODEC DAI es8316-hifi not registered
[ 5.800099] tegra-e[01;31me[Kasoce[me[K: sound: snd_soc_register_card failed (-517)
[ 5.804711] tegra-e[01;31me[Kasoce[me[K: sound: ASoC: CODEC DAI es8316-hifi not registered
[ 5.806173] tegra-e[01;31me[Kasoce[me[K: sound: snd_soc_register_card failed (-517) via NVIDIA Developer Forumsnvidia@discoursemail.com wrote:

Hi Francis001

Sorry for the delayed reply.

This means CODEC driver for es8316 is not probed or registered properly. Machine driver is trying to register DAI link with above CODEC DAI and is unable to find.

Check if you see DAI “es8316-hifi” in the following list:
cat /sys/kernel/debug/asoc/dais?

If DAI is not part of above list, you need to see what is going wrong in codec driver probe.

Thanks,
Sameer.

Hi Spujar,
Enter the command, the phenomenon is as follows

root@liuxs-desktop:/home/liuxs# cat /sys/kernel/debug/asoc/dais
CIF2
DAP2
CIF
DAP
CIF2
DAP2
CIF
DAP
TX6
TX5
TX4
TX3
TX2
TX1
RX7
RX6
RX5
RX4
RX3
RX2
RX1
ARAD OUT
OPE OUT
OPE IN
MVC OUT
MVC IN
MVC OUT
MVC IN
AFC OUT
AFC IN
AFC OUT
AFC IN
AFC OUT
AFC IN
AFC OUT
AFC IN
AFC OUT
AFC IN
AFC OUT
AFC IN
DAP
CIF
DAP
CIF
DAP
CIF
DAP
CIF
TX5
TX4
TX3
TX2
TX1
RX10
RX9
RX8
RX7
RX6
RX5
RX4
RX3
RX2
RX1
IN
OUT4
OUT3
OUT2
OUT1
IN
OUT4
OUT3
OUT2
OUT1
IN
OUT4
OUT3
OUT2
OUT1
IN
OUT4
OUT3
OUT2
OUT1
OUT
IN4
IN3
IN2
IN1
OUT
IN4
IN3
IN2
IN1
OUT
IN4
IN3
IN2
IN1
OUT
IN4
IN3
IN2
IN1
DAP
CIF
DA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F11
ADX2
ADX2-4
ADX2-3
ADX2-2
ADX2-1
ADX1
ADX1-4
ADX1-3
ADX1-2
ADX1-1
AMX2-4
AMX2-3
AMX2-2
AMX2-1
AMX2
AMX1-4
AMX1-3
AMX1-2
AMX1-1
AMX1
DMIC3
DMIC2
DMIC1
IQC2-2
IQC2-1
IQC1-2
IQC1-1
MVC2
MVC1
SPKPROT1
OPE1
AFC6
AFC5
AFC4
AFC3
AFC2
AFC1
MIXER1-10
MIXER1-9
MIXER1-8
MIXER1-7
MIXER1-6
MIXER1-5
MIXER1-4
MIXER1-3
MIXER1-2
MIXER1-1
SFC4
SFC3
SFC2
SFC1
I2S5
I2S4
I2S3
I2S2
I2S1
ADMAIF10
ADMAIF9
ADMAIF8
ADMAIF7
ADMAIF6
ADMAIF5
ADMAIF4
ADMAIF3
ADMAIF2
ADMAIF1
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
dit-hifi
es8316-hifi
snd-soc-dummy-dai

On 5/12/2022 17:25,Sameer Pujar via NVIDIA Developer Forumsnvidia@discoursemail.com wrote:

Hi Spujar,

snd_soc_register_card failed (-517)
Do you have any good suggestions for this problem?

On 5/12/2022 17:35,liuxingshuliuxingshu_lxs@126.com wrote:

Hi Francis001,

Your error logs and dump of “/sys/kernel/debug/asoc/dais” don’t correlate. The dump actually shows that “es8316-hifi” DAI is registered by the codec driver, but machine driver still complains.

Can you please share following?

  • ES8316 Codec driver
  • DTB file that you flash

Thanks.

Hi Spujar,

Please check the attached file.

On 5/18/2022 11:47,Sameer Pujar via NVIDIA Developer Forumsnvidia@discoursemail.com wrote:

tegra194-audio-p3668.dtsi (2.56 KB)

es8316.c (38.9 KB)

Hi Spujar,

This is the DTB decompiler.

On 5/18/2022 11:51,liuxingshuliuxingshu_lxs@126.com wrote:

output.dts (254 KB)

Hi Francis001,

The DTS and driver look fine. Do you see any sound card? Dump following info.


cat /proc/asound/cards

Hi Spujar,

The symptom of using this command is as follows:

liuxs@liuxs-desktop:~$ cat /proc/asound/cards
0 [tegrahdaxnx ]: tegra-hda-xnx - tegra-hda-xnx
tegra-hda-xnx at 0x3518000 irq 65

On 5/18/2022 12:38,Sameer Pujar via NVIDIA Developer Forumsnvidia@discoursemail.com wrote:

Hi Spujar,

What’s the reason for this ?

On 5/18/2022 13:37,liuxingshuliuxingshu_lxs@126.com wrote:

请问这个问题需要如何解决呀?

---- Replied Message ----

From liuxingshuliuxingshu_lxs@126.com
Date 5/20/2022 09:40
To incoming+68f94c237112c60a6df09739670f5a7f@nvidia.discoursemail.comincoming+68f94c237112c60a6df09739670f5a7f@nvidia.discoursemail.com
Subject Re: [NVIDIA Developer Forums] [Jetson & Embedded Systems/Jetson Xavier NX] Es8316

Hi Spujar,

What’s the reason for this ?

On 5/18/2022 13:37,liuxingshuliuxingshu_lxs@126.com wrote:

Hi Francis001

As per “cat /proc/asound/cards” dump there is no sound card registered for your codec.

You need to figure out why you are hitting error “sound: ASoC: CODEC DAI es8316-hifi not registered” even though the “es8316-hifi” is already registered as per dump “cat /sys/kernel/debug/asoc/dais”.

Add following debug prints to get some more hints:

diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
index b2e8fa2..b2e7fd0 100644
--- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
+++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c
@@ -772,9 +772,13 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)

        tegra_machine_dma_set_mask(pdev);

+       dev_err(&pdev->dev, "%s and %d\n", __func__, __LINE__);
        ret = add_dai_links(pdev);
-       if (ret < 0)
+       if (ret < 0) {
+               dev_err(&pdev->dev, "fail to add links, err = %d", ret);
                goto cleanup_asoc;
+       }
+       dev_err(&pdev->dev, "%s and %d\n", __func__, __LINE__);

        ret = tegra_alt_asoc_utils_init(&machine->audio_clock,
                                        &pdev->dev,

Also add a debug print before and after around “snd_soc_register_codec()” in “es8316_i2c_probe” of codec driver.

Please share complete boot logs to see if there are some other failures.

Thanks.

Hi spujar

Relevant files have been uploaded. Please check them. Thank you

---- Replied Message ----

From Sameer Pujar via NVIDIA Developer Forumsnvidia@discoursemail.com
Date 5/24/2022 11:53
To liuxingshu_lxs@126.com
Subject [NVIDIA Developer Forums] [Jetson & Embedded Systems/Jetson Xavier NX] Es8316
spujar Employee
May 24

Hi Francis001

As per “cat /proc/asound/cards” dump there is no sound card registered for your codec.

You need to figure out why you are hitting error “sound: ASoC: CODEC DAI es8316-hifi not registered” even though the “es8316-hifi” is already registered as per dump “cat /sys/kernel/debug/asoc/dais”.

Add following debug prints to get some more hints:

diff --git a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c

index b2e8fa2..b2e7fd0 100644

--- a/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c

+++ b/sound/soc/tegra-alt/machine_drivers/tegra_machine_driver_mobile.c

@@ -772,9 +772,13 @@ static int tegra_machine_driver_probe(struct platform_device *pdev)

        tegra_machine_dma_set_mask(pdev);

+       dev_err(&pdev->dev, "%s and %d\n", __func__, __LINE__);

        ret = add_dai_links(pdev);

-       if (ret < 0)

+       if (ret < 0) {

+               dev_err(&pdev->dev, "fail to add links, err = %d", ret);

                goto cleanup_asoc;

+       }

+       dev_err(&pdev->dev, "%s and %d\n", __func__, __LINE__);

        ret = tegra_alt_asoc_utils_init(&machine->audio_clock,

                                        &pdev->dev,

Also add a debug print before and after around “snd_soc_register_codec()” in “es8316_i2c_probe” of codec driver.

Please share complete boot logs to see if there are some other failures.

Thanks.

es8316.c (39 KB)

tegra_machine_driver_mobile.c (25.1 KB)

tegra19x-jetson_xavier_nx_module-pinmux.dtsi (54.3 KB)

dmesg.txt (84.2 KB)

Hi Francis001,

In the attached log (dmesg.txt), I can see that the codec driver probe() happens before machine driver probe(). It is expected to work and I am not sure what you are missing given the driver and DT details you have attached.

To gather more info, please use following change and provide logs.

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 0344d44..f0b7edb 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -53,6 +53,9 @@ struct dentry *snd_soc_debugfs_root;
 EXPORT_SYMBOL_GPL(snd_soc_debugfs_root);
 #endif

+#undef dev_dbg
+#define dev_dbg dev_err
+
 static DEFINE_MUTEX(client_mutex);
 static LIST_HEAD(platform_list);
 static LIST_HEAD(codec_list);

Also what is the release build package you are using?

Hi @Francis001

Is this still an issue to support? Any result can be shared? Thanks

Hi spujar :

Thank you very much for your help. Since there is something wrong with the hardware of my board, it has been redesigned. I am asking you about this problem until our new board is designed.

---- Replied Message ----

From | kayccc via NVIDIA Developer Forumsnotifications@nvidia.discoursemail.com |

  • | - |
    Date | 6/22/2022 09:25 |
    To | liuxingshu_lxs@126.com |
    Subject | [NVIDIA Developer Forums] [Jetson & Embedded Systems/Jetson Xavier NX] Es8316 |

| kayccc Moderator
June 22 |

  • | - |

Hi @Francis001

Is this still an issue to support? Any result can be shared? Thanks