summaryrefslogtreecommitdiff
path: root/media-sound/alsa-utils
diff options
context:
space:
mode:
Diffstat (limited to 'media-sound/alsa-utils')
-rw-r--r--media-sound/alsa-utils/Manifest3
-rw-r--r--media-sound/alsa-utils/alsa-utils-1.1.9.ebuild2
-rw-r--r--media-sound/alsa-utils/files/alsasound.initd-r887
3 files changed, 90 insertions, 2 deletions
diff --git a/media-sound/alsa-utils/Manifest b/media-sound/alsa-utils/Manifest
index 0ea1fbae3e0e..3fff70e93906 100644
--- a/media-sound/alsa-utils/Manifest
+++ b/media-sound/alsa-utils/Manifest
@@ -3,6 +3,7 @@ AUX alsa-utils-1.1.8-missing_header.patch 1580 BLAKE2B 59ac66fa5fbc303978bac8e16
AUX alsasound.confd-r4 340 BLAKE2B bcd03d51441528871316f1de640c4e7d382756bfea893adad8ea5b65ac166199dfa23acb07a0ae92d933d1b9c74d39cf96a778993b3d72074c27e4a7b4c28f4c SHA512 90c1e974276945f7632dc370a005b58d669b93edbf27116098d4831e69c11c26d9b21e7eacfaf12c50019f8c88dc1f370101e2d905fdde40887fe36bac00d83e
AUX alsasound.initd-r6 2189 BLAKE2B f0c4b5b51aae15f5d841b4e2ea8ce6a0631f92868a12b481798c484f6eff54bf8de0352c8c8b01c58d6164ab8de25bbfebb619f87bebb9c50c00610b67eed2e8 SHA512 960e6eff97174004abeb8d36d68c01a9f67e589174743928bb63dc37390f9868551e5b7e11c8386db67889c3d518f5ff4564b258dfee5e3317c164bc52aac04e
AUX alsasound.initd-r7 2190 BLAKE2B af02158bfa5d74c174cb5efbb8dff4c0b51ff856d7b4afdc5c5f601e5e7055710474db63ac9c6dd4145a680e94f08f8beff138d43a1ad50e3f24d52ae6bd40b7 SHA512 725153b0843bae7a4fee5ed5b1d80e0839420f18314e6a759a00ba6895176823b1842fdbacfbcdce7aa755c44892090ba9e649580e7acd7df1677d8b387df115
+AUX alsasound.initd-r8 2183 BLAKE2B 3c3e59847817e06e7847399fad02885fc493e2b51b769a16d3cff57a2270a7769de2072855e5d09883e6c339d207185b4cb75639cbb2c5d3d16c07d9b07a75a3 SHA512 983172bbec6792028d0757d2385bfe1a7226b1db72a4490acf2a4927e6a20d8cca0746a2b1747f0f3390353196051b041397e3eae1d04a6fa02985c87a5e178f
DIST alsa-utils-1.1.2.tar.bz2 1193140 BLAKE2B 8c9d3baae1530a399299379963e68c50d2d4fca63045b7c59b14240d5ad6316c37f1c7d6f4a7fa2cfeb8e5ae561440b9ad689475e006ab1fcaea2065b7c33015 SHA512 38dc3331e8410123085738e74ca34c860666027ee2f6aaa21f48e726c84d8e6264043c8c7111ce2b1e158a0f38142a04d72a128ee54e00173dc4e4ba514d2f14
DIST alsa-utils-1.1.6.tar.bz2 1203722 BLAKE2B e098ecbc5835c8ecd311a4df1ab51a709200b0d3666437f7f059d3842f07e1200a934b951e8e2c8ecedbe0aef4e2c766d875df577662eb21ce989807941ab6b7 SHA512 24d0ffaeeccecb3276d7d35ef51e6de6026a63fa5a1a1e4605b024f54d8097717e97ec9d33cfe50830ad17e4a89268ca24b065039b0df7f9fbe02b570617aa58
DIST alsa-utils-1.1.8.tar.bz2 1262174 BLAKE2B 643017f8f31d88356a2a55b5b1249d5b705daa7bd38e6d5e8835a21a9aefeca2fb1a7444c5709516ace0eecdfd5b410b5b24008abebb7ca917763108637bbcca SHA512 f877b491840126420dd9847347d0af865b6d03eccac2e2c3853cdbc76e91899f5a5139753cc41a4db942e7999c8d53cf9bd57d2fd5e1d32c872871b2d25146d9
@@ -10,5 +11,5 @@ DIST alsa-utils-1.1.9.tar.bz2 1268833 BLAKE2B 56fe00bd7dce21969f9f91d1d82a6644da
EBUILD alsa-utils-1.1.2.ebuild 2199 BLAKE2B 110899e375e20f25067db6dcc21b3302ac119dc9656c88946f0fa304084571f61ab6335536336d874dedad465dfcb0b4b1c39e3a7b0b502082dbb90ca5a32abf SHA512 e0253fbba1c48e7318d5b9ab5bceebccd303ac09e6e2687a3947788e90491a7c88952209128ece17ffeb6255330118d3a43e245513e4c1dca9254bbeed72394f
EBUILD alsa-utils-1.1.6.ebuild 2249 BLAKE2B 9e754eb263685924e5897018242cea86a4a4b9d3fbc5aad66aa17e6df23d01d99854058e624139db257384d9cbd5c4d2722cf26dda8c0f89daffc4894e58c192 SHA512 14caac4da6c061bdf718e93465ffe09963aad438e7b83c5d82ce8b743620774d3e38aa0a8c91d9e949b35371a55d99fc6d10d0e52f209e3435b1d6d84f537dad
EBUILD alsa-utils-1.1.8.ebuild 2324 BLAKE2B f060b776cbdfcc0abbc3db65ae9f248a7abea99e0fee67dc52c9459449318f713831063367ccd19554096ebebad692de238ac9639ae42bdadeb40bff138ac85e SHA512 aa64ad1cdaa7a7a8d252b6dd7d43dc0102b9512349c7fa64114aa551b526e0db4e6dd1d7ca1ef19a22a6a77631c2d2c254e0139bc6bc3e4640c5406b6a87f1c0
-EBUILD alsa-utils-1.1.9.ebuild 2327 BLAKE2B a6dbd0cedb1f3c9be217caa581f6e3219590f0ec9928d86bb6dadaecc5994c0bb6d805f45b91f5df44c116a9058da1cf560c296114d6975220ee9b2c77962bc5 SHA512 b1b97a5e3ebbafe230187da5bb8563fd680da4e414c0fb5797904fd9e594491496a8500f95e886573fe91e93b551f20d95cf330f48d0898674dec8597f61016b
+EBUILD alsa-utils-1.1.9.ebuild 2327 BLAKE2B 62ae048c8852d50917feb356949280f22811786e3d092795c2a044f460d32cd8be5bf125f53ad7710dfda5ac057ec591da162cb2d6004621af2b4a3ff630484b SHA512 eda801263d829c4a39b6070f79ec28d895895b983572186a0de4bc6cb90219031f7f54fef0317cdd1f19624dcce8d027bdaecb3d04b5c726a631d4dd02bc29b0
MISC metadata.xml 479 BLAKE2B 1245c4734565b6ad06c137019aeb4ea92a5fe71e1ea66bb5860566cc00b7fc8a3b03ba343262ac10c7d8b93c1efc91e3a1fd56999a5cb9ee0ff11a0d9d9c03e1 SHA512 e03521bce9f75fc5ef16413153542993d6038bd07eb928a76b7f99b729d53dd160986128fa1754d16820fca89a58a3b23628e32c04d01d52f769f48ecc5ee367
diff --git a/media-sound/alsa-utils/alsa-utils-1.1.9.ebuild b/media-sound/alsa-utils/alsa-utils-1.1.9.ebuild
index bcc1f868e6d6..bfb1938f52be 100644
--- a/media-sound/alsa-utils/alsa-utils-1.1.9.ebuild
+++ b/media-sound/alsa-utils/alsa-utils-1.1.9.ebuild
@@ -48,7 +48,7 @@ src_install() {
default
dodoc seq/*/README.*
- newinitd "${FILESDIR}"/alsasound.initd-r7 alsasound
+ newinitd "${FILESDIR}"/alsasound.initd-r8 alsasound
newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
insinto /etc/modprobe.d
diff --git a/media-sound/alsa-utils/files/alsasound.initd-r8 b/media-sound/alsa-utils/files/alsasound.initd-r8
new file mode 100644
index 000000000000..2fe2347c3773
--- /dev/null
+++ b/media-sound/alsa-utils/files/alsasound.initd-r8
@@ -0,0 +1,87 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+alsastatedir=/var/lib/alsa
+alsascrdir=/etc/alsa.d
+alsahomedir=/run/alsasound
+
+extra_commands="save restore"
+
+depend() {
+ need localmount
+ after bootmisc modules isapnp coldplug hotplug
+}
+
+restore() {
+ ebegin "Restoring Mixer Levels"
+
+ checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
+
+ if [ ! -r "${alsastatedir}/asound.state" ] ; then
+ ewarn "No mixer config in ${alsastatedir}/asound.state, you have to unmute your card!"
+ eend 0
+ return 0
+ fi
+
+ local cards="$(sed -n -e 's/^ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)"
+ local CARDNUM
+ for cardnum in ${cards}; do
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ [ -e /dev/snd/controlC${cardnum} ] || sleep 2
+ alsactl -E HOME="${alsahomedir}" -I -f "${alsastatedir}/asound.state" restore ${cardnum} \
+ || ewarn "Errors while restoring defaults, ignoring"
+ done
+
+ for ossfile in "${alsastatedir}"/oss/card*_pcm* ; do
+ [ -e "${ossfile}" ] || continue
+ # We use cat because I'm not sure if cp works properly on /proc
+ local procfile=${ossfile##${alsastatedir}/oss}
+ procfile="$(echo "${procfile}" | sed -e 's,_,/,g')"
+ if [ -e /proc/asound/"${procfile}"/oss ] ; then
+ cat "${ossfile}" > /proc/asound/"${procfile}"/oss
+ fi
+ done
+
+ eend 0
+}
+
+save() {
+ ebegin "Storing ALSA Mixer Levels"
+
+ checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
+
+ mkdir -p "${alsastatedir}"
+ if ! alsactl -E HOME="${alsahomedir}" -f "${alsastatedir}/asound.state" store; then
+ eerror "Error saving levels."
+ eend 1
+ return 1
+ fi
+
+ for ossfile in /proc/asound/card*/pcm*/oss; do
+ [ -e "${ossfile}" ] || continue
+ local device=${ossfile##/proc/asound/} ; device=${device%%/oss}
+ device="$(echo "${device}" | sed -e 's,/,_,g')"
+ mkdir -p "${alsastatedir}/oss/"
+ cp "${ossfile}" "${alsastatedir}/oss/${device}"
+ done
+
+ eend 0
+}
+
+start() {
+ if [ "${RESTORE_ON_START}" = "yes" ]; then
+ restore
+ fi
+
+ return 0
+}
+
+stop() {
+ if [ "${SAVE_ON_STOP}" = "yes" ]; then
+ save
+ fi
+ return 0
+}