1

I am working on an audio project with the Raspberry Pi 3 (running latest version of Raspbian Jessie) using the AudioInjector SoundCard(http://www.audioinjector.net/) for Input/Output. I am trying to save my input setttings using sudo alsactl store, but the input settings keep getting reset upon reboot. I'm just trying to have line input turned on by default.

I change my settings in alsamixer to turn line input on then run:

sudo alsactl store 0

I see the settings changed in /var/lib/alsa/asound.state, but they are still changed back on reboot including in the asound.state file. I am looking in asound.state at:

state.audioinjectorpi {
...
control.4{
iface MIXER
name 'Line Capture Switch'
value.0 false
value.1 false
comment{
access 'read write'
type BOOLEAN
count 2
}
}
...
}

I have also tried a workaround where I add the line:

sudo amixer -c 0 sset Line,0 100%, 100% unmute cap > /home/pi/Desktop/result.txt

to my /etc/rc.local, which succeeds in running and creating the result.txt file, which shows that the command succeeded in turnings line input on, but when I open alsamixer Line Input Capture is off again.

It seems like maybe something else is happening at some point during boot which loads in different settings and turns line input off.

Any idea what is going on here?

Emmett P
  • 111

2 Answers2

0

I'm using the same Audio Card, and after dig a lot into this found that the default path is /etc/asound.state

After put the configuration into this path, and reboot the device all back to the correct way as defined into the State file.

0

If not provided by your Distribution you could use a systemd-service like the following.

> systemctl cat alsa-restore.service 
# /lib/systemd/system/alsa-restore.service
#
# Note that two different ALSA card state management schemes exist and they
# can be switched using a file exist check - /etc/alsa/state-daemon.conf .
#

[Unit] Description=Save/Restore Sound Card State Documentation=man:alsactl(1) ConditionPathExists=!/etc/alsa/state-daemon.conf ConditionPathExistsGlob=/dev/snd/control* After=alsa-state.service

[Service] Type=oneshot RemainAfterExit=true ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR=/run/alsa/runtime restore ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa -E XDG_RUNTIME_DIR=/run/alsa/runtime store