Tx2-nx asoc configuration for codec to codec

Hello

I’m hoping you could help in setting up our audio solution.

We have a DSP connected to the TX2-NX which has up to 4 i2s I/O. We talk to the DSP for configuration and fw-loading over SPI bus.

We use tegra.i2s0 connected to the dsp for playback, and tegra.i2s1 connected to the dsp for recording microphones which are connected to the dsp.

The DSP has its 3rd i2s connected to an amplifier.

We use the DSP for echo-cancellation, noise-reduction, etc.

The problem is that we can’t get the sound to work because the dai-link-3 in the device tree does not seem to be configured properly by the nvidia code. (cpu-dai[-name] gets overridden with a tegra-i2s DAP name)

Is my assumption correct that the nvidia code does not support codec-to-codec configurations?

How would be go about getting our setup to work?

Snippets of our device-tree:

i2c@3160000 {
                #address-cells = <1>;
                #size-cells = <0>;
                status = "okay";
                amplifier: bd28723@41 {
                        compatible = "rohm,bd28723";
                        reg = <0x41>;
                        status = "okay";

                        stereo = <0>;
                        #sound-dai-cells = <0>;

                        interrupt-parent = <&io_expander>;
                        interrupts = <0 IRQ_TYPE_EDGE_FALLING>;

                        mute-gpios = <&io_expander 1 GPIO_ACTIVE_HIGH>;
                        reset-gpios = <&io_expander 2 GPIO_ACTIVE_HIGH>;
                };
        };

&tegra_i2s1 {
        status = "okay";
};

&tegra_i2s2 {
        status = "okay";
};

&tegra_sound {
       nvidia,dai-link-1 {
                link-name = "clsic-playback-i2s1";
                cpu-dai = <&tegra_i2s1>;
                codec-dai = <&cs48lv41 0>;
                cpu-dai-name = "I2S1";
                codec-dai-name = "clsic-asp1";
                format = "i2s";
                bitclock-slave;
                frame-slave;
                bitclock-noninversion;
                frame-noninversion;
                bclk-ratio = <0>;
                srate = <48000>;
                bit-format = "s16_le";
                num-channel = <2>;
                ignore_suspend;
                name-prefix = "z";
                status = "okay";
        };

        nvidia,dai-link-2 {
                link-name = "clsic-record-i2s2";
                cpu-dai = <&tegra_i2s2>;
                codec-dai = <&cs48lv41 1>;
                cpu-dai-name = "I2S2";
                codec-dai-name = "clsic-asp2";
                format = "i2s";
                bitclock-slave;
                frame-slave;
                bitclock-noninversion;
                frame-noninversion;
                bclk_ratio = <0>;
                bit-format = "s16_le";
                srate = <48000>;
                num-channel = <2>;
                ignore_suspend;
                name-prefix = "y";
                status = "okay";
        };

        nvidia,dai-link-3 {
                link-name = "clsic-amp";
                cpu-dai = <&cs48lv41 3>;
                codec-dai = <&amplifer>;
                cpu-dai-name = "clsic-asp3";
                codec-dai-name = "bd28723";
                format = "i2s";
                bitclock-master;
                frame-master;
                bclk-ratio = <0>;
                bit-format = "s16_le";
                srate = <48000>;
                num-channel = <2>;
                name-prefix = "z";
                ignore_suspend;
                status = "okay";
        };
};

All components individually are working ok; we can configure the DSP and amplifier and have done measurements on their GPIO’s, reset-lines etc.

Thanks for any insight you can offer.

Hi jan76,

I believe your following interfaces are working:

tegra_i2s1 <-> DSP I2S1
tegra_i2s2 <-> DSP I2S2

Now you have DSP and amplifier connection and you want ALSA control for it.
Tegra drivers support codec to codec configurations, but CPU DAI has always been from Tegra module. Yes you are right, we assume it this way and construct the names out of DT link nodes. FYI, each DAI link node gets broken to a CIF side link to interface with AHUB and DAP side link to interface with external world.

For your case I think the dai-link-3 needs to be parsed differently compared to others and treat it as just one link and make sure this gets triggered during your use case.

If possible can you try JP5.02 release? The bindings there are different and it may be easier to add support for your case.

Thanks,
Sameer.

Hi spujar,

Thank you for confirming my suspisions.

We don’t have the option to try JP5.02 release as we have several products already with our current release.

I’ve gone ahead and rewrote several parts of nvidia/sound/soc/tegra-alt/utils/tegra_asoc_machine_alt.c to support codec2codec links by parsing the DT entry for dai-link-3 differently and now I’ve seem to get a lot further.

Kind regards,
Jan

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.