On Sun, Sep 22, 2019 at 05:40:14PM +0200, Dominick Grift wrote: > Setting PULSE_RUNTIME_PATH did not do it for me. > > I borrowed the following from Fedora, and did: > > 1. /etc/udev/rules.d/90-alsa-restore.rules: > > ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", > GOTO="alsa_restore_go" > GOTO="alsa_restore_end" > > LABEL="alsa_restore_go" > TEST!="/etc/alsa/state-daemon.conf", RUN+="/usr/sbin/alsactl -E > HOME=/run/alsa -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf > --initfile=/usr/share/alsa/init/00main restore /dev/$name" > TEST=="/etc/alsa/state-daemon.conf", RUN+="/usr/sbin/alsactl -E > HOME=/run/alsa -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf > --initfile=/usr/share/alsa/init/00main nrestore /dev/$name" > > LABEL="alsa_restore_end" > > 2. /etc/systemd/system/alsa-state.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=Manage Sound Card State (restore and store) > Documentation=man:alsactl(1) > ConditionPathExists=/etc/alsa/state-daemon.conf > > [Service] > Type=simple > ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa -E > ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf > --initfile=/usr/share/alsa/init/00main -s -n 19 -c rdaemon > ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa -s kill save_and_quit > > 3. /etc/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 > > [Service] > Type=oneshot > RemainAfterExit=true > ExecStart=-/usr/sbin/alsactl -E HOME=/run/alsa -E > ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf > --initfile=/usr/share/alsa/init/00main restore > ExecStop=-/usr/sbin/alsactl -E HOME=/run/alsa -E > ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store > StandardOutput=syslog > > > ... seems to work
Oh and: 4. cat /etc/alsa/alsactl.conf: ctl.hw { @args [ CARD ] @args.CARD { type string default "0" } type hw card $CARD } 5. cat /etc/alsa/state-daemon.conf: # Remove this file to disable the alsactl daemon mode
signature.asc
Description: PGP signature