TLV320AIC3204 Driver will support for AGX Orin 64GB SOM?

Just to confirm, aplay exits immediately?
You still don’t see clock transition after configuring Tegra I2S as producer?
Can you please share kernel logs when you are running playback?

I have added bitclock and frame as slave in DT.

hdr40_snd_link_i2s: &i2s2_to_codec {
        link-name = "ti-capture";
        bitclock-slave;
        frame-slave;  
        codec {
                sound-dai = <&aic32x4 0>;
                prefix = "TI-TLV320";
        };
};

No, aplay is exits once the audio duration reached.

No, I didn’t any transition in I2S lanes.

Please find tha attached kernel log.
dmesg.log (81.7 KB)

Thanks,
Parashuram

Hello Sameer,

I’m not sure what these below-mentioned messages in the dmesg log are.

ALSA: Control name 'TI-TLV320 DAC Left Playback PowerTune Switch' truncated to 'TI-TLV320 DAC Left Playback PowerTune Switc'
...

I didn’t get the APE codec name in the cards list.

I’d appreciate it if you could tell me how to listen to sound from a codec. If there are any code changes, please let us know.

Regards,
Parashuram

This is probably because the control name is overflowing.
Please use a smaller prefix instead of “TI-TLV320”. Check with something like “TLV”.

This is fine, you won’t see codec name in the cards list.
In your codec driver, you can put prints in hw_params() to confirm that the call happens whenever you run aplay.

This means there is no clock issue.

I don’t think these are necessary.

I am not sure what else you are missing. The playback runs for required duration and I expect no pinmux problem. So I expect the clocks to be seen. What are the pins you are probing?

Hello Sameer,

I probed I2S fs_clk, mclk, sclk, and dout while running the aplay command (aplay -D hw:APE,1 test.wav). however, there is no transition In any lanes.
sclk ->yellow
mclk ->blue
fs_clk ->pink
Dout ->green

for your reference please find the attached logs.
dmesg.log (78.3 KB)
mixer.sh (1.4 KB)
mixer_output.txt (4.0 KB)

Thanks,
Parashuram

Did you confirm this?

It has following amixer errors…,
amixer: Cannot find the given element from control hw:1
amixer: Cannot find the given element from control hw:1
amixer: Cannot find the given element from control hw:1
amixer: Cannot find the given element from control hw:1
amixer: Cannot find the given element from control hw:1
amixer: Cannot find the given element from control hw:1

You may have to fix few control settings.

Can you confirm if the codec is connected to Tegra I2S2? Please share schematics of the connection.
Also please probe the signals without codec connection. Sometimes the codec board can affect the signals. When you do this testing, you have to disable the codec path in DT.

You are making changes in wrong place.
Please refer Audio Setup and Development — Jetson Linux Developer Guide documentation to edit the right machine driver.

As per the schematic, the “AUDIO_I2S” label points to I2S1_xxx. It seems like you are using Tegra I2S1. You may have used I2S2 on TX2, but don’t assume it will be the case on AGX Orin too. Please cross check on this.

If indeed you are using I2S1, then you need to update your DT bindings accordingly for I2S1 usage. Also update amixer commands to use I2S1 and then check.

I guess you mean Tegra I2S1 here? Please use I2S1 reference to avoid more confusion.

what are the amixer commands you are using?

you need to add codec under I2S1 node.

+&i2s1_to_codec {
+        link-name = "ti-capture";
+        format = "dsp_a";
+
+        codec {
+            sound-dai = <&aic32x4 0>;
+            prefix = "tlv";
+        };
+};

I cannot comment on this as to why this fails. You need to check why it reports failure. This was working earlier, so review the changes you made.

Okay, Now I used Tegra I2S1.

amixer -c APE sset ‘ADMAIF2 Mux’ ‘I2S1’
amixer -c APE sset ‘I2S1 Mux’ ‘ADMAIF2’

amixer -c APE cset name=‘tlv Auto-mute Switch’ 0
amixer -c APE cset name=‘tlv HP DAC Playback Switch’ 1
amixer -c APE cset name=‘tlv HP Driver Gain Volume’ 0
amixer -c APE cset name=‘tlv HPL Output Mixer IN1_L Switch’ 0
amixer -c APE cset name=‘tlv HPR Output Mixer IN1_R Switch’ 0
amixer -c APE cset name=‘tlv HPL Output Mixer L_DAC Switch’ 1
amixer -c APE cset name=‘tlv HPR Output Mixer R_DAC Switch’ 1
amixer -c APE cset name=‘tlv LO DAC Playback Switch’ 1

Added I2S1 codec changes in DT.

Yes, the error got resolved.

There was no printk message in the kernel log, which I added in the source file.

while running the aplay command captured traces log please find.
I probed I2S lanes and there is no transition in any pins.

dmesg.log (78.6 KB)
kern.log (109.2 KB)
components.txt (886 Bytes)
dt.log (491.3 KB)
traces.txt (9.7 KB)

Regards,
Parashuram

Traces look fine as I can see the DAPM path include your audio codec as well.
It also has I2S2 in the path. I think you still have it connected in the path. Please disconnect I2S2 path as you are not using it with following command:

amixer -c APE cset name="I2S2 Mux" "None"

Even with above I was expecting you would see clock transitions on the I2S1.
I believe aplay is running for required duration for you and the configuration looks good to me. Please double check your probe points and check if you can measure this as close as possible to the SOM to rule out any platform issues. The signals would be available only when the audio session is running.

Hello Sameer,

Thanks for your reply,

I’m working on I2S1 hardware modifications and will get back to you once I’m done with it.

Reagrds,
Parashuram

Hi Parashuram,

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

Hello Kayccc,

I appreciate your response.
A carrier card is having some problems, and work is being done to fix it. I’ll get back to you in a couple of days.

Thanks,
Parashuram

Hello Team,

I have switched the BSP from the previous L4T package R35.1 to the latest R35.3.1. I’m Integrating the Audio Codec changes and will update you on the audio codec results.

Regards,
Parashuram

Hello,

I received the board and resumed work on the audio codec, and I will give a summary next week.

Regards,
Parashuram

Sorry for the late response, have you managed to get issue resolved or still need the support? Thanks

Hello Kayccc,

Thanks for your reply.
I didn’t see any error messages in codec related but still, I’m not able to hear the sound from the codec line out, headphone out, and mic in.
Could you please let me know where missing the part?
here are the mixer settings and mixer output.
mixer2.sh (555 Bytes)
mixer_out.txt (2.7 KB)

I’m able to see that sound tlv320aic3204 is detected in the cards list.

orin@orin-desktop:~$ cat /proc/asound/cards
 0 [HDA            ]: tegra-hda - NVIDIA Jetson AGX Orin HDA
                      NVIDIA Jetson AGX Orin HDA at 0x3518000 irq 117
 1 [APE            ]: tegra-ape - NVIDIA Jetson AGX Orin APE
                      Unknown-JetsonAGXOrin-NotSpecified

here are the DAPM routes for the tlv320aic3204 codec:

                     nvidia-audio-card,widgets =
                                "Headphone",    "tlv Headphone",
                                //"Microphone",   "tlv Mic",
                                "Line",         "tlv Line In",
                                "Line",         "tlv Line Out";

                        nvidia-audio-card,routing =
                                "tlv Headphone", "tlv LOL",
                                "tlv Headphone", "tlv LOR",
                                "tlv Headphone", "tlv HPL",
                                "tlv Headphone", "tlv HPR",
                                "tlv Left DAC", "tlv Playback",
                                "tlv Right DAC", "tlv Playback",
                                /*"tlv Mic Bias", "tlv Mic", 
                                "tlv IN1_L", "tlv Mic",
                                "tlv IN1_R", "tlv Mic",
                                "tlv IN2_L", "tlv Mic",
                                "tlv IN2_R", "tlv Mic",
                                "tlv IN3_L", "tlv Mic",
                                "tlv IN3_R", "tlv Mic",*/
                                "tlv Capture", "tlv Left ADC",
                                "tlv Capture", "tlv Right ADC";
                nvidia-audio-card,mclk-fs = <256>;

I’m not sure how to add the SYSCLK for tlv320aic3204 but I used the SGTL5000_SYSCLK if it is not correct let me know how to add the SYSCLK for tlv320aic3204 (attached tegra_codecs.c file
tegra_codecs.c.txt (2.6 KB)).

aplay is working fine, it will exit once the test.wav file duration completes.
so here is the aplay command.

aplay -D hw:APE,1 test.wav

but still, I’m not able to hear the sound from the audio codec.

I have attached logs for your reference please find them below.
codec_mixer_controls.txt (2.7 KB)
components.txt (886 Bytes)
reg_dump (585 Bytes)
kernel.log (74.3 KB)

i2cdetect

Regards,
Parashuram

Hi Parashuram.Biradar

There are no errors in the log and aplay runs for correct duration. This means the clock signals should be good and some codec mixer control settings may be missing.

To confirm above theory, can you please probe the I2S and MCLK clock signal frequencies when aplay is running? This is important to understand if the signals are sent property from Tegra side. Please share the frequencies and scope snapshots.

Hello Sameer,

While the aplay was running, I probed the I2S mclk and dout signals.
I2S mclk and dout signal snapshots are attached.
MCLK → Yellow
DOUT → blue.
Mclk frequency is 3.8MHz


Regards,
Parashuram

Signal amplitudes look very low.

Measure following clock signals with and without the connection of your codec board. Provide snapshots in both cases.

  1. I2S BCLK
  2. I2S LRCK
  3. MCLK