alsactl/alsactl
alsactl/alsactl_init.7
alsactl/alsa-state.service
+alsactl/alsa-restore.service
+alsactl/alsa-store.service
alsaconf/alsaconf
alsamixer/alsamixer
amidi/amidi
-ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS=="card*", \
- RUN+="@sbindir@/alsactl nrestore $attr{number}"
+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+="@sbindir@/alsactl restore $attr{number}"
+TEST=="/etc/alsa/state-daemon.conf", RUN+="@sbindir@/alsactl nrestore $attr{number}"
+
+LABEL="alsa_restore_end"
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
- alsa-state.service
+ alsa-state.service \
+ alsa-restore.service \
+ alsa-store.service
install-data-hook:
$(MKDIR_P) -m 0755 \
$(DESTDIR)$(systemdsystemunitdir)/basic.target.wants \
$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants
( cd $(DESTDIR)$(systemdsystemunitdir)/basic.target.wants && \
- rm -f alsa-restore.service && \
- $(LN_S) ../alsa-restore.service alsa-restore.service )
+ rm -f alsa-state.service alsa-restore.service && \
+ $(LN_S) ../alsa-state.service alsa-state.service && \
+ $(LN_S) ../alsa-restore.service alsa-restore.service)
( cd $(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants && \
rm -f alsa-store.service && \
$(LN_S) ../alsa-store.service alsa-store.service )
alsa-state.service: alsa-state.service.in
$(edit)
+alsa-restore.service: alsa-restore.service.in
+ $(edit)
+
+alsa-store.service: alsa-store.service.in
+ $(edit)
+
90-alsa-restore.rules: 90-alsa-restore.rules.in
$(edit)
EXTRA_DIST += \
alsa-state.service.in \
+ alsa-restore.service.in \
+ alsa-store.service.in \
90-alsa-restore.rules.in
CLEANFILES = \
alsa-state.service \
+ alsa-restore.service \
+ alsa-store.service \
90-alsa-restore.rules
%.7: %.xml
--- /dev/null
+#
+# 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=Restore Sound Card State
+ConditionPathExists=!/etc/alsa/state-daemon.conf
+DefaultDependencies=no
+After=alsa-state.service
+Before=shutdown.target
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshop
+ExecStart=-@sbindir@/alsactl restore
+StandardOutput=syslog
+#
+# 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)
+ConditionPathExists=/etc/alsa/state-daemon.conf
DefaultDependencies=no
After=sysinit.target
Before=shutdown.target
--- /dev/null
+#
+# 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=Store Sound Card State
+ConditionPathExists=!/etc/alsa/state-daemon.conf
+DefaultDependencies=no
+Before=shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=@sbindir@/alsactl store
+StandardOutput=syslog