How to enable dummy audio codec on tx2?

Hi all,

I want to TX2 output i2s signal directly.

Do I need to write a dummy audio codec?

whether TX2 support output i2s signal directly.

thanks

@XavierSu
Have a check below document if can help on you.

https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3231/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/asoc_driver.17.2.html

I had write a dummy codec driver now. but i2s still can’t output bitclk and frameclk directly.

anything missing? thanks

Hello!

The default configuration for the I2S interfaces on the Jetson platforms is to use a dummy codec so that the I2S signals can be driven without an actual codec attached. If you are using the I2S interface on the 40-pin header, you simply need to configure the pinmux [0] by …

$ sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s1
$ sudo reboot

Then after rebooting simply play an audio file using aplay or use speaker-test to play …

$ speaker-test -D hw:tegrasndt186ref,0 -r 48000 -c 2 -F S16_LE -t sine -f 500

Regards
Jon

[0] https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fhw_setup_jetson_io.html%23

Hi,jonathanh

Thanks for reply.

I have tried to output audio in I2S4. but still not working.

speaker-test log:

speaker-test 1.1.0

Playback device is hw:tegrasndt186ref,3
Stream parameters are 48000Hz, S16_LE, 2 channels
Sine wave rate is 500.0000Hz
XDG_RUNTIME_DIR (/run/user/1001) is not owned by us (uid 0), but by uid 1001! (This could e g happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 8192
Period size range from 32 to 4096
Using max buffer size 8192
Periods = 4
was set period_size = 2048
was set buffer_size = 8192
 0 - Front Left
 1 - Front Right
Time per period = 0.185683
 0 - Front Left
 1 - Front Right
Time per period = 0.186600
 0 - Front Left
 1 - Front Right
Time per period = 0.186594
 0 - Front Left
 1 - Front Right
Time per period = 0.186593
 0 - Front Left
 1 - Front Right
Time per period = 0.186613
 0 - Front Left
 1 - Front Right

Any clue please tell me, thanks.

Hello!

Did you map I2S4 to the ADMAIF4? You can check by …

$ amixer -c tegrasndt186ref sget 'I2S4 Mux'

If this is mapped to None then it is not mapped and you need to …

$ amixer -c tegrasndt186ref sset 'I2S4 Mux' ADMAIF4

Regards,
Jon

Hi jonathanh,

I2S4 already mapped to ADMAIF4, but still not working:

amixer -c 1 sget 'I2S4 Mux' | grep 'Item0'
  Item0: 'ADMAIF4'

If codec is not connected, does I2S still output signal?

My TX2 connected 2 codecs i:
TX2 I2S1 --> tlv320aic32x4 (work fine)
TX2 I2S4 --> lt9611 (mipi2hdmi chip,the audio configuration has been configured. TX2 only needs to output I2S signal directly )

dts:

            .....			
            link-name = "ti-capture";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&aic32x4>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "tlv320aic32x4-hifi";
            ......
            ......
			link-name = "lt9611-playback";
			cpu-dai = <&tegra_i2s4>;
			codec-dai = <&lt9611_codec>;
			cpu-dai-name = "I2S4";
			codec-dai-name = "lt9611-hifi";
             ......

I tried modify dts:

>   .....			
>   link-name = "ti-capture";
> - cpu-dai = <&tegra_i2s1>;
> + cpu-dai = <&tegra_i2s4>;
>   codec-dai = <&aic32x4>;
> - cpu-dai-name = "I2S1";
> + cpu-dai-name = "I2S4";
>   codec-dai-name = "tlv320aic32x4-hifi";
>   ......
> 
>   ......
>   link-name = "lt9611-playback";
> - cpu-dai = <&tegra_i2s4>;
> + cpu-dai = <&tegra_i2s1>;
>   codec-dai = <&lt9611_codec>;
> - cpu-dai-name = "I2S4";
> + cpu-dai-name = "I2S1";
>   codec-dai-name = "lt9611-hifi";
>   ......

Using tlv320aic32x4 driver, but TX2 output audio to I2S4 witch connected to lt9611:

amixer -c 1 sset ‘I2S4 Mux’ ‘ADMAIF4’
speaker-test -D hw:tegrasndt186ref,3 -r 48000 -c 2 -F S16_LE -t sine -f 500

lt works out.

@jonathanh

Therefore, if i2s4 can directly output I2S signal to lt9611 and does not rely on tlv320aic32x4, it will work.

Is there any configuration not done well? Please let me know if you have any ideas.

Best regards.

Hello!

So to clarify, if you use the L4T release as-is without any modification to the device-tree source, then by default it will use a dummy codec and it should drive the I2S signals. If you modify the device-tree source to add an actual codec, then it will be necessary to update the audio routing and ensure that the codec itself is configured as necessary. This is not a trivial task with Linux in general and requires some knowledge of the codec and codec driver.

It is recommended that you read the audio documentation provided …

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fasoc_driver.18.2.html%23wwpID0E0T20HA

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide%2Fasoc_driver.18.2.html%23wwpID0E0WT0HA

By the way, I don’t see any codec driver available in the Linux kernel for the lt9611 codec so it is not clear to me what this is.

Regards
Jon

1 Like

Hi jonathanh,

It works out after git reset the dts and machine driver.

This information is valuable:

“by default TX2 will use a dummy codec and it should drive the I2S signals”

Thank you for your patience.

Best regards

Hello!

Thanks for the update! Glad it is working. Sorry if this is not clear, maybe another area where we can improve our documentation.

Regards,
Jon