From alsa-user-owner@alsa.jcu.cz  Sun Jan 17 22:17:39 1999
Received: from satyr.sylvan.com (IDENT:qmailr@[204.153.195.1])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id WAA06059
	for <alsa-user@alsa.jcu.cz>; Sun, 17 Jan 1999 22:15:13 +0100
Received: (qmail 16164 invoked by uid 500); 17 Jan 1999 21:14:45 -0000
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <13986.21189.379960.12521@satyr.sylvan.com>
Date: Sun, 17 Jan 1999 13:14:45 -0800 (PST)
To: alsa-user@alsa.jcu.cz
Subject: Re: Sound Muted by Default
In-Reply-To: <Pine.LNX.4.04.9901171755120.1331-100000@syrjala.pp.sci.fi>
References: <369FF621.85CDD60F@goodnet.com>
	<Pine.LNX.4.04.9901171755120.1331-100000@syrjala.pp.sci.fi>
From: Kayvan Aghaiepour Sylvan <kayvan@sylvan.com>
Reply-To: alsa-user@alsa.jcu.cz
Sender: alsa-user-owner@alsa.jcu.cz
Precedence: list

>> Folks,
>> 
>> I'm loving Alsa!  I have however but one irritating problem.  As you'll
>> see below, I have pre and post conditions in /etc/conf.modules to store
>> and restore settings using alsactl however, it doesn't work.  Can anyone
>> suggest what may be wrong?

>
>Hi,
>The Kerneld mini-howto states that the post-install option can be used,
>but the pre-remove options doesn't exist. I myself tried the post-install
>option but it didn't work. I think that's because I'm using kmod and not
>kerneld.

I just looked into this.

I tried the following in my /etc/conf.modules:

    post-install snd-interwave /usr/sbin/alsactl restore
    pre-remove snd-interwave /usr/sbin/alsactl store

When I tried it, modprobe complains with the message
"pre-remove snd-interwave failed".

The reason for the failure is simply that alsactl exits with a
nonzeror return status. This patch fixes this bug.

Index: alsactl.c
===================================================================
RCS file: /home/alsa/cvsroot/alsa-utils/alsactl/alsactl.c,v
retrieving revision 1.6
diff -u -u -r1.6 alsactl.c
--- alsactl.c   1998/11/27 15:13:57     1.6
+++ alsactl.c   1999/01/17 21:06:19
@@ -198,8 +198,7 @@
                return 0;
        }
        if (!strcmp(argv[optind], "store")) {
-               return store_setup(argc - optind > 1 ? argv[optind + 1] : NULL) ?
-                   0 : 1;
+               return store_setup(argc - optind > 1 ? argv[optind + 1] : NULL) ;
        } else if (!strcmp(argv[optind], "restore")) {
                return restore_setup(argc - optind > 1 ? argv[optind + 1] : NULL) ?
                    0 : 1;

