I2s DAC: No sound

I’m trying to get sound working from my Jetson Nano (2GB). I’ve followed a few guides, but it seems like a lot of the content is a little outdated now, for example it seems that it’s not possible to enable i2s using jetson-io now rather than manually building device tree overlays. I followed this guide:
https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html

My jetson-io.py (which requires sudo privileges) output now reads as follows, after a reboot:

 =================== Jetson Expansion Header Tool ===================
 |                                                                    |
 |                                                                    |
 |                        3.3V ( 1)  ( 2) 5V                          |
 |                        i2c2 ( 3)  ( 4) 5V                          |
 |                        i2c2 ( 5)  ( 6) GND                         |
 |                    aud_mclk ( 7)  ( 8) uartb                       |
 |                         GND ( 9)  (10) uartb                       |
 |                      unused (11)  (12) i2s4b                       |
 |                      unused (13)  (14) GND                         |
 |                      unused (15)  (16) unused                      |
 |                        3.3V (17)  (18) unused                      |
 |                      unused (19)  (20) GND                         |
 |                      unused (21)  (22) unused                      |
 |                      unused (23)  (24) unused                      |
 |                         GND (25)  (26) unused                      |
 |                        i2c1 (27)  (28) i2c1                        |
 |                      unused (29)  (30) GND                         |
 |                      unused (31)  (32) unused                      |
 |                      unused (33)  (34) GND                         |
 |                       i2s4b (35)  (36) unused                      |
 |                      unused (37)  (38) i2s4b                       |
 |                         GND (39)  (40) i2s4b                       |
 |                                                                    |
 |                                                                    |
 |                                                                    |
 |                Select one of the following options:                |

                Configure Jetson for compatible hardware
                   Configure 40-pin expansion header
                                  Exit

I have an ES9023 DAC I’m trying to use, wired as follows:

 --------------------------
| DAC       | Jetson GPIO  |
| 5V        | 4 (5V)       |
| GND       | 6 (GND)      |
| MCLK      | 7 (AUD_MCLK) |
| BCK       | 12 (SCLK)    |
| LRCK      | 35 (FS)      |
| GND       | 39 (GND)     |
| DATA      | 40 (DOUT)    |
 --------------------------

I then tried this, which is making no sound:
speaker-test -c2 -twav -D plughw:CARD=tegrasndt210ref,DEV=0

alsa looks like it’s configured for i2s4 by default:

pcm.!default {
	type plug
	slave {
		pcm "hw:tegrasndt210ref,0"
		channels 2
		rate 48000
	}
	hint.description "Tegra APE Soundcard (tegrasndt210ref,0)"
}

I’ve tried other settings (and another DAC, PCM5102) but no sound at all… what am I doing wrong?!

Thanks,
Phill

Hello!

I can confirm that the content is current and jetson-io is designed to use overlays to alter the pin configuration. This is how jetson-io has always worked. Please let me know if there is something that I am misunderstanding.

That looks correct and yes by default this should drive I2S4. Are you able to probe the I2S signals to see that they are being driven? If they are being driven then it is worth checking that the sample size and sample rate being outputted are compatible with the codec. I noticed that you did not specify the sample size or sample rate in the speaker-test command and so it is not clear what these are defaulting to. Hence you may wish to try …

speaker-test -r 48000 -F S16_LE -c 2 -twav -D plughw:CARD=tegrasndt210ref,DEV=0

I could not find much information on the ES9023 DAC but at least the PCM5102 DAC looks like it should work. In fact another user has used the PCM5102 DAC successfully with other Jetson platforms in the past.

Regards,
Jon

Thanks for the reply…

I can confirm that the content is current and jetson-io is designed to use overlays to alter the pin configuration. This is how jetson-io has always worked. Please let me know if there is something that I am misunderstanding.

Oops, that was supposed to say:

for example it seems that it’s now possible to enable i2s using jetson-io

Most of the older guides on the forums talk about manually flashing dtb files from a host machine with the Jetson in force recovery - but that doesn’t seem to be required any longer (good news for me!)

I don’t have a probe, all I have is a simple electronic DC test meter. Not sure how much I can do with that, but if anything useful please let me know!

speaker-test -r 48000 -F S16_LE -c 2 -twav -D plughw:CARD=tegrasndt210ref,DEV=0

Thanks, I tried that but I got this message:

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
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error

I assume that means it can’t communicate with the DAC, but that is just a guess. Any help is appreciated!

I’ll try the PCM5012 again in a little bit to see if I can get things working, but long term I’d like to use the other DAC since it’s a much better implementation :)

OK, I’ve fixed it!

I’m not sure why, but there were settings in alsa that were preventing playback. Running alsamixer -c 1 and scrolling right to the I2S4 settings, I noticed there were values in I2S4 Channels (it was set to 16) and I2S4 sync width (don’t remember the setting. I changed everything to either 0 or none and exited and like magic, I have sound!

Wanted to make sure I posted this in case anyone came across the same issues. The odd playback error was due to mismatched clock rates which were solved when I let the system decide what to do itself.

Cheers,
Phill

Thanks Phill for the update. Glad to hear it is working!

Regards,
Jon