summaryrefslogtreecommitdiff
path: root/media-sound/alsa-utils
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-sound/alsa-utils
reinit the tree, so we can have metadata
Diffstat (limited to 'media-sound/alsa-utils')
-rw-r--r--media-sound/alsa-utils/Manifest13
-rw-r--r--media-sound/alsa-utils/alsa-utils-1.1.2.ebuild73
-rw-r--r--media-sound/alsa-utils/alsa-utils-1.1.3.ebuild74
-rw-r--r--media-sound/alsa-utils/alsa-utils-1.1.4-r1.ebuild74
-rw-r--r--media-sound/alsa-utils/files/alsa-modules.conf-rc38
-rw-r--r--media-sound/alsa-utils/files/alsasound.confd-r415
-rw-r--r--media-sound/alsa-utils/files/alsasound.initd-r687
-rw-r--r--media-sound/alsa-utils/files/alsasound.initd-r787
-rw-r--r--media-sound/alsa-utils/metadata.xml12
9 files changed, 473 insertions, 0 deletions
diff --git a/media-sound/alsa-utils/Manifest b/media-sound/alsa-utils/Manifest
new file mode 100644
index 000000000000..7897790d6e27
--- /dev/null
+++ b/media-sound/alsa-utils/Manifest
@@ -0,0 +1,13 @@
+AUX alsa-modules.conf-rc 1028 SHA256 6060c101ca0793ea80e2b6b5bb8d6b118325092788ff26f07c280dd1ff546570 SHA512 20b309a44e23408ede66a121d81047f32970fa033728784c76a1caabb72143dbc1c5b970f9e73a910b7ef9026df597cde2afc7c1f52127fab532dba4955b1757 WHIRLPOOL 75fdfe4802af6a020bc6a4d46da7872b3481657f13d92e30c9fa61d5accdd8cd19b14a0c813c454d2ca89fa655f5ad375c0163fa4f947342ee759ab80a4700e4
+AUX alsasound.confd-r4 340 SHA256 d1c55400b701a72dcb8bb85e016b5013fa3eb6a2766ffc20dae278d0ee4c1a43 SHA512 90c1e974276945f7632dc370a005b58d669b93edbf27116098d4831e69c11c26d9b21e7eacfaf12c50019f8c88dc1f370101e2d905fdde40887fe36bac00d83e WHIRLPOOL 0f46fe17f1a6626c3e2c8438d5006fdc8a302456820c2dfaa27955c295532aa1543e7ec0161702edd874e9588b6a383369693f080c91b0b38813b91588fc1e75
+AUX alsasound.initd-r6 2189 SHA256 cf67ba1c4bd13cc6fafdebab40b3e84d09f5b6ec768ed2dcf0ec53d9be296ba4 SHA512 960e6eff97174004abeb8d36d68c01a9f67e589174743928bb63dc37390f9868551e5b7e11c8386db67889c3d518f5ff4564b258dfee5e3317c164bc52aac04e WHIRLPOOL 96cf6acb7aa7cdb6b3a073245705a413704464f477bd2192a9b5743119a81b1c62512225ef33581d277f9a49ba413f02cd73c5c0d54b1cb9914dceba2d917076
+AUX alsasound.initd-r7 2190 SHA256 1e9245fd9f4edc51b2122f2440e60cd701f410add4b89612653f316313b1c6ca SHA512 725153b0843bae7a4fee5ed5b1d80e0839420f18314e6a759a00ba6895176823b1842fdbacfbcdce7aa755c44892090ba9e649580e7acd7df1677d8b387df115 WHIRLPOOL 74255c91cbf0116b66c084e27dabfc7ee91e92d0baa278bd2148e72e8a0bec0659afc01ca5a6d72b19ebe781cb73fd0c374d46f461d3b6ab4b1a8d58021d90fb
+DIST alsa-utils-1.1.2.tar.bz2 1193140 SHA256 7af603c0877d1251599d65b4fbc372e63a54371b888f5c26c6a86ac1d0519071 SHA512 38dc3331e8410123085738e74ca34c860666027ee2f6aaa21f48e726c84d8e6264043c8c7111ce2b1e158a0f38142a04d72a128ee54e00173dc4e4ba514d2f14 WHIRLPOOL 353d636271fd4354e7a7b986c08a3eabdb91bb8239b3d14a2163dea095dee010cd777276901c11df58a4fcba24680770512df4784e446a63941224f9ee79f632
+DIST alsa-utils-1.1.3.tar.bz2 1201424 SHA256 127217a54eea0f9a49700a2f239a2d4f5384aa094d68df04a8eb80132eb6167c SHA512 a0a00578e7f7ed8441628757048412813a0345f0a3f2e085cda7a881ae3c6e22f7cf1e5119f8200e2e4340e42152b91aa5bdc20646b8422adc74ba00e4c59363 WHIRLPOOL 10f1f8f5b7a659dc7ba79c934076eafbbd72f4892b571660a6224fc1061b4e893e2f5a937187a4eb50f2e982c07e097c965a88052451218adcde2e5cd3bfb6f9
+DIST alsa-utils-1.1.4.tar.bz2 1202047 SHA256 a7831044de92c5bf33bf3365a3f36e49397f4191e934df460ae1ca15138c9d9d SHA512 96852b3f5b57d7d9078a20881f28311543d446b69c80450179823a225089df7306456991890a7ef37672c1f55e9c386a7731c94e125504dcda2c88a674c8b4c7 WHIRLPOOL f09be2aeb3402b580ba103cfacb854b4fd55c2c19bfcfb7e56d4b924add5eb17d4fcb523cf7d85482728da8d8cfde0033cf205a7f9e53225a9b7a4a59a906f28
+EBUILD alsa-utils-1.1.2.ebuild 2202 SHA256 c19710f90252df41b95a05e2559ca2a321c167a8b9ee0ab88757762045c364cc SHA512 02849a9039acdd22f0d1fd6d0b322dced2ed368d4fa9982ef24beee44ae6f1b9c76bd5dd49910115c44048eb949964de31a75f0c44c400f66f4e9a21e13b5a4c WHIRLPOOL 7aaedc46f007c5818d223649b5e7053518257ab30065a81c3afa9d03367670b7503fe22a2e92805eaf4644072da7a171ca287802e925f5321a30d5c030e60fa9
+EBUILD alsa-utils-1.1.3.ebuild 2276 SHA256 6d58957668ffab637bb59318bb3c06c916adb726a52900e88a495281ca7a762c SHA512 3868a351c1303107bada5683a94ab17b77f99bd1e41bf1273674f86affe8dcee31cf8d8b6bc57d186ff09b4db4faf5a35fbee8048ca37c709233e939a375de08 WHIRLPOOL e72d98e131d8dbe2605db5aca0decfc71a6c8443abfb6c5f48b9aeaf7318017c56ddf6c2831c16b5667399c5db475a860af2003919e683f507e6a025bf81aa91
+EBUILD alsa-utils-1.1.4-r1.ebuild 2276 SHA256 96f11174b7db47b54a5c2856081f0f42cd31762edbbb1a0a365442ade5083a7d SHA512 d79feb69c4e942c2ccfaa012fa07f2d766030cffeb70b1b114b40e1c87d732826e355f2dc811d293bd7a7f3770076408241864e0bf543eb4095f473265bf06ba WHIRLPOOL 81150db010d34f5ea52b6ed4c4bd53ba7018b16ce053597c85fdeaa27fcec7b740006759d024236d8c208e9daf299c912ac050b3d85c8e90e4e0d137312d4059
+MISC ChangeLog 6640 SHA256 dc0aa8d9f2e28d3a0d780b287dbb92bfe691f892f2fcee077464119def9c61aa SHA512 44c681d862dbdc77bf6eea0321689001904882f8a110638ae95899b94cbc4e46690f39db06fb345c0fbd33ad9909225f845e88b5340db753e87bb371d2029a53 WHIRLPOOL 45ef640aaed0074f4a9c6bf7f05b0e9282772a946306a03000631fc94fe66b28098e2944c9f5df0ede6d20033d015dd1cb274a050ff5c8931a1e8bd73420f384
+MISC ChangeLog-2015 60020 SHA256 9cc1c84f5b62cbf38f8e9c7aee1ec7f6a9234f37a6f0f668dfbc47ca6eb0df5b SHA512 68636ed0f08a1ca6d7abb1da96ddf18f35e3a33925deff5f8d2db94a84769508dda7eaf4a4710b1b6ba7733cffaaef9bac5c66be1179305b0bfba2f9b611d437 WHIRLPOOL b85adaad0528a38134fc11db7277af3fbec3b3a4c1db30120d3ae0daa47cc7331697db9826e31ef485d355cfc1811c0c341a920da8f038004e034176314554a2
+MISC metadata.xml 479 SHA256 9f6f6e635c68171cea140add7512095c6e1d8318c4dd21257d566f2ee9f83bd4 SHA512 e03521bce9f75fc5ef16413153542993d6038bd07eb928a76b7f99b729d53dd160986128fa1754d16820fca89a58a3b23628e32c04d01d52f769f48ecc5ee367 WHIRLPOOL 3480032467463c9b21ed32cc57a8c6a117d1549529da8844e2575d792b71ad498960627f5d4965af80b81f13eb088d69f926408aa284b65330b5da7d4b7157b1
diff --git a/media-sound/alsa-utils/alsa-utils-1.1.2.ebuild b/media-sound/alsa-utils/alsa-utils-1.1.2.ebuild
new file mode 100644
index 000000000000..f8e171a61f91
--- /dev/null
+++ b/media-sound/alsa-utils/alsa-utils-1.1.2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils systemd udev
+
+DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/utils/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0.9"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE="bat doc +libsamplerate +ncurses nls selinux"
+
+CDEPEND=">=media-libs/alsa-lib-${PV}
+ libsamplerate? ( media-libs/libsamplerate )
+ ncurses? ( >=sys-libs/ncurses-5.7-r7:0= )
+ bat? ( sci-libs/fftw:= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-alsa )"
+
+src_configure() {
+ local myconf
+ use doc || myconf='--disable-xmlto'
+
+ # --disable-alsaconf because it doesn't work with sys-apps/kmod wrt #456214
+ econf \
+ --disable-maintainer-mode \
+ $(use_enable bat) \
+ $(use_enable libsamplerate alsaloop) \
+ $(use_enable nls) \
+ $(use_enable ncurses alsamixer) \
+ --disable-alsaconf \
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+ --with-udev-rules-dir="$(get_udevdir)"/rules.d \
+ ${myconf}
+}
+
+src_install() {
+ default
+ dodoc seq/*/README.*
+
+ newinitd "${FILESDIR}"/alsasound.initd-r6 alsasound
+ newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/alsa-modules.conf-rc alsa.conf
+
+ keepdir /var/lib/alsa
+
+ # ALSA lib parser.c:1266:(uc_mgr_scan_master_configs) error: could not
+ # scan directory /usr/share/alsa/ucm: No such file or directory
+ # alsaucm: unable to obtain card list: No such file or directory
+ keepdir /usr/share/alsa/ucm
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "To take advantage of the init script, and automate the process of"
+ elog "saving and restoring sound-card mixer levels you should"
+ elog "add alsasound to the boot runlevel. You can do this as"
+ elog "root like so:"
+ elog "# rc-update add alsasound boot"
+ ewarn
+ ewarn "The ALSA core should be built into the kernel or loaded through other"
+ ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
+ fi
+}
diff --git a/media-sound/alsa-utils/alsa-utils-1.1.3.ebuild b/media-sound/alsa-utils/alsa-utils-1.1.3.ebuild
new file mode 100644
index 000000000000..9c10bb2c4ec3
--- /dev/null
+++ b/media-sound/alsa-utils/alsa-utils-1.1.3.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils systemd udev
+
+DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/utils/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0.9"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="bat doc +libsamplerate +ncurses nls selinux"
+
+CDEPEND=">=media-libs/alsa-lib-${PV}
+ libsamplerate? ( media-libs/libsamplerate )
+ ncurses? ( >=sys-libs/ncurses-5.7-r7:0= )
+ bat? ( sci-libs/fftw:= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-alsa )"
+
+src_configure() {
+ local myconf
+ use doc || myconf='--disable-xmlto'
+
+ # --disable-alsaconf because it doesn't work with sys-apps/kmod wrt #456214
+ econf \
+ --disable-maintainer-mode \
+ $(use_enable bat) \
+ $(use_enable libsamplerate alsaloop) \
+ $(use_enable nls) \
+ $(use_enable ncurses alsamixer) \
+ --disable-alsaconf \
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+ --with-udev-rules-dir="${EPREFIX}/$(get_udevdir)"/rules.d \
+ --with-asound-state-dir="${EPREFIX}"/var/lib/alsa \
+ ${myconf}
+}
+
+src_install() {
+ default
+ dodoc seq/*/README.*
+
+ newinitd "${FILESDIR}"/alsasound.initd-r6 alsasound
+ newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/alsa-modules.conf-rc alsa.conf
+
+ keepdir /var/lib/alsa
+
+ # ALSA lib parser.c:1266:(uc_mgr_scan_master_configs) error: could not
+ # scan directory /usr/share/alsa/ucm: No such file or directory
+ # alsaucm: unable to obtain card list: No such file or directory
+ keepdir /usr/share/alsa/ucm
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "To take advantage of the init script, and automate the process of"
+ elog "saving and restoring sound-card mixer levels you should"
+ elog "add alsasound to the boot runlevel. You can do this as"
+ elog "root like so:"
+ elog "# rc-update add alsasound boot"
+ ewarn
+ ewarn "The ALSA core should be built into the kernel or loaded through other"
+ ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
+ fi
+}
diff --git a/media-sound/alsa-utils/alsa-utils-1.1.4-r1.ebuild b/media-sound/alsa-utils/alsa-utils-1.1.4-r1.ebuild
new file mode 100644
index 000000000000..87137657c10e
--- /dev/null
+++ b/media-sound/alsa-utils/alsa-utils-1.1.4-r1.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit eutils systemd udev
+
+DESCRIPTION="Advanced Linux Sound Architecture Utils (alsactl, alsamixer, etc.)"
+HOMEPAGE="http://www.alsa-project.org/"
+SRC_URI="mirror://alsaproject/utils/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0.9"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE="bat doc +libsamplerate +ncurses nls selinux"
+
+CDEPEND=">=media-libs/alsa-lib-${PV}
+ libsamplerate? ( media-libs/libsamplerate )
+ ncurses? ( >=sys-libs/ncurses-5.7-r7:0= )
+ bat? ( sci-libs/fftw:= )"
+DEPEND="${CDEPEND}
+ virtual/pkgconfig
+ doc? ( app-text/xmlto )"
+RDEPEND="${CDEPEND}
+ selinux? ( sec-policy/selinux-alsa )"
+
+src_configure() {
+ local myconf
+ use doc || myconf='--disable-xmlto'
+
+ # --disable-alsaconf because it doesn't work with sys-apps/kmod wrt #456214
+ econf \
+ --disable-maintainer-mode \
+ $(use_enable bat) \
+ $(use_enable libsamplerate alsaloop) \
+ $(use_enable nls) \
+ $(use_enable ncurses alsamixer) \
+ --disable-alsaconf \
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" \
+ --with-udev-rules-dir="${EPREFIX}/$(get_udevdir)"/rules.d \
+ --with-asound-state-dir="${EPREFIX}"/var/lib/alsa \
+ ${myconf}
+}
+
+src_install() {
+ default
+ dodoc seq/*/README.*
+
+ newinitd "${FILESDIR}"/alsasound.initd-r7 alsasound
+ newconfd "${FILESDIR}"/alsasound.confd-r4 alsasound
+
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/alsa-modules.conf-rc alsa.conf
+
+ keepdir /var/lib/alsa
+
+ # ALSA lib parser.c:1266:(uc_mgr_scan_master_configs) error: could not
+ # scan directory /usr/share/alsa/ucm: No such file or directory
+ # alsaucm: unable to obtain card list: No such file or directory
+ keepdir /usr/share/alsa/ucm
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]]; then
+ elog
+ elog "To take advantage of the init script, and automate the process of"
+ elog "saving and restoring sound-card mixer levels you should"
+ elog "add alsasound to the boot runlevel. You can do this as"
+ elog "root like so:"
+ elog "# rc-update add alsasound boot"
+ ewarn
+ ewarn "The ALSA core should be built into the kernel or loaded through other"
+ ewarn "means. There is no longer any modular auto(un)loading in alsa-utils."
+ fi
+}
diff --git a/media-sound/alsa-utils/files/alsa-modules.conf-rc b/media-sound/alsa-utils/files/alsa-modules.conf-rc
new file mode 100644
index 000000000000..40e99df8d3f4
--- /dev/null
+++ b/media-sound/alsa-utils/files/alsa-modules.conf-rc
@@ -0,0 +1,38 @@
+# Alsa kernel modules' configuration file.
+
+# ALSA portion
+alias char-major-116 snd
+# OSS/Free portion
+alias char-major-14 soundcore
+
+##
+## IMPORTANT:
+## You need to customise this section for your specific sound card(s)
+## and then run `update-modules' command.
+## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
+##
+## ALSA portion
+## alias snd-card-0 snd-interwave
+## alias snd-card-1 snd-ens1371
+## OSS/Free portion
+## alias sound-slot-0 snd-card-0
+## alias sound-slot-1 snd-card-1
+##
+
+# OSS/Free portion - card #1
+alias sound-service-0-0 snd-mixer-oss
+alias sound-service-0-1 snd-seq-oss
+alias sound-service-0-3 snd-pcm-oss
+alias sound-service-0-8 snd-seq-oss
+alias sound-service-0-12 snd-pcm-oss
+## OSS/Free portion - card #2
+## alias sound-service-1-0 snd-mixer-oss
+## alias sound-service-1-3 snd-pcm-oss
+## alias sound-service-1-12 snd-pcm-oss
+
+alias /dev/mixer snd-mixer-oss
+alias /dev/dsp snd-pcm-oss
+alias /dev/midi snd-seq-oss
+
+# Set this to the correct number of cards.
+options snd cards_limit=1
diff --git a/media-sound/alsa-utils/files/alsasound.confd-r4 b/media-sound/alsa-utils/files/alsasound.confd-r4
new file mode 100644
index 000000000000..6fec8f5938da
--- /dev/null
+++ b/media-sound/alsa-utils/files/alsasound.confd-r4
@@ -0,0 +1,15 @@
+# RESTORE_ON_START:
+# Do you want to restore your mixer settings? If not, your cards will be
+# muted.
+# no - Do not restore state
+# yes - Restore state
+
+RESTORE_ON_START="yes"
+
+# SAVE_ON_STOP:
+# Do you want to save changes made to your mixer volumes when alsasound
+# stops?
+# no - Do not save state
+# yes - Save state
+
+SAVE_ON_STOP="yes"
diff --git a/media-sound/alsa-utils/files/alsasound.initd-r6 b/media-sound/alsa-utils/files/alsasound.initd-r6
new file mode 100644
index 000000000000..f80a3518f3e2
--- /dev/null
+++ b/media-sound/alsa-utils/files/alsasound.initd-r6
@@ -0,0 +1,87 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+alsastatedir=/var/lib/alsa
+alsascrdir=/etc/alsa.d
+alsahomedir=/var/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
+}
diff --git a/media-sound/alsa-utils/files/alsasound.initd-r7 b/media-sound/alsa-utils/files/alsasound.initd-r7
new file mode 100644
index 000000000000..da2d5b349b82
--- /dev/null
+++ b/media-sound/alsa-utils/files/alsasound.initd-r7
@@ -0,0 +1,87 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+alsastatedir=/var/lib/alsa
+alsascrdir=/etc/alsa.d
+alsahomedir=/var/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
+}
diff --git a/media-sound/alsa-utils/metadata.xml b/media-sound/alsa-utils/metadata.xml
new file mode 100644
index 000000000000..0df2c0a53a87
--- /dev/null
+++ b/media-sound/alsa-utils/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>alsa-bugs@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="bat">install basic audio tester (BAT) util</flag>
+ <flag name="libsamplerate">install utils that use libsamplerate (e.g. alsaloop)</flag>
+ <flag name="ncurses">install utils that use ncurses (e.g. alsamixer)</flag>
+ </use>
+</pkgmetadata>