Smartcow Apollo: How to restore to its default i.e. jetpack4.6

I was trying to configure jetson-io pins for line in and line out audio port using “configure jetsion-io pins manually” option with this commands - sudo /opt/nvidia/jetson-io/jetson-io.py.

This created duplicates file and following the suggestions on forum, I deleted those file i.e
sudo rm /boot/tegra194-p3668-all-p3509-0000-hdr40.dtbo
sudo rm /boot/kernel_tegra194-p3668-all-p3509-0000-hdr40-user-custom.dtbo

This lost some of the configuration of jetson-io and therefore, want to restore it. On the Apollo documentation, One-Key Recovery option is there but not have much details. Also, I don’t want to update BSP with latest available. I want to keep existing only.

If there is any option to recover these file and get the jetson-io working, or how to do this restoration, please share.

@kayccc
@ryagius
@vennusbear

You can download the Image and extracted those file and copy to XNX.
Below is the DLC

Hi @ShaneCCC
I did try this but I found only /boot/tegra194-p3668-all-p3509-0000-hdr40.dtbo

/boot/kernel_tegra194-p3668-all-p3509-0000-hdr40-user-custom.dtbo this is not present.

@ryagius Please assist me for this problem. Looking forward.

Dear @user115721

Given that Apollo has custom hardware, the device tree has been modified and jetson-io.py may not necessarily work as intended, as has some chance to mess up our custom configurations.

Host-less factory reset is still a work in progress, but in the meantime you may switch over to the secondary root file system, which contains a clone of the primary one, minus your changes.

You may do this as follows;

On your apollo, first check on which rootfs you have booted into, in my case its rootfs A.

nvidia@apollo:~$ sudo nvbootctrl dump-slots-info
Current bootloader slot: A
Active bootloader slot: A
magic:0x43424e00,             version: 5             features: 53             num_slots: 2
slot: 0,             priority: 15,             suffix: _a,             retry_count: 7,             boot_successful: 1
slot: 1,             priority: 14,             suffix: _b,             retry_count: 7,             boot_successful: 1

Then, swap over to the secondary rootfs and reboot;

sudo nvbootctrl set-active-boot-slot 1

nvidia@apollo:~$ sudo nvbootctrl dump-slots-info
Current bootloader slot: A
Active bootloader slot: B
magic:0x43424e00,             version: 5             features: 53             num_slots: 2
slot: 0,             priority: 14,             suffix: _a,             retry_count: 7,             boot_successful: 0
slot: 1,             priority: 15,             suffix: _b,             retry_count: 7,             boot_successful: 0

sudo reboot

Thanks @ryagius for the sharing this approach.
I tried this and can see the Active bootloader slot :B as shown above.

I ran amixer -c jetsonxaviernxa cset name=‘ADMAIF1 Mux’ I2S3 and arecord -D hw:jetsonxaviernxa,0 -c 2 -d 10 -r 48000 -f S32_LE test.wav

With the above command, I am able to record sound with Apollo’s Microphone.

But, for Apollo’s Speaker configuration-
amixer -c jetsonxaviernxa sset “I2S5 Mux” ADMAIF2
above command shows following logs -

Simple mixer control ‘I2S5 Mux’,0
Capabilities: enum
Items: ‘None’ ‘ADMAIF1’ ‘ADMAIF2’ ‘ADMAIF3’ ‘ADMAIF4’ ‘ADMAIF5’ ‘ADMAIF6’ ‘ADMAIF7’ ‘ADMAIF8’ ‘ADMAIF9’ ‘ADMAIF10’ ‘ADMAIF11’ ‘ADMAIF12’ ‘ADMAIF13’ ‘ADMAIF14’ ‘ADMAIF15’ ‘ADMAIF16’ ‘I2S1’ ‘I2S2’ ‘I2S3’ ‘I2S4’ ‘I2S5’ ‘I2S6’ ‘SFC1’ ‘SFC2’ ‘SFC3’ ‘SFC4’ ‘MIXER1-1’ ‘MIXER1-2’ ‘MIXER1-3’ ‘MIXER1-4’ ‘MIXER1-5’ ‘AMX1’ ‘AMX2’ ‘AMX3’ ‘AMX4’ ‘ARAD1’ ‘AFC1’ ‘AFC2’ ‘AFC3’ ‘AFC4’ ‘AFC5’ ‘AFC6’ ‘OPE1’ ‘SPKPROT1’ ‘MVC1’ ‘MVC2’ ‘IQC1-1’ ‘IQC1-2’ ‘IQC2-1’ ‘IQC2-2’ ‘DMIC1’ ‘DMIC2’ ‘DMIC3’ ‘DMIC4’ ‘ADX1-1’ ‘ADX1-2’ ‘ADX1-3’ ‘ADX1-4’ ‘ADX2-1’ ‘ADX2-2’ ‘ADX2-3’ ‘ADX2-4’ ‘ADX3-1’ ‘ADX3-2’ ‘ADX3-3’ ‘ADX3-4’ ‘ADX4-1’ ‘ADX4-2’ ‘ADX4-3’ ‘ADX4-4’ ‘ADMAIF17’ ‘ADMAIF18’ ‘ADMAIF19’ ‘ADMAIF20’ ‘ASRC1-1’ ‘ASRC1-2’ ‘ASRC1-3’ ‘ASRC1-4’ ‘ASRC1-5’ ‘ASRC1-6’
Item0: ‘ADMAIF2’

And when I run sudo /opt/nvidia/jetson-io/jetson-io.py
I can not see the jetsion-io panel. It disappears immediately.

Please help me out

sudo /opt/nvidia/jetson-io/jetson-io.py Is liable to not work as intended, given that the device tree has been modified. It is not needed to configure Apollo’s microphones, speaker and line in/out.

You should not need to reconfigure the audio multiplexers, as these are handled by startup services via systemd.

After rebooting, the steps to record audio on the microphone should be as follows;

arecord -D hw:jetsonxaviernxa,0 -c 2 -d 5 -r 48000 -f S32_LE test.wav

And playback on the speaker;

aplay -D hw:jetsonxaviernxa,1 -c 2 -r 48000 -f S32_LE test.wav

In the case of issues, please try to first reconfigure the multiplexer by using the helper scripts as explained in /opt/apollo/base/audio/samples/audio-in/README.md and /opt/apollo/base/audio/samples/audio-out/README.md

Thanks @ryagius for the quick response.

Yes, both commands works for Apollo’s Microphone and Speaker.

But how to use line-in and line-out shown in the image -

@user115721 exploring the helper scripts in /opt/apollo/base/audio/src/helpers would help you out here, as these configure the audio multiplexer on startup.

tail /opt/apollo/base/audio/src/helpers/mus_setup_in.sh

## LINE-IN
amixer -c jetsonxaviernxa cset name='ADMAIF3 Mux' I2S5
line_in_function || true

## MICROPHONE
amixer -c jetsonxaviernxa cset name="ADMAIF1 Mux" I2S5
microphone_function || true
tail /opt/apollo/base/audio/src/helpers/mus_setup_out.sh

## LINE-OUT
amixer -c jetsonxaviernxa sset "I2S5 Mux" ADMAIF4
line_out || true

## SPEAKER
amixer -c jetsonxaviernxa sset "I2S5 Mux" ADMAIF2
speaker || true

Here, LINE_IN is muxed to ADMAIF3 and LINE_OUT is muxed to ADMAIF4. This implies that to record audio from LINE_IN, you would use:

arecord -D hw:jetsonxaviernxa,2 -c 2 -d 5 -r 48000 -f S32_LE test.wav

and playback on LINE_OUT using:

aplay -D hw:jetsonxaviernxa,3 -c 2 -r 48000 -f S32_LE test.wav

Let me know if this helps!

Hi @ryagius , much appreciate you efforts for the helping us.

I think…there is mis match in the path for mux settings. I do not find /opt/apollo/base/audio/src/helpers whereas Apollo’s directory structure is like -

nvidia@smartcow-malta:/opt/apollo$ tree
.
├── devices
│ ├── buttons
│ │ ├── python-requirements.txt
│ │ ├── README.md
│ │ └── simple-input.py
│ ├── camera
│ │ └── README.md
│ ├── microphones
│ │ ├── mux_setup.sh
│ │ └── README.md
│ ├── oled
│ │ ├── display-login-logo.py
│ │ ├── display-pinout.py
│ │ ├── fonts
│ │ │ ├── C&C Red Alert [INET].ttf
│ │ │ ├── ChiKareGo.ttf
│ │ │ ├── code2000.ttf
│ │ │ ├── creep.bdf
│ │ │ ├── fontawesome-webfont.ttf
│ │ │ ├── FreePixel.ttf
│ │ │ ├── miscfs_.ttf
│ │ │ ├── pixelmix.ttf
│ │ │ ├── ProggyTiny.ttf
│ │ │ ├── README [INET].txt
│ │ │ ├── tiny.ttf
│ │ │ └── Volter__28Goldfish_29.ttf
│ │ ├── hello-world.py
│ │ ├── images
│ │ │ ├── 40-pin-header.png
│ │ │ └── apollo.gif
│ │ ├── python-requirements.txt
│ │ └── README.md
│ ├── README.md
│ └── speaker
│ ├── mux_setup.sh
│ └── README.md
└── src
├── helpers
│ ├── l4t_version.sh
│ └── README.md
├── python
│ ├── oled
│ │ ├── luma
│ │ │ ├── CHANGES.rst
│ │ │ ├── CONTRIBUTING.rst
│ │ │ ├── examples
│ │ │ │ └── README.1st
│ │ │ ├── LICENSE.rst
│ │ │ ├── luma
│ │ │ │ ├── init.py
│ │ │ │ ├── oled
│ │ │ │ │ ├── const.py
│ │ │ │ │ ├── device
│ │ │ │ │ │ ├── color.py
│ │ │ │ │ │ ├── framebuffer_mixin.py
│ │ │ │ │ │ ├── greyscale.py
│ │ │ │ │ │ └── init.py
│ │ │ │ │ └── init.py
│ │ │ │ └── pycache
│ │ │ │ └── init.cpython-36.pyc
│ │ │ ├── MANIFEST.in
│ │ │ ├── pyproject.toml
│ │ │ ├── pytest.ini
│ │ │ ├── README.rst
│ │ │ ├── setup.cfg
│ │ │ ├── setup.py
│ │ │ ├── tests
│ │ │ │ ├── baseline_data.py
│ │ │ │ ├── helpers.py
│ │ │ │ ├── reference
│ │ │ │ │ ├── anim.gif
│ │ │ │ │ ├── capture.png
│ │ │ │ │ ├── data
│ │ │ │ │ │ ├── demo_sh1106.json
│ │ │ │ │ │ ├── demo_ssd1306.json
│ │ │ │ │ │ ├── demo_ssd1309.json
│ │ │ │ │ │ ├── demo_ssd1322_greyscale.json
│ │ │ │ │ │ ├── demo_ssd1322_monochrome.json
│ │ │ │ │ │ ├── demo_ssd1322_nhd_greyscale.json
│ │ │ │ │ │ ├── demo_ssd1322_nhd_monochrome.json
│ │ │ │ │ │ ├── demo_ssd1325_greyscale.json
│ │ │ │ │ │ ├── demo_ssd1325_monochrome.json
│ │ │ │ │ │ ├── demo_ssd1327_greyscale.json
│ │ │ │ │ │ ├── demo_ssd1327_monochrome.json
│ │ │ │ │ │ ├── demo_ssd1331.json
│ │ │ │ │ │ ├── demo_ssd1351.json
│ │ │ │ │ │ ├── demo_ssd1362_greyscale.json
│ │ │ │ │ │ └── demo_ssd1362_monochrome.json
│ │ │ │ │ ├── hotspot.png
│ │ │ │ │ ├── portrait.png
│ │ │ │ │ └── set_position.png
│ │ │ │ ├── test_sh1106.py
│ │ │ │ ├── test_ssd1306.py
│ │ │ │ ├── test_ssd1309.py
│ │ │ │ ├── test_ssd1322_nhd.py
│ │ │ │ ├── test_ssd1322.py
│ │ │ │ ├── test_ssd1325.py
│ │ │ │ ├── test_ssd1327.py
│ │ │ │ ├── test_ssd1331.py
│ │ │ │ ├── test_ssd1351.py
│ │ │ │ ├── test_ssd1362.py
│ │ │ │ └── test_ws0010.py
│ │ │ └── tox.ini
│ │ └── opts
│ │ ├── demo_opts
│ │ │ ├── demo_opts.py
│ │ │ └── init.py
│ │ └── setup.py
│ ├── onetouch
│ │ ├── apollo_onetouch
│ │ │ ├── FlushCanvas.py
│ │ │ ├── init.py
│ │ │ └── update_check.py
│ │ ├── ignore_update.py
│ │ ├── onetouch.py
│ │ ├── README.md
│ │ ├── setup.py
│ │ └── unignore_update.py
│ └── README.md
├── README.md
└── services
├── oled_startup.service
├── onetouch_startup.service
└── README.md

26 directories, 98 files

So, when I ran following command on terminal,
## LINE-IN
amixer -c jetsonxaviernxa cset name=‘ADMAIF3 Mux’ I2S5
line_in_function || true
## LINE-OUT
amixer -c jetsonxaviernxa sset “I2S5 Mux” ADMAIF4
line_out || true

the amixer commands rans successfully but not the other command-

-bash: line_out: command not found
-bash: line_in_function: command not found

However, I am able to record using Line-in but Line-out not working.

Not able to playback using Line-out.

One more point to mention, I am using a earphones for line-out, I hope its fine? Does it requires headphones with mic with two pins jack for input-output(one for microphone and one for headphones)?

Please share your thoughts.

@user115721 the apollo package seems outdated, first upgrade it to the latest by running sudo apt upgrade apollo*

Hi @ryagius
The upgrade command wont work.

nvidia@smartcow-malta:~$ sudo apt upgrade apollo*
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘apollo-nlp’ for glob ‘apollo*’
Note, selecting ‘apollo-sdk’ for glob ‘apollo*’
Note, selecting ‘apollo-deepstream’ for glob ‘apollo*’
Note, selecting ‘apollo-oled’ for glob ‘apollo*’
Note, selecting ‘apollo-riva’ for glob ‘apollo*’
Note, selecting ‘apollo-applications’ for glob ‘apollo*’
Note, selecting ‘apollo-camera’ for glob ‘apollo*’
Note, selecting ‘apollo-gpio’ for glob ‘apollo*’
Note, selecting ‘apollo’ for glob ‘apollo*’
Note, selecting ‘apollo-base’ for glob ‘apollo*’
Note, selecting ‘apollo-update’ for glob ‘apollo*’
Note, selecting ‘apollo-audio’ for glob ‘apollo*’
Calculating upgrade… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
apollo-applications : Depends: nvidia-jetpack but it is not installable
apollo-deepstream : Depends: nvidia-jetpack but it is not installable
apollo-nlp : Depends: nvidia-jetpack but it is not installable
apollo-riva : Depends: nvidia-jetpack but it is not installable
E: Broken packages

Your suggestions,Please.

Your nvidia apt sources are disabled.

Re-enable them by uncommenting the two lines in the apt sources lists;

sudo vim /etc/apt/sources.list.d/nvidia-l4t-apt-source.list

Then run sudo apt update, followed by sudo apt upgrade apollo*

Hi @ryagius
After ran the commands, I got logs

Running hooks in /etc/ca-certificates/update.d…
done.
Processing triggers for initramfs-tools (0.130ubuntu3.13) …
Processing triggers for systemd (237-3ubuntu10.56) …
Errors were encountered while processing:
apollo-oled
apollo-update
apollo-nlp
apollo-base
apollo-sdk
apollo
apollo-applications
E: Sub-process /usr/bin/dpkg returned an error code (1)

However, the missing files are visible

nvidia@smartcow-malta:/opt/apollo/base/audio/src/helpers$ ls
muxer_config.sh muxer_reset.sh mux_setup_in.sh mux_setup_out.sh README.md

And, not able to playback recorded wavs using
aplay -D hw:jetsonxaviernxa,3 -c 2 -r 48000 -f S32_LE test.wav

This feature is very critical.
Looking forward.

Please retry the commands after rebooting your device

Hi @ryagius
Even after rebooting,arecord commands works not aplay.

Does any specific headset required for this line-in and line-out?
Please let me know, will try that one too.

Hi @ryagius

One observation, after the package updation , only LINE-IN option is working.

Speaker, Microphone and LINE-OUT are not working, however, Speaker and Microphone was working before(before upgrade).

This is very unstable… Please provide your guidance to fix this.
Looking forward.
Thanks.

@user115721

Have requested a unit to copy your setup, will update you as soon as possible.

Hi @ryagius
Is it possible to have quick fix for speaker functionality.

On speaker only this command works - speaker-test -D hw:jetsonxaviernxa,1 -c 2 -r 48000 -F S16_LE -t sine -f 500

my custom audio files wont run on speaker.

Thanks.

Hi @user115721

Define what you mean by custom audio files, and your aplay command that you used to play these files.

The options provided to aplay indicate the characteristics that your audio file should possess, these being:

  1. sample rate = 48kHz
  2. sample format = S32_LE
  3. channels = 2