diff --git a/SPECS/alsa-restore.service b/SPECS/alsa-restore.service new file mode 100644 index 0000000..4a32e11 --- /dev/null +++ b/SPECS/alsa-restore.service @@ -0,0 +1,15 @@ +# +# 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 +ConditionPathExists=!/etc/alsa/state-daemon.conf + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStart=-/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main restore +ExecStop=/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf store +StandardOutput=syslog diff --git a/SPECS/alsa-state.service b/SPECS/alsa-state.service new file mode 100644 index 0000000..6dd312b --- /dev/null +++ b/SPECS/alsa-state.service @@ -0,0 +1,13 @@ +# +# 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 + +[Service] +Type=simple +ExecStart=-/usr/sbin/alsactl -s -n 19 -c -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main rdaemon +ExecStop=-/usr/sbin/alsactl -s kill save_and_quit diff --git a/SPECS/alsa.rules b/SPECS/alsa.rules new file mode 100644 index 0000000..6a4a0c3 --- /dev/null +++ b/SPECS/alsa.rules @@ -0,0 +1,8 @@ +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+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main restore /dev/$name" +TEST=="/etc/alsa/state-daemon.conf", RUN+="/sbin/alsactl -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf --initfile=/lib/alsa/init/00main nrestore /dev/$name" + +LABEL="alsa_restore_end" diff --git a/SPECS/alsactl.conf b/SPECS/alsactl.conf new file mode 100644 index 0000000..71f0d80 --- /dev/null +++ b/SPECS/alsactl.conf @@ -0,0 +1,14 @@ +# +# ALSA library configuration file for alsactl tool +# (/usr/share/alsa tree is not necessary for alsactl) +# + +ctl.hw { + @args [ CARD ] + @args.CARD { + type string + default "0" + } + type hw + card $CARD +} diff --git a/SPECS/alsaunmute b/SPECS/alsaunmute new file mode 100755 index 0000000..3f772ea --- /dev/null +++ b/SPECS/alsaunmute @@ -0,0 +1,6 @@ +#!/bin/sh + +exec /sbin/alsactl \ + -E ALSA_CONFIG_PATH=/etc/alsa/alsactl.conf \ + --initfile=/lib/alsa/init/00main \ + init diff --git a/SPECS/alsaunmute.1 b/SPECS/alsaunmute.1 new file mode 100644 index 0000000..057ae50 --- /dev/null +++ b/SPECS/alsaunmute.1 @@ -0,0 +1,28 @@ +.TH ALSAUNMUTE 1 "21 April 2010" +.SH NAME +alsaunmute \- a simple script to initialize ALSA sound devices + +.SH DESCRIPTION +\fBalsaunmute\fP is a shell script which runs the \fBalsactl(1)\fP +utility with \fIinit\fP argument (see the script for details). + +.SH OPTIONS +None + +.SS +Example: +\fBalsaunmute\fR + +.SH SEE ALSO +\fB +alsactl(1), +alsamixer(1), +amixer(1) +\fP + +.SH BUGS +None known. + +.SH AUTHOR +\fBalsaunmute\fP is by Jaroslav Kysela +