Enabling I2S audio output on 40 Pin Connector

If you want to test audio output flash this dtb. Refer to my previous post on how to flash the dtb.

I would assume audio input should also work but haven’t tested it.

DTB should enable I2S4 (and also spi2) using the following pins:

AUDIO_MCLK - PIN 7
I2S_4_LRCK - PIN 35
I2S_4_SDIN - PIN 38
I2S_4_SDOUT - PIN 40
I2S_4_SCLK - PIN 12

I hooked up a ES9023 DAC to test with:

MCLK -> AUDIO_MCLK
LRCK -> I2S_4_LRCK
DATA -> I2S_4_SDOUT
BCK -> I2S_4_SCLK

Once kernel boots there should be a sound device register and we can test using the following command:

speaker-test -c2 -twav -D plughw:CARD=tegrasndt210ref,DEV=0

Output should be:

speaker-test 1.1.3

Playback device is plughw:CARD=tegrasndt210ref,DEV=0
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
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 = 2.860922
 0 - Front Left
 1 - Front Right

Test with aplay

aplay -D plughw:CARD=tegrasndt210ref,DEV=0 <wav file>

Great! Thanks for sharing.

@jas-mx should applying this DTB be a permanant fix for enabling I2S4? By that I mean, when you reboot the machine, shouldn’t playing thru the DAC still work without having to re-flash?

Yes once the dtb is flashed it will work after rebooting.

I’m trying to get it to work with this I2S DAC from Adafruit https://www.adafruit.com/product/3678
Datasheet of the DAC: https://cdn-shop.adafruit.com/product-files/3678/UDA1334ATS.pdf
Breakout Schematic: https://cdn-learn.adafruit.com/assets/assets/000/048/419/original/adafruit_products_schem.png?1511325937

Though I am unable to make it play anything. I connected it in the following way:
Nano - DAC

5V - VIN
GND - GND
12 - BCLK
35 - WSEL
40 - DIN

Granted that I know little to nothing about how I2S works and what signals are needed here.

Running

sudo grep dap4 /sys/kernel/debug/tegra_pinctrl_reg

outputs

Bank: 1 Reg: 0x70003144 Val: 0x00000044 -> dap4_fs_pj4
Bank: 1 Reg: 0x70003148 Val: 0x00000044 -> dap4_din_pj5
Bank: 1 Reg: 0x7000314c Val: 0x00000044 -> dap4_dout_pj6
Bank: 1 Reg: 0x70003150 Val: 0x00000044 -> dap4_sclk_pj7

Which according to the other Thread seems to indicate that the dtb flash was successful?

Hello jas-mx!

You are great about this dtb & dts hacks!

I want to make a several convenience dtb files.
I’m working on trial and error.

I read your post, and I asked something that I did not understand.

I checked the difference of origin dtb & your custom dtb file. (de-compiled dtb -> dts)

In origin dtb file, at “default { gpio-input }”,
-> There is “0xe8” (maybe it means “spi2_cs1_pdd0” ?)

In custom dtb file, { gpios }",
-> There is not.

I think that “0xe8” should be in “gpios”…

Why “0xe8” was disappeared ?

Can you tell me about this ?

And 1 more question…

At "aud_mclk_pdd0 {… nvidia,enable-input = <0x1> "

I think it should be “<0x0>” ?( output ?)

I was addicted by pinmux spreadsheet …

Thanks.
devemin

Hi jas-mx,

I’m planning to use
aud_mclk
I2S3_LRCK
I2S3_SDATA_IN
I2S3_SDATA_OUT
I2S3_SCLK

in L4T 32.2
dtsi modified and DTB updated, but still not working.
Can you kindly share your dtsi modifications?

Thanks.

Hello. I have raspiaudio MIC+ and i want to know how i can check the I2S4 port in my jetson nano. how i can check if it is working. Or eventually how i can activiate it.

did you get the Adafruit I2S working?