[Pkg-alsa-devel] init script

Jordi Mallach jordi@debian.org
Fri, 16 Apr 2004 02:34:58 +0200


--2B/JsCI69OhZNC5r
Content-Type: multipart/mixed; boundary="AhhlLboLdkugWU4S"
Content-Disposition: inline


--AhhlLboLdkugWU4S
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hey Psych^WMaintainers ;)

On Thu, Apr 15, 2004 at 07:35:33PM -0400, David B Harris wrote:
> > > So, there you go. We can either not support ordering (in which case
> > > hotplug can blacklist OSS modules and load ALSA modules on its own, in
> > > which case we don't need to do it in alsa-base), or Md changes his
> > > opinion about udev, or we keep the module loading in alsa-base.
> > My workstation has 2 cards, and hotplug actually loads them in the
> > correct order, but that is more than likely due to their order on the
> > PCI bus than anything else.
> >=20
> > I am all for removing the module loading from the init script. If we
> > also remove /etc/alsa/modutils, and the debconfage from
> > alsa-base, we can keep the debconfage in alsa-source, but since the
> > ordering problem for using a select has effectively disappeared, and we
> > can implement it sanely using a multiselect.
> >=20
> > In short, I'm all for removing 80% of the init script. :-)

StevenK and I have been talking about this on IRC again (funny,
ElectricElf leaves IRC for a few days and StevenK comes back. I love you
guys ;)

Just for the record, I'm more and more convinced that we need to get
rid of all module loading code from the init script.

> There is still the ordering question, however. It happened to load them
> in the right order for you now, but that may not be the case in the
> future; nor will it necessarily be the case for everybody, everywhere.

For the card ordering case, isn't it as easy as adding a note to
alsa-source?'s README.Debian stating that if you need this you can just
use /etc/modules with the desired sound modules in the desired order?

> So, assuming we want to support that, somebody needs to figure out how
> to get udev to change ordering and such. You just volunteered, you're
> the only one of us who uses udev ;)

Well, I actually got it installed when I installed gnme-volume-manager
(which doesn't work, but pulled udev in, which did goodness to my /dev
dir -it's small now- although I don't claim I actually "use" it. I just
have it running, apparently).

> Really, guys, it's simple - we can only do away with the init script and
> the crap that is alsa-base debconf if either a) we don't care to support
> card ordering, or b) udev is up to the task. If b), we need to know (and
> soon), and we need to document it.

If you think the /etc/modules alternative is ok, let's go for it. If
it's not, I suggest we just forget about the feature. It's a cool
feature, but it provides enough problems already.

I'm attaching the two mails from Md, the init script and the modules.d
suggestrion.

Good night!
--=20
Jordi Mallach P=E9rez  --  Debian developer     http://www.debian.org/
jordi@sindominio.net     jordi@debian.org     http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/~jordi/

--AhhlLboLdkugWU4S
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <md@Linux.IT>
X-Original-To: jordi@localhost
Delivered-To: jordi@localhost
Received: from localhost (localhost [127.0.0.1])
	by nubol.int.oskuro.net (Postfix) with ESMTP id EF95A70A747
	for <jordi@localhost>; Tue, 13 Apr 2004 23:23:12 +0200 (CEST)
Delivered-To: jordi@sindominio.net
Received: from fanelli.sindominio.net [213.172.61.252]
	by localhost with POP3 (fetchmail-6.2.5)
	for jordi@localhost (single-drop); Tue, 13 Apr 2004 23:23:12 +0200 (CEST)
Received: by fanelli.sindominio.net (Postfix, from userid 612)
	id 02A728FF86; Tue, 13 Apr 2004 23:20:46 +0200 (CEST)
Received: from attila.bofh.it (attila.bofh.it [213.92.8.2])
	(using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits))
	(No client certificate requested)
	by fanelli.sindominio.net (Postfix) with ESMTP id 58D298FFDE
	for <jordi@sindominio.net>; Tue, 13 Apr 2004 23:20:42 +0200 (CEST)
Received: by attila.bofh.it (Postfix, from userid 10)
	id 2A3B75F7E5; Tue, 13 Apr 2004 23:20:41 +0200 (CEST)
Received: by wonderland.linux.it (Postfix, from userid 1001)
	id CC1E81BE82; Tue, 13 Apr 2004 23:20:35 +0200 (CEST)
Date: Tue, 13 Apr 2004 23:20:35 +0200
From: Marco d'Itri <md@Linux.IT>
To: Jordi Mallach <jordi@sindominio.net>
Subject: /etc/init.d/alsa
Message-ID: <20040413212035.GB13309@wonderland.linux.it>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="NDin8bjvE/0mNLFQ"
Content-Disposition: inline
User-Agent: Mutt/1.5.5.1+cvs20040105i
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on nubol.int.oskuro.net
X-Spam-Level: 
X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=2.63


--NDin8bjvE/0mNLFQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

-- 
ciao, |
Marco | [5726 otau1ykXXFMoY]

--NDin8bjvE/0mNLFQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=alsa

#!/bin/sh -e

PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin

# Populate some defaults in case /etc/default/alsa goes for a wander.
alsactl_store_on_shutdown="true"
runlevels_save='[2-5]'

[ "$alsactl_store_on_shutdown" = "true" ] || exit 0

case "$1" in
    start)
	printf "Restoring ALSA mixer settings..."
	if alsactl restore > /dev/null 2>&1; then
	    echo "done."
	else
	    echo "failed:"
	    echo "       You may want to run 'alsactl restore' manually to view any errors."
	    exit 1
	fi
	;;
    stop)
	[ -d /proc/asound ] || exit 0
	if runlevel | grep -E "^$runlevels_save " > /dev/null 2>&1 \
	|| runlevel | grep -E " $runlevels_save\$" > /dev/null 2>&1; then
	    printf "Storing ALSA mixer settings..."
	    if alsactl store > /dev/null 2>&1; then
		sleep 1
		echo "done."
	    else
		echo "failed."
	    fi
	fi
	;;
    restart|reload|force-reload)
	$0 stop && $0 start
	;;
    *)
	echo "Usage: /etc/init.d/alsa {start|stop|restart|reload|force-reload}"
	exit 1
	;;
esac

--NDin8bjvE/0mNLFQ--

--AhhlLboLdkugWU4S
Content-Type: message/rfc822
Content-Disposition: inline

Return-Path: <md@linux.it>
X-Original-To: jordi@localhost
Delivered-To: jordi@localhost
Received: from localhost (localhost [127.0.0.1])
	by nubol.int.oskuro.net (Postfix) with ESMTP id 5E03B70A748
	for <jordi@localhost>; Wed, 14 Apr 2004 15:22:45 +0200 (CEST)
Delivered-To: jordi@sindominio.net
Received: from fanelli.sindominio.net [213.172.61.252]
	by localhost with POP3 (fetchmail-6.2.5)
	for jordi@localhost (single-drop); Wed, 14 Apr 2004 15:22:45 +0200 (CEST)
Received: by fanelli.sindominio.net (Postfix, from userid 612)
	id 184178FD1D; Wed, 14 Apr 2004 15:22:07 +0200 (CEST)
Received: from master.debian.org (master.debian.org [146.82.138.7])
	by fanelli.sindominio.net (Postfix) with ESMTP id 254F68FCC5
	for <jordi@sindominio.net>; Wed, 14 Apr 2004 15:22:05 +0200 (CEST)
Received: from attila.bofh.it [213.92.8.2] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1BDkLE-0001K2-00; Wed, 14 Apr 2004 08:22:12 -0500
Received: by attila.bofh.it (Postfix, from userid 10)
	id 38E6B5F751; Wed, 14 Apr 2004 15:22:13 +0200 (CEST)
Received: by wonderland.linux.it (Postfix, from userid 1001)
	id 1C2391C8B3; Wed, 14 Apr 2004 15:22:04 +0200 (CEST)
Date: Wed, 14 Apr 2004 15:22:04 +0200
From: Marco d'Itri <md@Linux.IT>
To: Jordi Mallach <jordi@debian.org>
Subject: snd-pcm-oss
Message-ID: <20040414132204.GA7688@wonderland.linux.it>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.5.1+cvs20040105i
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on nubol.int.oskuro.net
X-Spam-Level: 
X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=2.63

Yesterday I forgot about this. From the udev README.Debian file:

ALSA OSS devices
~~~~~~~~~~~~~~~~
You need to add something like this in /etc/modprobe.d/ to make modprobe
automatically load the OSS compatibility module.
(snd-mixer-oss is loaded anyway, does anybody know why?)

install snd-pcm /sbin/modprobe --ignore-install snd-pcm && /sbin/modprobe snd-pcm-oss



Can you add this to the modprobe.d file installed by alsa-basa?

-- 
ciao, |
Marco | [5739 cogrYcpY3Tgqc]

--AhhlLboLdkugWU4S--

--2B/JsCI69OhZNC5r
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAfyoyJYSUupF6Il4RAniqAJ4nqS9ZdEpXP6DdK8adL5j6zwmcxACg5jIT
1PuOEWuQojpIKi+yl4yzIqg=
=oRTv
-----END PGP SIGNATURE-----

--2B/JsCI69OhZNC5r--