How to reset amixer settings to default on NX

Hi,

I’m using amixer to map the I2S5 to ADMAIF1 as follows:
user@user-desktop:~$ amixer -c 1 cset name=“I2S5 Mux” ADMAIF1
numid=988,iface=MIXER,name=‘I2S5 Mux’
; type=ENUMERATED,access=rw------,values=1,items=81
; Item #0 ‘None’
; Item #1 ‘ADMAIF1’
; Item #2 ‘ADMAIF2’
; Item #3 ‘ADMAIF3’
; Item #4 ‘ADMAIF4’
; Item #5 ‘ADMAIF5’
; Item #6 ‘ADMAIF6’
; Item #7 ‘ADMAIF7’
; Item #8 ‘ADMAIF8’
; Item #9 ‘ADMAIF9’
; Item #10 ‘ADMAIF10’
; Item #11 ‘ADMAIF11’
; Item #12 ‘ADMAIF12’
; Item #13 ‘ADMAIF13’
; Item #14 ‘ADMAIF14’
; Item #15 ‘ADMAIF15’
; Item #16 ‘ADMAIF16’
; Item #17 ‘I2S1’
; Item #18 ‘I2S2’
; Item #19 ‘I2S3’
; Item #20 ‘I2S4’
; Item #21 ‘I2S5’
; Item #22 ‘I2S6’
; Item #23 ‘SFC1’
; Item #24 ‘SFC2’
; Item #25 ‘SFC3’
; Item #26 ‘SFC4’
; Item #27 ‘MIXER1-1’
; Item #28 ‘MIXER1-2’
; Item #29 ‘MIXER1-3’
; Item #30 ‘MIXER1-4’
; Item #31 ‘MIXER1-5’
; Item #32 ‘AMX1’
; Item #33 ‘AMX2’
; Item #34 ‘AMX3’
; Item #35 ‘AMX4’
; Item #36 ‘ARAD1’
; Item #37 ‘AFC1’
; Item #38 ‘AFC2’
; Item #39 ‘AFC3’
; Item #40 ‘AFC4’
; Item #41 ‘AFC5’
; Item #42 ‘AFC6’
; Item #43 ‘OPE1’
; Item #44 ‘SPKPROT1’
; Item #45 ‘MVC1’
; Item #46 ‘MVC2’
; Item #47 ‘IQC1-1’
; Item #48 ‘IQC1-2’
; Item #49 ‘IQC2-1’
; Item #50 ‘IQC2-2’
; Item #51 ‘DMIC1’
; Item #52 ‘DMIC2’
; Item #53 ‘DMIC3’
; Item #54 ‘DMIC4’
; Item #55 ‘ADX1-1’
; Item #56 ‘ADX1-2’
; Item #57 ‘ADX1-3’
; Item #58 ‘ADX1-4’
; Item #59 ‘ADX2-1’
; Item #60 ‘ADX2-2’
; Item #61 ‘ADX2-3’
; Item #62 ‘ADX2-4’
; Item #63 ‘ADX3-1’
; Item #64 ‘ADX3-2’
; Item #65 ‘ADX3-3’
; Item #66 ‘ADX3-4’
; Item #67 ‘ADX4-1’
; Item #68 ‘ADX4-2’
; Item #69 ‘ADX4-3’
; Item #70 ‘ADX4-4’
; Item #71 ‘ADMAIF17’
; Item #72 ‘ADMAIF18’
; Item #73 ‘ADMAIF19’
; Item #74 ‘ADMAIF20’
; Item #75 ‘ASRC1-1’
; Item #76 ‘ASRC1-2’
; Item #77 ‘ASRC1-3’
; Item #78 ‘ASRC1-4’
; Item #79 ‘ASRC1-5’
; Item #80 ‘ASRC1-6’
: values=1

After reboot I find it maintaining the setting state:
user@user-desktop:~$ amixer -c 1 cget name="I2S5 Mux"
numid=988,iface=MIXER,name=‘I2S5 Mux’
; type=ENUMERATED,access=rw------,values=1,items=81
; Item #0 ‘None’
; Item #1 ‘ADMAIF1’
; Item #2 ‘ADMAIF2’
; Item #3 ‘ADMAIF3’
; Item #4 ‘ADMAIF4’
; Item #5 ‘ADMAIF5’
; Item #6 ‘ADMAIF6’
; Item #7 ‘ADMAIF7’
; Item #8 ‘ADMAIF8’
; Item #9 ‘ADMAIF9’
; Item #10 ‘ADMAIF10’
; Item #11 ‘ADMAIF11’
; Item #12 ‘ADMAIF12’
; Item #13 ‘ADMAIF13’
; Item #14 ‘ADMAIF14’
; Item #15 ‘ADMAIF15’
; Item #16 ‘ADMAIF16’
; Item #17 ‘I2S1’
; Item #18 ‘I2S2’
; Item #19 ‘I2S3’
; Item #20 ‘I2S4’
; Item #21 ‘I2S5’
; Item #22 ‘I2S6’
; Item #23 ‘SFC1’
; Item #24 ‘SFC2’
; Item #25 ‘SFC3’
; Item #26 ‘SFC4’
; Item #27 ‘MIXER1-1’
; Item #28 ‘MIXER1-2’
; Item #29 ‘MIXER1-3’
; Item #30 ‘MIXER1-4’
; Item #31 ‘MIXER1-5’
; Item #32 ‘AMX1’
; Item #33 ‘AMX2’
; Item #34 ‘AMX3’
; Item #35 ‘AMX4’
; Item #36 ‘ARAD1’
; Item #37 ‘AFC1’
; Item #38 ‘AFC2’
; Item #39 ‘AFC3’
; Item #40 ‘AFC4’
; Item #41 ‘AFC5’
; Item #42 ‘AFC6’
; Item #43 ‘OPE1’
; Item #44 ‘SPKPROT1’
; Item #45 ‘MVC1’
; Item #46 ‘MVC2’
; Item #47 ‘IQC1-1’
; Item #48 ‘IQC1-2’
; Item #49 ‘IQC2-1’
; Item #50 ‘IQC2-2’
; Item #51 ‘DMIC1’
; Item #52 ‘DMIC2’
; Item #53 ‘DMIC3’
; Item #54 ‘DMIC4’
; Item #55 ‘ADX1-1’
; Item #56 ‘ADX1-2’
; Item #57 ‘ADX1-3’
; Item #58 ‘ADX1-4’
; Item #59 ‘ADX2-1’
; Item #60 ‘ADX2-2’
; Item #61 ‘ADX2-3’
; Item #62 ‘ADX2-4’
; Item #63 ‘ADX3-1’
; Item #64 ‘ADX3-2’
; Item #65 ‘ADX3-3’
; Item #66 ‘ADX3-4’
; Item #67 ‘ADX4-1’
; Item #68 ‘ADX4-2’
; Item #69 ‘ADX4-3’
; Item #70 ‘ADX4-4’
; Item #71 ‘ADMAIF17’
; Item #72 ‘ADMAIF18’
; Item #73 ‘ADMAIF19’
; Item #74 ‘ADMAIF20’
; Item #75 ‘ASRC1-1’
; Item #76 ‘ASRC1-2’
; Item #77 ‘ASRC1-3’
; Item #78 ‘ASRC1-4’
; Item #79 ‘ASRC1-5’
; Item #80 ‘ASRC1-6’
: values=1

How can I reset amixer settings to default after reboot? Is there any file containing the setting state of amixer which can be restored during boot?

Thanks!

Hello!

The systemd alsa-restore service saves and restores the mixer settings (which is the same on any Linux system that is using systemd). You can run the following command to reset most mixer controls …

$ alsactl init jetsonxaviernxa

Just out of curiousity why do you want to reset the setting? Most of the time, users want to set the mixer controls and then have the mixer controls restored on boot, so that it is not necessary to set them again.

Regards,
Jon

Hi,

Thanks for your reply!The reason why I want to reset the settings is that the state of mixer controls is unknown to me. The state of mixer controls may be changed by some applications, so I want to reset the settings after reboot.

There is another issue I have met. I connect a codec on NX board, but the dac is mute everytime NX reboots. I wonder if there is any file containing the setting state of mixer controls which can be restored on boot? If the file exits, can I modify it to disable the dac mute on boot?

Regards,
YHuang

Hello!

The mixer settings that are saved to /var/lib/alsa/asound.state by the systemd alsa-restore service and then restored from this file. You can check the state of the DAC mute in this file to see if the state as what you want.

Regards,
Jon

Hi,

Thanks for your reply!The problem has been solved!

Regards,
YHuang