diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2009-08-21 15:46:13 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2009-08-21 15:46:13 +0000 |
commit | 00bd6c2b9c15c2cdbe3b30a5f6615c907864482c (patch) | |
tree | fd171f7ec00a808ff1d74054c3d33af3e19df984 /media-sound | |
parent | old (diff) | |
download | gentoo-2-00bd6c2b9c15c2cdbe3b30a5f6615c907864482c.tar.gz gentoo-2-00bd6c2b9c15c2cdbe3b30a5f6615c907864482c.tar.bz2 gentoo-2-00bd6c2b9c15c2cdbe3b30a5f6615c907864482c.zip |
old
(Portage version: 2.2_rc38/cvs/Linux x86_64)
Diffstat (limited to 'media-sound')
-rw-r--r-- | media-sound/alsa-utils/Manifest | 4 | ||||
-rw-r--r-- | media-sound/alsa-utils/files/alsasound-1.0.10_rc2 | 255 | ||||
-rw-r--r-- | media-sound/alsa-utils/files/alsasound-1.0.19.initd | 241 | ||||
-rw-r--r-- | media-sound/alsa-utils/files/alsasound-init-20070218 | 267 | ||||
-rw-r--r-- | media-sound/alsa-utils/files/alsasound.initd-r3 | 218 |
5 files changed, 0 insertions, 985 deletions
diff --git a/media-sound/alsa-utils/Manifest b/media-sound/alsa-utils/Manifest index a73616917c0a..a0adb9e789d3 100644 --- a/media-sound/alsa-utils/Manifest +++ b/media-sound/alsa-utils/Manifest @@ -5,15 +5,11 @@ AUX alsa-utils-1.0.14-alsaconf-modules-update.patch 1337 RMD160 9910bf0845f27960 AUX alsa-utils-1.0.17-seq.patch 1633 RMD160 8363501d3b7a52d95105cf43cb2b9cccf380f112 SHA1 29a69aa7bd8cc08a1d369ff0e16700d5c613a86e SHA256 a9c2df9b16c9907c4388513739db939ffe31a49b61e3c5d93b4b8c1bf3038e78 AUX alsa-utils-1.0.20-init_default.patch 811 RMD160 851dcc7c4b17ae703adc5e1eb82c1ee839d3a3e1 SHA1 8171fc924abdb2a1179d56d2100b5474ddcfd35d SHA256 f10e23e5f8cdb29039cabef9a97804db81841bee245bc632ee9940516640cf1d AUX alsa-utils-1.0.20-modprobe.d.patch 501 RMD160 4b2aa8676fc23b029a66e8a699be5f811c7c932c SHA1 4598144173d13e02be8727e17098c4b0c8fa8bc6 SHA256 f7d3a49f26995118d22c2c06383da59a649030a938dd25911ac074f5bb7a1c3d -AUX alsasound-1.0.10_rc2 7183 RMD160 7c1368905cc0fbe266e840f358a3502bbedb6d9c SHA1 70260ad940df48464a4089f014b73956a690eb3e SHA256 f9f51f35e0fafb87ac9d5f2b48835142e34bcaecc30eb28c92e2af6b16d4c083 AUX alsasound-1.0.19-r1.initd 6868 RMD160 9e7e9ac4a2c2e98def8c1e5498bb6631fd269a9d SHA1 c5a716afde0da422d7d3a3160f5a21024f7ea660 SHA256 b9d53242b7aae9b6517677b65ff4d9412fb347769adc8f9efb7d902b28731130 AUX alsasound-1.0.19.confd 1012 RMD160 42d0abf97bb01236bcfb7f1cf758696844550a84 SHA1 d0b1ae65379cb8f54a9dc1b9bed9229c5cd9c187 SHA256 3740d675d0c403530a71813472332decbfe9620545e4c248511cacd89b85f35b -AUX alsasound-1.0.19.initd 6847 RMD160 9d89c8a441c30e08a9f808ebe1279bc786801803 SHA1 b131425b10e163ebd5c074a24973c689e7299780 SHA256 b9e0c52d5154abf3491728b50a2493b5e490251510eb436a3830e49270d97160 -AUX alsasound-init-20070218 7657 RMD160 283ed673ec6f61c3aac77957393bd84ba05ff8d2 SHA1 16105ee86f8f208526eda4ce8ec6ff6b8206bedf SHA256 0330f7c58719e5669e39224be60bb6c2a1ba09b138801785655ffd245dc9d1e8 AUX alsasound.confd 1052 RMD160 b3a788626e239a844ac71119e887066074be3b30 SHA1 6386e6097629dcd405b61fd950370e610362a712 SHA256 073015ea00ffcbe536fd15258d30d17cdd8cacd6c334f330882d5ed9bdcf83ad AUX alsasound.confd-r3 874 RMD160 2e3ea587fd55757ec26c60a3bb86fcd697f48e67 SHA1 9561a56c1a3a1d0ecdef42655ecc1e2c12340852 SHA256 e5d26a6ea993540ca2d67aee4b40f1351b13f2c8023d53cb67c22cb3707e72de AUX alsasound.initd 6557 RMD160 6e58e7b93619a505f87f8de7fecc6489daf5638f SHA1 fb1c5436e2ddfa191119fb19d439fe43e9f797f1 SHA256 09e54f5e4f75331a1de3af641623edcf4d687b49f23180f8bc14b42fc471acfe -AUX alsasound.initd-r3 6196 RMD160 dc9592ccb23d3707a0269554beb5a35cfdfe6ec2 SHA1 a28c2fbc8a5a44d345cf53c37bc10e1cd066bb01 SHA256 89c5eb6f975bc1ab642a647a1b1c1cd1edd39fe37510d729a4ae4a444ebfe934 AUX alsasound.initd-r4 6231 RMD160 39e28ae5d17c7bb45a1010a9e9a25d79d1b6fc60 SHA1 d68c209ee7b6c04248bfd01ad5bae52fa21aa789 SHA256 b6909ef321a57b586a2cc1f2665c544cf2cfc9b07e3e66592cc649abee57f576 DIST alsa-utils-1.0.17.tar.bz2 1016532 RMD160 6dbc55ffab43a6552bc5032099a071101be467ab SHA1 e71f752b79357fd8ad1c86e4e926cbce19de19d3 SHA256 6a06f457d66eca75ac1ab065e64539e4ccf22ed4e53703a70194cb85203b3125 DIST alsa-utils-1.0.19.tar.bz2 1040697 RMD160 4334c151fb2881aa773297cfc87dd6ddc4f0c7d6 SHA1 7a84764e126188e1951f1db96c5153ba03397541 SHA256 1f4924f5ae7857ce64a3d6ecbeb98133c74ff1ead2b0f48187623d6e4b838cad diff --git a/media-sound/alsa-utils/files/alsasound-1.0.10_rc2 b/media-sound/alsa-utils/files/alsasound-1.0.10_rc2 deleted file mode 100644 index 5403489ebe53..000000000000 --- a/media-sound/alsa-utils/files/alsasound-1.0.10_rc2 +++ /dev/null @@ -1,255 +0,0 @@ -#!/sbin/runscript -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound-1.0.10_rc2,v 1.2 2005/12/15 22:42:46 flameeyes Exp $ -# -# Gentoo users: add this script to 'boot' run level. -# ================================================== -# -# alsasound This shell script takes care of starting and stopping -# the ALSA sound driver. -# -# This script requires /usr/sbin/alsactl and /usr/bin/aconnect programs -# from the alsa-utils package. -# -# Copyright (c) by Jaroslav Kysela <perex@suse.cz> -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -# ChangeLog: -# -# 2003.07.29 - John Mylchreest <johnm@gentoo.org> -# Edited to support Linux kernel 2.5 and above as well as 2.4 -# -# 2004.06.02 - Jeremy Huddleston <eradicator@gentoo.org> -# Rewritten for better support for built-in drivers -# -# 2004.10.29 - Jeremy Huddleston <eradicator@gentoo.org> -# Cleaned up to work better for mixed builtin/module systems -# -# 2004.11.29 - Jeremy Huddleston <eradicator@gentoo.org> -# Added save option thanks to Ben Anderson <roothorick@new.rr.com> -# -# 2005.04.21 - Jeremy Huddleston <eradicator@gentoo.org> -# Added restore option and oss option. -# Cleaned up code to use bash builtins instead of test. - -alsactl=/usr/sbin/alsactl -asoundcfg=/etc/asound.state -aconnect=/usr/bin/aconnect -alsascrdir=/etc/alsa.d - -opts="${opts} save restore" - -depend() { - need bootmisc localmount - after modules isapnp coldplug hotplug -} - -load_modules() { - # List of drivers for each card. - local DRIVERS="$(modprobe -c | grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | awk '{print $2}')" - - # Fall back on the automated aliases if we don't have ALSA configured properly... - if [[ -z "${DRIVERS}" && ! ( -d /proc/asound && -z "$(grep ' no soundcards ' /proc/asound/cards)" ) ]] ; then - ewarn "Could not detect custom ALSA settings. Loading all detected alsa drivers." - DRIVERS="$(modprobe -c | grep pci: | awk '{ print $3 }' | grep snd.* | sort | uniq)" - [[ -z "${DRIVERS}" ]] && eerror "Unable to find any ALSA drivers. Have you compiled alsa-drivers correctly?" - fi - - if [[ ${ENABLE_OSS_EMUL} == "yes" ]] && modprobe -c | grep -q "snd.*oss$" ; then - # Test for use of OSS - local OSS="$(modprobe -l | grep "snd.*oss" | sed -e "s:\/.*\/::" -e "s:\..*::")" - # Add oss modules to list - local i - for i in ${OSS} - do - DRIVERS="${DRIVERS} ${i}" - done - fi - - # We want to ensure snd-seq is loaded as it is needed for things like - # timidity even if we don't use a real sequencer. - DRIVERS="${DRIVERS} $(modprobe -l | grep "snd.seq\." | sed -e "s:\/.*\/::" -e "s:\..*::")" - - # We want to ensure snd-ioctl32 is loaded as it is needed for 32bit - # compatibility - DRIVERS="${DRIVERS} $(modprobe -l | grep "snd.ioctl32\." | sed -e "s:\/.*\/::" -e "s:\..*::")" - - local DRIVER - for DRIVER in ${DRIVERS} - do - if [[ "${DRIVER}" != "off" && - -z $(cut -d' ' -f1 /proc/modules | egrep "^${DRIVER}\$") && - -z $(cut -d' ' -f1 /proc/modules | egrep "^${DRIVER//-/_}\$") ]] ; then - ebegin " Loading: ${DRIVER}" - /sbin/modprobe ${DRIVER} - eend $? - fi - done - - sleep 1 - - if [[ -f /proc/asound/seq/drivers ]] ; then - local SEQUENCERS="$(awk -F, '$2~/^empty$/ {print $1}' /proc/asound/seq/drivers)" - local SEQUENCER - for SEQUENCER in ${SEQUENCERS} - do - if [[ -z $(cut -d' ' -f1 /proc/modules | egrep "^${SEQUENCER}\$") && - -z $(cut -d' ' -f1 /proc/modules | egrep "^${SEQUENCER//-/_}\$") ]] ; then - ebegin " Loading: ${SEQUENCER}" - /sbin/modprobe ${SEQUENCER} - eend $? - fi - done - fi - - for DRIVER in ${DRIVERS} - do - local TMP=${DRIVER##snd-} - TMP=${TMP##snd_} - if [[ -x "${alsascrdir}/${TMP}" ]] ; then - ebegin " Running: ${alsascrdir}/${TMP}" - ${alsascrdir}/${TMP} - eend $? - fi - done - - if [[ ! -d /proc/asound || -n "$(grep ' no soundcards ' /proc/asound/cards)" ]] ; then - eerror "ERROR: Failed to load necessary drivers" - fi -} - -unload_modules() { - local LOADED_MODULES="$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')" - local MODULE - for MODULE in ${LOADED_MODULES} - do - /sbin/rmmod ${MODULE} >& /dev/null - done - /sbin/rmmod soundcore >& /dev/null - /sbin/rmmod gameport >& /dev/null - - # Return success if the modules are unloaded - [[ -z "$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')" ]] -} - -terminate() { - # - # Kill processes holding open sound devices - # - # DEVS=`find /dev/ -follow -type c -maxdepth 1 -print 2>/dev/null | xargs ls -dils | grep "1*1[46]," | cut -d: -f2 | cut -d" " -f2; echo /proc/asound/dev/*` - local ossdevs="/dev/admmidi? /dev/adsp? /dev/amidi? /dev/audio* /dev/dmfm* \ - /dev/dmmidi? /dev/dsp* /dev/dspW* /dev/midi0? /dev/mixer? /dev/music \ - /dev/patmgr? /dev/sequencer* /dev/sndstat" - local alsadevs="/proc/asound/dev/* /dev/sound/* /dev/snd/*" - fuser -k ${ossdevs} ${alsadevs} >& /dev/null - - # - # remove all sequencer connections if any - # - [[ -f /proc/asound/seq/clients && -x ${aconnect} ]] && ${aconnect} --removeall -} - -restore_mixer() { - if [[ ${RESTORE_ON_START} == "no" ]] ; then - return 0 - fi - - restore -} - -restore() { - ebegin "Restoring Mixer Levels" - - local val=0 - - if [[ ! -r ${asoundcfg} ]] ; then - ewarn "No mixer config in ${asoundcfg}, you have to unmute your card!" - elif [[ -x ${alsactl} ]] ; then - local CARDS="$(cat /proc/asound/cards | awk '/: / { print $1 }')" - local CARDNUM - for CARDNUM in ${CARDS} - do - [[ -e /dev/snd/controlC0 ]] || sleep 2 - [[ -e /dev/snd/controlC0 ]] || sleep 2 - [[ -e /dev/snd/controlC0 ]] || sleep 2 - [[ -e /dev/snd/controlC0 ]] || sleep 2 - ${alsactl} -f ${asoundcfg} restore ${CARDNUM} || ewarn "Errors while restoring defaults, ignoring" - done - else - eerror -e "ERROR: Cannot find alsactl, did you forget to install media-sound/alsa-utils?" - val=1 - fi - - eend ${val} - return ${val} -} - -save() { - ebegin "Storing ALSA Mixer Levels" - - local val=0 - - if [[ -x ${alsactl} ]] ; then - ${alsactl} -f ${asoundcfg} store - val=$? - else - eerror -e "ERROR: Cannot find alsactl." - val=1 - fi - - eend ${val} - return ${val} -} - -start() { - if [[ -f /proc/modules ]] ; then - ebegin "Loading ALSA modules" - if load_modules ; then - eend 0 - else - eend 1 - return 1 - fi - fi - - if [[ ${RESTORE_ON_START} == "yes" ]]; then - restore_mixer - fi -} - -stop() { - if [[ ! -d /proc/asound ]] ; then - eerror "ALSA is not loaded" - return 0 - fi - - if [[ ${SAVE_ON_STOP} == "yes" ]]; then - save - fi - - ebegin "Unloading ALSA" - terminate - eend 0 - - if [[ -f /proc/modules ]]; then - ebegin "Unloading ALSA modules" - if unload_modules; then - eend 0 - else - eend 1 - fi - fi -} diff --git a/media-sound/alsa-utils/files/alsasound-1.0.19.initd b/media-sound/alsa-utils/files/alsasound-1.0.19.initd deleted file mode 100644 index 90bd11f0dfc9..000000000000 --- a/media-sound/alsa-utils/files/alsasound-1.0.19.initd +++ /dev/null @@ -1,241 +0,0 @@ -#!/sbin/runscript -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound-1.0.19.initd,v 1.1 2009/01/19 17:21:11 chainsaw Exp $ -# Copyright 2007,2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -alsastatedir=/var/lib/alsa -alsascrdir=/etc/alsa.d - -opts="save restore" - -depend() { - need localmount - after bootmisc modules isapnp coldplug hotplug -} - -load_modules() { - # List of drivers for each card. - local DRIVERS="$(modprobe -c | sed -n -e 's/^alias \(snd-card-[[:digit:]]\+\) .*/\1/p')" - - # Fall back on the automated aliases if we don't have ALSA configured properly... - if [ -z "${DRIVERS}" ] && \ - ( [ ! -r /proc/asound/cards ] || grep -q ' no soundcards ' /proc/asound/cards 2>/dev/null ) ; then - ewarn "Could not detect custom ALSA settings. Loading all detected alsa drivers." - DRIVERS="$(modprobe -c | sed -n -e '/^alias pci:.* snd.*/ s/^alias pci:[^ ]* \(.*\)/\1/p' | sort | uniq)" - if [ -z "${DRIVERS}" ] ; then - eerror "Unable to find any ALSA drivers. Have you configured your kernel correctly?" - fi - fi - - if [ "${ENABLE_OSS_EMUL}" = "yes" ] ; then - DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.*oss/ s:\/.*\/\(.*\).ko:\1:p')" - fi - - # We want to ensure snd-seq is loaded as it is needed for things like - # timidity even if we don't use a real sequencer. - DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.seq\./ s:\/.*\/\(.*\).ko:\1:p')" - - # We want to ensure snd-ioctl32 is loaded as it is needed for 32bit - # compatibility - DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.ioctl32\./ s:\/.*\/\(.*\).ko:\1:p')" - - local DRIVER= DMOD= - for DRIVER in ${DRIVERS} ; do - [ "${DRIVER}" = "off" ] && continue - DMOD="$(echo "${DRIVER}" | sed -e 's/-/_/g')" - if ! grep -q "^${DMOD} " /proc/modules ; then - ebegin "Loading: ${DRIVER}" - modprobe ${DRIVER} - eend $? - fi - done - - if [ -f /proc/asound/seq/drivers ] ; then - local SEQUENCERS="$(sed -n -e 's/\([^,]*\),empty,.*/\1/p' /proc/asound/seq/drivers)" - local SEQUENCER - for SEQUENCER in ${SEQUENCERS} ; do - DMOD="$(echo "${SEQUENCER}" | sed -e 's/-/_/g')" - if ! grep -q "^${DMOD} " /proc/modules ; then - ebegin "Loading: ${SEQUENCER}" - modprobe ${SEQUENCER} - eend $? - fi - done - fi - - for DRIVER in ${DRIVERS} - do - local TMP=${DRIVER##snd-} - TMP=${TMP##snd_} - if [ -x "${alsascrdir}/${TMP}" ] ; then - ebegin "Running: ${alsascrdir}/${TMP}" - "${alsascrdir}/${TMP}" - eend $? - fi - done - - if [ ! -d /proc/asound ] || grep -q ' no soundcards ' /proc/asound/cards ; then - eerror "ERROR: Failed to load necessary drivers" - return 1 - fi -} - -unload_modules_24() { - local LOADED_MODULES="$(lsmod | sed -n -e 's/^\(snd[^ ]*\) .*/\1/p')" - local MODULE - for MODULE in ${LOADED_MODULES} ; do - rmmod "${MODULE}" - done - rmmod soundcore 2>/dev/null - rmmod gameport 2>/dev/null - - lsmod | grep -vq '^snd' -} - -unload_modules_recursive() { - local revdeps="$(lsmod | sed -n -e "s/,/ /g" -e "s/^$1 *[0-9]* *[0-9]* \(.*\)/\1/p")" - - for module in ${revdeps} ; do - unload_modules_recursive "${module}" - done - - vebegin "Unloading: $1" - rmmod --wait "$1" - veend $? -} - -unload_modules_26() { - # First of all, remove the snd module and all the modules depending - # on it, this should remove already most of ALSA modules. - lsmod | grep -q "^snd[[:space:]]" && unload_modules_recursive snd - - # Then find the remaining ones, and handle them too. - for module in $(lsmod | sed -n -e 's/^\(snd[^ ]*\) .*/\1/p'); do - unload_modules_recursive "${module}" - done - - lsmod | grep -vq "^snd" -} - -terminate() { - # - # Kill processes holding open sound devices - # - # DEVS=`find /dev/ -follow -type c -maxdepth 1 -print 2>/dev/null | xargs ls -dils | grep "1*1[46]," | cut -d: -f2 | cut -d" " -f2; echo /proc/asound/dev/*` - local ossdevs="/dev/admmidi* /dev/adsp* /dev/amidi* /dev/audio* /dev/dmfm* \ - /dev/dmmidi* /dev/dsp* /dev/dspW* /dev/midi0* /dev/mixer* /dev/music \ - /dev/patmgr* /dev/sequencer* /dev/sndstat" - local alsadevs="/proc/asound/dev/* /dev/sound/* /dev/snd/*" - fuser -k ${ossdevs} ${alsadevs} >/dev/null 2>/dev/null - - # remove all sequencer connections if any - [ -f /proc/asound/seq/clients ] && type aconnect >/dev/null 2>/dev/null && aconnect --removeall -} - -restore() { - ebegin "Restoring Mixer Levels" - - 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 -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" - - mkdir -p "${alsastatedir}" - if ! alsactl -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 [ -f /proc/modules ] && [ "${LOAD_ON_START}" = "yes" ]; then - ebegin "Loading ALSA modules" - eindent - load_modules - eoutdent - eend $? || return 1 - fi - - if [ ! -d /proc/asound ]; then - eerror "ALSA failed to load." - eend 1 - return 1 - elif [ "${RESTORE_ON_START}" = "yes" ]; then - restore - fi - - return 0 -} - -stop() { - if [ ! -d /proc/asound ] ; then - eerror "ALSA is not loaded" - return 0 - fi - - [ "${SAVE_ON_STOP}" = "yes" ] && save - - if [ "${KILLPROC_ON_STOP}" = "yes" ] ; then - ewarn "You are using the unsupported KILLPROC_ON_STOP option." - ewarn "Consider unsetting it. Do not file bugs until you have done so." - ebegin "Killing processes using ALSA" - terminate - eend 0 - fi - - if [ -f /proc/modules ] && [ "${UNLOAD_ON_STOP}" = "yes" ]; then - ewarn "You are using the unsupported UNLOAD_ON_STOP option." - ewarn "Consider unsetting it. Do not file bugs until you have done so." - local ver="26" - case "$(uname -r)" in - 2.[01234].*) ver="24";; - *) ver="26";; - esac - ebegin "Unloading ALSA modules" - eindent - unload_modules_${ver} - eend $? - eoutdent - fi - - return 0 -} diff --git a/media-sound/alsa-utils/files/alsasound-init-20070218 b/media-sound/alsa-utils/files/alsasound-init-20070218 deleted file mode 100644 index 57be91eaa57b..000000000000 --- a/media-sound/alsa-utils/files/alsasound-init-20070218 +++ /dev/null @@ -1,267 +0,0 @@ -#!/sbin/runscript -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound-init-20070218,v 1.3 2007/02/18 14:00:58 flameeyes Exp $ -# -# Gentoo users: add this script to 'boot' run level. -# ================================================== -# -# alsasound This shell script takes care of starting and stopping -# the ALSA sound driver. -# -# Copyright (c) by Jaroslav Kysela <perex@suse.cz> -# -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -alsastatedir=/var/lib/alsa -alsascrdir=/etc/alsa.d - -opts="${opts} save restore" - -depend() { - need bootmisc localmount - after modules isapnp coldplug hotplug -} - -load_modules() { - # List of drivers for each card. - local DRIVERS="$(modprobe -c | grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | awk '{print $2}')" - - # Fall back on the automated aliases if we don't have ALSA configured properly... - if [[ -z "${DRIVERS}" && ! ( -d /proc/asound && -z "$(grep ' no soundcards ' /proc/asound/cards)" ) ]] ; then - ewarn "Could not detect custom ALSA settings. Loading all detected alsa drivers." - DRIVERS="$(modprobe -c | grep pci: | awk '{ print $3 }' | grep snd.* | sort | uniq)" - [[ -z "${DRIVERS}" ]] && eerror "Unable to find any ALSA drivers. Have you compiled alsa-drivers correctly?" - fi - - if [[ ${ENABLE_OSS_EMUL} == "yes" ]] && modprobe -c | grep -q "snd.*oss$" ; then - # Test for use of OSS - local OSS="$(modprobe -l | grep "snd.*oss" | sed -e "s:\/.*\/::" -e "s:\..*::")" - # Add oss modules to list - local i - for i in ${OSS} - do - DRIVERS="${DRIVERS} ${i}" - done - fi - - # We want to ensure snd-seq is loaded as it is needed for things like - # timidity even if we don't use a real sequencer. - DRIVERS="${DRIVERS} $(modprobe -l | grep "snd.seq\." | sed -e "s:\/.*\/::" -e "s:\..*::")" - - # We want to ensure snd-ioctl32 is loaded as it is needed for 32bit - # compatibility - DRIVERS="${DRIVERS} $(modprobe -l | grep "snd.ioctl32\." | sed -e "s:\/.*\/::" -e "s:\..*::")" - - local DRIVER - for DRIVER in ${DRIVERS} - do - if [[ "${DRIVER}" != "off" && - -z $(cut -d' ' -f1 /proc/modules | egrep "^${DRIVER}\$") && - -z $(cut -d' ' -f1 /proc/modules | egrep "^${DRIVER//-/_}\$") ]] ; then - ebegin " Loading: ${DRIVER}" - /sbin/modprobe ${DRIVER} - eend $? - fi - done - - sleep 1 - - if [[ -f /proc/asound/seq/drivers ]] ; then - local SEQUENCERS="$(awk -F, '$2~/^empty$/ {print $1}' /proc/asound/seq/drivers)" - local SEQUENCER - for SEQUENCER in ${SEQUENCERS} - do - if [[ -z $(cut -d' ' -f1 /proc/modules | egrep "^${SEQUENCER}\$") && - -z $(cut -d' ' -f1 /proc/modules | egrep "^${SEQUENCER//-/_}\$") ]] ; then - ebegin " Loading: ${SEQUENCER}" - /sbin/modprobe ${SEQUENCER} - eend $? - fi - done - fi - - for DRIVER in ${DRIVERS} - do - local TMP=${DRIVER##snd-} - TMP=${TMP##snd_} - if [[ -x "${alsascrdir}/${TMP}" ]] ; then - ebegin " Running: ${alsascrdir}/${TMP}" - ${alsascrdir}/${TMP} - eend $? - fi - done - - if [[ ! -d /proc/asound || -n "$(grep ' no soundcards ' /proc/asound/cards)" ]] ; then - eerror "ERROR: Failed to load necessary drivers" - return 1 - fi -} - -unload_modules_24() { - local LOADED_MODULES="$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')" - local MODULE - for MODULE in ${LOADED_MODULES} - do - /sbin/rmmod ${MODULE} >& /dev/null - done - /sbin/rmmod soundcore >& /dev/null - /sbin/rmmod gameport >& /dev/null - - # Return success if the modules are unloaded - [[ -z "$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')" ]] -} - -unload_modules_recursive() { - local revdeps=$(/sbin/lsmod | egrep "^$1\>" | awk '{ print $4 }') - - for module in ${revdeps//,/ }; do - unload_modules_recursive "${module}" - done - - /sbin/rmmod --wait "$1" -} - -unload_modules_26() { - # First of all, remove the snd module and all the modules depending - # on it, this should remove already most of ALSA modules. - unload_modules_recursive snd - - # Then find the remaining ones, and handle them too. - for module in $(lsmod | egrep '^snd' | awk '{ print $1 }'); do - unload_modules_recursive "${module}" - done - - if lsmod | egrep -q '^snd'; then - return 1 - else - return 0; - fi -} - -terminate() { - # - # Kill processes holding open sound devices - # - # DEVS=`find /dev/ -follow -type c -maxdepth 1 -print 2>/dev/null | xargs ls -dils | grep "1*1[46]," | cut -d: -f2 | cut -d" " -f2; echo /proc/asound/dev/*` - local ossdevs="/dev/admmidi? /dev/adsp? /dev/amidi? /dev/audio* /dev/dmfm* \ - /dev/dmmidi? /dev/dsp* /dev/dspW* /dev/midi0? /dev/mixer? /dev/music \ - /dev/patmgr? /dev/sequencer* /dev/sndstat" - local alsadevs="/proc/asound/dev/* /dev/sound/* /dev/snd/*" - fuser -k ${ossdevs} ${alsadevs} >& /dev/null - - # remove all sequencer connections if any - [[ -f /proc/asound/seq/clients && -n $(type -p aconnect) ]] && aconnect --removeall -} - -restore() { - ebegin "Restoring Mixer Levels" - - 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="$( awk '/: / { print $1 }' /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 -f "${alsastatedir}/asound.state" restore ${cardnum} \ - || ewarn "Errors while restoring defaults, ignoring" - done - - push_opts=$(shopt -p nullglob); shopt -s nullglob - for ossfile in "${alsastatedir}"/oss/card?_pcm??; do - # We use cat because I'm not sure if cp works properly on /proc - local procfile=${ossfile##${alsastatedir}/oss} - cat "${ossfile}" > /proc/asound/${procfile/_/\/}/oss - done - eval $push_opts - - eend 0 -} - -save() { - ebegin "Storing ALSA Mixer Levels" - - mkdir -p "${alsastatedir}" - if ! alsactl -f "${alsastatedir}/asound.state" store; then - eerror "Error saving levels." - - eend 1 - return 1 - fi - - push_opts=$(shopt -p nullglob); shopt -s nullglob - for ossfile in /proc/asound/card?/pcm??/oss; do - local device=${ossfile##/proc/asound/}; device=${device%%/oss}; device=${device/\//_} - - mkdir -p "${alsastatedir}/oss/" - cp "${ossfile}" "${alsastatedir}/oss/${device}" - done - eval $push_opts - - eend 0 -} - -start() { - if [[ -f /proc/modules ]] ; then - ebegin "Loading ALSA modules" - if load_modules ; then - eend 0 - else - eend 1 - return 1 - fi - fi - - if [[ ! -d /proc/asound ]]; then - eerror "ALSA failed to load." - eend 1 - return 1 - fi - - [[ ${RESTORE_ON_START} == "yes" ]] && restore -} - -stop() { - if [[ ! -d /proc/asound ]] ; then - eerror "ALSA is not loaded" - return 0 - fi - - [[ ${SAVE_ON_STOP} == "yes" ]] && save - - ebegin "Killing processes using ALSA" - terminate - eend 0 - - if [[ -f /proc/modules ]]; then - local ver # used to carry the version of kernel used, - # and then to execute the right function. - /sbin/rmmod --version | grep -q module-init-tools \ - && ver="26" || ver="24" - - ebegin "Unloading ALSA modules" - if unload_modules_${ver}; then - eend 0 - else - eend 1 - fi - fi -} diff --git a/media-sound/alsa-utils/files/alsasound.initd-r3 b/media-sound/alsa-utils/files/alsasound.initd-r3 deleted file mode 100644 index a9c63234a10a..000000000000 --- a/media-sound/alsa-utils/files/alsasound.initd-r3 +++ /dev/null @@ -1,218 +0,0 @@ -#!/sbin/runscript -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound.initd-r3,v 1.1 2009/07/31 21:49:39 beandog Exp $ -# Copyright 2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -alsastatedir=/var/lib/alsa -alsascrdir=/etc/alsa.d - -opts="save restore" - -depend() { - need localmount - after bootmisc modules isapnp coldplug hotplug -} - -load_modules() { - # List of drivers for each card. - local DRIVERS="$(modprobe -c | sed -n -e 's/^alias \(snd-card-[[:digit:]]\+\) .*/\1/p')" - - # Fall back on the automated aliases if we don't have ALSA configured properly... - if [ -z "${DRIVERS}" ] && \ - ( [ ! -r /proc/asound/cards ] || grep -q ' no soundcards ' /proc/asound/cards 2>/dev/null ) ; then - ewarn "Could not detect custom ALSA settings. Loading all detected alsa drivers." - DRIVERS="$(modprobe -c | sed -n -e '/^alias pci:.* snd.*/ s/^alias pci:[^ ]* \(.*\)/\1/p' | sort | uniq)" - if [ -z "${DRIVERS}" ] ; then - eerror "Unable to find any ALSA drivers. Have you compiled alsa-drivers correctly?" - fi - fi - - if [ "${ENABLE_OSS_EMUL}" = "yes" ] ; then - DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.*oss/ s:\/.*\/\(.*\).ko:\1:p')" - fi - - # We want to ensure snd-seq is loaded as it is needed for things like - # timidity even if we don't use a real sequencer. - DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.seq\./ s:\/.*\/\(.*\).ko:\1:p')" - - # We want to ensure snd-ioctl32 is loaded as it is needed for 32bit - # compatibility - DRIVERS="${DRIVERS} $(modprobe -l | sed -n -e '/snd.ioctl32\./ s:\/.*\/\(.*\).ko:\1:p')" - - local DRIVER= DMOD= - for DRIVER in ${DRIVERS} ; do - [ "${DRIVER}" = "off" ] && continue - DMOD="$(echo "${DRIVER}" | sed -e 's/-/_/g')" - if ! grep -q "^${DMOD} " /proc/modules ; then - ebegin "Loading: ${DRIVER}" - modprobe ${DRIVER} - eend $? - fi - done - - if [ -f /proc/asound/seq/drivers ] ; then - local SEQUENCERS="$(sed -n -e 's/\([^,]*\),empty,.*/\1/p' /proc/asound/seq/drivers)" - local SEQUENCER - for SEQUENCER in ${SEQUENCERS} ; do - DMOD="$(echo "${SEQUENCER}" | sed -e 's/-/_/g')" - if ! grep -q "^${DMOD} " /proc/modules ; then - ebegin "Loading: ${SEQUENCER}" - modprobe ${SEQUENCER} - eend $? - fi - done - fi - - for DRIVER in ${DRIVERS} - do - local TMP=${DRIVER##snd-} - TMP=${TMP##snd_} - if [ -x "${alsascrdir}/${TMP}" ] ; then - ebegin "Running: ${alsascrdir}/${TMP}" - "${alsascrdir}/${TMP}" - eend $? - fi - done - - if [ ! -d /proc/asound ] || grep -q ' no soundcards ' /proc/asound/cards ; then - eerror "ERROR: Failed to load necessary drivers" - return 1 - fi -} - -unload_modules_24() { - local LOADED_MODULES="$(lsmod | sed -n -e 's/^\(snd[^ ]*\) .*/\1/p')" - local MODULE - for MODULE in ${LOADED_MODULES} ; do - rmmod "${MODULE}" - done - rmmod soundcore 2>/dev/null - rmmod gameport 2>/dev/null - - lsmod | grep -vq '^snd' -} - -unload_modules_recursive() { - local revdeps="$(lsmod | sed -n -e "s/,/ /g" -e "s/^$1 *[0-9]* *[0-9]* \(.*\)/\1/p")" - - for module in ${revdeps} ; do - unload_modules_recursive "${module}" - done - - vebegin "Unloading: $1" - rmmod --wait "$1" - veend $? -} - -unload_modules_26() { - # First of all, remove the snd module and all the modules depending - # on it, this should remove already most of ALSA modules. - lsmod | grep -q "^snd[[:space:]]" && unload_modules_recursive snd - - # Then find the remaining ones, and handle them too. - for module in $(lsmod | sed -n -e 's/^\(snd[^ ]*\) .*/\1/p'); do - unload_modules_recursive "${module}" - done - - lsmod | grep -vq "^snd" -} - -terminate() { - # - # Kill processes holding open sound devices - # - # DEVS=`find /dev/ -follow -type c -maxdepth 1 -print 2>/dev/null | xargs ls -dils | grep "1*1[46]," | cut -d: -f2 | cut -d" " -f2; echo /proc/asound/dev/*` - local ossdevs="/dev/admmidi* /dev/adsp* /dev/amidi* /dev/audio* /dev/dmfm* \ - /dev/dmmidi* /dev/dsp* /dev/dspW* /dev/midi0* /dev/mixer* /dev/music \ - /dev/patmgr* /dev/sequencer* /dev/sndstat" - local alsadevs="/proc/asound/dev/* /dev/sound/* /dev/snd/*" - fuser -k ${ossdevs} ${alsadevs} >/dev/null 2>/dev/null - - # remove all sequencer connections if any - [ -f /proc/asound/seq/clients ] && type aconnect >/dev/null 2>/dev/null && aconnect --removeall -} - -restore() { - ebegin "Restoring Mixer Levels" - - 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 -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" - - mkdir -p "${alsastatedir}" - if ! alsactl -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 [ -f /proc/modules ] && [ "${LOAD_ON_START}" = "yes" ]; then - ebegin "Loading ALSA modules" - eindent - load_modules - eoutdent - eend $? || return 1 - fi - - if [ ! -d /proc/asound ]; then - eerror "ALSA failed to load." - eend 1 - return 1 - elif [ "${RESTORE_ON_START}" = "yes" ]; then - restore - fi - - return 0 -} - -stop() { - if [ ! -d /proc/asound ] ; then - eerror "ALSA is not loaded" - return 0 - fi - - [ "${SAVE_ON_STOP}" = "yes" ] && save - - return 0 -} |