How exactly do I change bootcmd as in another topic?

I am trying to enable I2S audio from the 40-pin header. Previously (a couple of years ago) I have used the Jetson-IO tool in /opt/nvidia/jetson-io/jetson-io.py for this with no issue; however this seems to no longer work.

A solution seems to exist as seen here: Enabling I2S Audio on Jetson Nano GPIO Header. In short, the idea is to change bootcmd to

setenv bootcmd 'mw 0x6000d204 0; run distro_bootcmd'  
saveenv

The issue is it does not say where this should be done. There is no setenv command in the terminal; and if it is supposed to be added to the extlinux.conf it is not clear to me how exactly that can be achieved so that the commands actually run.

Any help would be very appreciated!

Which JetPack SW you’re using?
Not sure why the jetson-io is not working.

At least give more detail about what is no longer work.

Sorry, I should have been more clear.

Running the Jetson-IO tool works fine, and it seems to reconfigure the 40-pin header properly – at least the tool itself thinks so after reboot since the I2S and audio clock pins show up in the header overview – I simply do not receive any sound output from my I2S board using speaker-test (or aplay using a wav file).

I have used the same board, and various instances of it, previously on Jetson Nano Developer Kits without issues, but on more recent Jetpack images I get no sound. It seems like more people have had this problem as seen here, where a temporary solution also is presented: Audio I2S on 40 Pin Connector.
It was apparently from that thread that @rowel in Enabling I2S Audio on Jetson Nano GPIO Header got the idea for their more permanent solution from.

Versions and commands
Tried jetpack versions;
32.7.4-20230608212426
32.6.1-20210726122000
(I don’t currently have access to the images that have been working, but they were on older Jetpack versions than these.)

Running

$ speaker-test -Dhw:1,0 -c2

or

$ speaker-test -Dhw:1,0 -c2 -r44100

works as expected but no sound is outputted.

From the thread above, running

$ sudo grep "Name:\|J:\|BB:" /sys/kernel/debug/tegra_gpio                                                                                                                                                                

returns

Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
J: 2:1 f0 00 00 00 00 00 000000
BB: 6:3 01 00 00 00 00 00 000000

which is apparently wrong according to that thread.

I got an update regarding this issue.

I got ahold of one of my other Jetson Nanos again and simply tried the SD card (with Jetpack v 32.6.1) from first Jetson; and on this second Jetson, the sound just works. Running

$ sudo grep "Name:\|J:\|BB:" /sys/kernel/debug/tegra_gpio                                                                                                                                                                

on the second Jetson returns

Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
J: 2:1 00 00 00 00 00 00 000000
BB: 6:3 00 00 00 00 00 00 000000

which is correct.

Returning the SD card to the first Jetson still reproduces the issue, which to me makes it more likely that it is a boot issue.

So I got it working, and seemingly permanently, using the serial console (as hinted in the mentioned threads).

Small guide for I2S audio and possible issues

With:
sudo /opt/nvidia/jetson-io/jetson-io.py
In
Configure Jetson 40pin Header -> Configure header pins manually
Enable the aud_mclk and i2s4 on the 40-pin header
Back -> Save pin changes -> Reboot to reconfigure

Test audio with noise
speaker-test -c2 --scale 40 -D hw:1,0

Test audio with example file:
aplay Music/example_file.wav -D hw:1,0 --vumeter stereo -vv

Run these commands with sudo to avoid any (usually temporary) ”resource busy” issues which seem to happen shortly after boots.

If commands are running but there is no audible audio
Use the serial console, see Jetsonhacks Serial debug guide; but I used a serial debug USB cable and then the screen command (available on macOS), found the a tty.usbserial-0001 device using ls /dev/ and then in terminal ran screen /dev/tty.usbserial-0001 115200.

In the serial console and during boot, stop the autoboot process when prompted, and then run the following commands:

setenv bootcmd 'mw 0x6000d204 0; mw 0x6000d60c 0; run distro_bootcmd'
saveenv
reset

(The current bootcmd can be printed using printenv bootcmd.) (Here I had to add the mw 0x6000d60c 0; part from the previous solution in order to get sound output, possibly it is not needed for sound input but I have not tried it.)

This should fix the register issues at each boot.

1 Like

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