diff options
author | Arcady Genkin <agenkin@gentoo.org> | 2002-04-27 19:22:49 +0000 |
---|---|---|
committer | Arcady Genkin <agenkin@gentoo.org> | 2002-04-27 19:22:49 +0000 |
commit | beb35b6ad2e33546961b14cddf7e7838e6f90c69 (patch) | |
tree | 1cbc423e326e657e29de8a9a792d87b651d90e66 /media-sound/alsa-driver | |
parent | version bump by Olivier Reisch - closes bug 2122 (diff) | |
download | historical-beb35b6ad2e33546961b14cddf7e7838e6f90c69.tar.gz historical-beb35b6ad2e33546961b14cddf7e7838e6f90c69.tar.bz2 historical-beb35b6ad2e33546961b14cddf7e7838e6f90c69.zip |
Did some work on the `alsasound' rc script.
Diffstat (limited to 'media-sound/alsa-driver')
-rw-r--r-- | media-sound/alsa-driver/ChangeLog | 15 | ||||
-rw-r--r-- | media-sound/alsa-driver/alsa-driver-0.9.0_rc1-r2.ebuild | 51 | ||||
-rw-r--r-- | media-sound/alsa-driver/files/alsasound | 134 | ||||
-rw-r--r-- | media-sound/alsa-driver/files/digest-alsa-driver-0.9.0_rc1-r2 | 1 |
4 files changed, 199 insertions, 2 deletions
diff --git a/media-sound/alsa-driver/ChangeLog b/media-sound/alsa-driver/ChangeLog index 4b06b78eef59..4eae5e5fd005 100644 --- a/media-sound/alsa-driver/ChangeLog +++ b/media-sound/alsa-driver/ChangeLog @@ -1,10 +1,21 @@ # ChangeLog for media-sound/alsa-driver # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.4 2002/04/27 08:04:55 agenkin Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/ChangeLog,v 1.5 2002/04/27 19:22:49 agenkin Exp $ *alsa-driver-0.9.0_rc1 (27 Apr 2002) - 17 Feb 2002; Arcady Genkin <agenkin@thpoon.com> + 27 Apr 2002; Arcady Genkin <agenkin@thpoon.com> + alsa-driver-0.9.0_rc1-r2.ebuild : + + Updated the alsasound startup script. + + 27 Apr 2002; Arcady Genkin <agenkin@thpoon.com> + alsa-driver-0.9.0_rc1-r1.ebuild : + + Rewrote the istallation procedures to use the package's native + installation subsystem. + + 27 Apr 2002; Arcady Genkin <agenkin@thpoon.com> alsa-driver-0.9.0_rc1.ebuild : Quick update to version 0.9.0rc1. diff --git a/media-sound/alsa-driver/alsa-driver-0.9.0_rc1-r2.ebuild b/media-sound/alsa-driver/alsa-driver-0.9.0_rc1-r2.ebuild new file mode 100644 index 000000000000..22c9392f9507 --- /dev/null +++ b/media-sound/alsa-driver/alsa-driver-0.9.0_rc1-r2.ebuild @@ -0,0 +1,51 @@ +# Copyright 1999-2001 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Daniel Robbins <drobbins@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-driver/alsa-driver-0.9.0_rc1-r2.ebuild,v 1.1 2002/04/27 19:22:49 agenkin Exp $ + +DESCRIPTION="Advanced Linux Sound Architecture kernel modules" +HOMEPAGE="http://www.alsa-project.org/" + +# By default, drivers for all supported cards will be compiled. +# If you want to only compile for specific card(s), set ALSA_CARDS +# environment variable accordingly +[ x${ALSA_CARDS} = x ] && ALSA_CARDS=all + +SRC_URI="ftp://ftp.alsa-project.org/pub/driver/${P/_rc/rc}.tar.bz2" +S=${WORKDIR}/${P/_rc/rc} + +#virtual/glibc should depend on specific kernel headers +DEPEND="sys-devel/autoconf + virtual/glibc" +PROVIDE="virtual/alsa" + +src_compile() { + ./configure \ + --host=${CHOST} \ + --prefix=/usr \ + --with-kernel="${ROOT}usr/src/linux-${KV}" \ + --with-isapnp=yes \ + --with-sequencer=yes \ + --with-oss=yes \ + --with-cards=${ALSA_CARDS} \ + || die "./configure failed" + + emake || die "Parallel Make Failed" +} + +src_install () { + dodir /usr/include/sound + dodir /etc/init.d + make DESTDIR=${D} install || die + + dodoc CARDS-STATUS COPYING FAQ INSTALL README WARNING TODO doc/* + + insinto /etc/modules.d + doins ${FILESDIR}/alsa + exeinto /etc/init.d + doexe ${FILESDIR}/alsasound +} + +pkg_postinst () { + /usr/sbin/update-modules || return 0 +} diff --git a/media-sound/alsa-driver/files/alsasound b/media-sound/alsa-driver/files/alsasound new file mode 100644 index 000000000000..e003cc276c75 --- /dev/null +++ b/media-sound/alsa-driver/files/alsasound @@ -0,0 +1,134 @@ +#!/sbin/runscript +# +# 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 + + +alsactl=/usr/sbin/alsactl +asoundcfg=/etc/asound.state +aconnect=/usr/bin/aconnect +alsascrdir=/etc/alsa.d + +function start() { + + # Start driver if it isn't already up. + if [ -d /proc/asound ] + then + echo "ALSA driver is already running." + return 1 + fi + + # + # insert all sound modules + # + + drivers=`/sbin/modprobe -c | \ + grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \ + awk '{print $3}'` + for i in $drivers; do + if [ "$i" != off ]; then + echo -n "Starting sound driver: $i " + /sbin/modprobe $i + echo -e "$rc_done" + fi + done + # + # insert sequencer modules + # + if [ x"$START_ALSA_SEQ" = xyes -a -r /proc/asound/seq/drivers ]; then + t=`cut -d , -f 1 /proc/asound/seq/drivers` + if [ "x$t" != "x" ]; then + /sbin/modprobe $t + fi + fi + # + # restore driver settings + # + if [ -d /proc/asound ]; then + if [ ! -r $asoundcfg ]; then + echo "No mixer config in $asoundcfg, you have to unmute your card!" + else + if [ -x $alsactl ]; then + $alsactl -f $asoundcfg restore + else + echo -e "${rc_warning}ERROR: alsactl not found${rc_reset}" + fi + fi + fi + # + # run card-dependent scripts + for i in $drivers; do + t=${i##snd-} + if [ -x $alsascrdir/$t ]; then + $alsascrdir/$t + fi + done +} + +function 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/*` + 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" + alsadevs="/proc/asound/dev/*" + fuser -k $ossdevs $alsadevs 2> /dev/null 1>/dev/null + # + # remove all sequencer connections if any + # + if [ -f /proc/asound/seq/clients -a -x $aconnect ]; then + $aconnect --removeall + fi +} + +function stop() { + + if [ ! -d /proc/asound ] + then + echo "ALSA driver is not loaded." + return 0 + fi + + # Call terminate function first to kill the processes, holding the drivers. + terminate + + # + # store driver settings + # + if [ -x $alsactl ]; then + $alsactl -f $asoundcfg store + else + echo -n -e "${rc_warning}!!!alsactl not found!!!${rc_reset} " + fi + # + # remove all sound modules + # + /sbin/lsmod | grep -E "^snd" | grep -v "snd-rme9652-mem" | while read line; do \ + /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \ + done + # remove the 2.2 soundcore module (if possible) + /sbin/rmmod soundcore 2> /dev/null + /sbin/rmmod gameport 2> /dev/null +} diff --git a/media-sound/alsa-driver/files/digest-alsa-driver-0.9.0_rc1-r2 b/media-sound/alsa-driver/files/digest-alsa-driver-0.9.0_rc1-r2 new file mode 100644 index 000000000000..ab82b0c07726 --- /dev/null +++ b/media-sound/alsa-driver/files/digest-alsa-driver-0.9.0_rc1-r2 @@ -0,0 +1 @@ +MD5 440feeb7a0932a9f40a059fe78b3d6b2 alsa-driver-0.9.0rc1.tar.bz2 1103418 |