From mb@levais.imp.ch  Wed Jun 12 04:59:29 2002
Return-Path: <mb@levais.imp.ch>
Received: from levais.imp.ch (levais.imp.ch [157.161.4.66])
	by hub.freebsd.org (Postfix) with ESMTP id D784937B40A
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Jun 2002 04:59:24 -0700 (PDT)
Received: (from mb@localhost)
	by levais.imp.ch (8.11.6/8.11.5) id g5CC0RG38139;
	Wed, 12 Jun 2002 14:00:27 +0200 (CEST)
	(envelope-from mb)
Message-Id: <200206121200.g5CC0RG38139@levais.imp.ch>
Date: Wed, 12 Jun 2002 14:00:27 +0200 (CEST)
From: Martin Blapp <mbr@freebsd.org>
Reply-To: Martin Blapp <mbr@freebsd.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Save pcm mixer settings during reboot
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         39192
>Category:       conf
>Synopsis:       [PATCH] Save pcm mixer settings during reboot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sound
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 12 05:00:03 PDT 2002
>Closed-Date:    Tue Mar 16 08:01:04 PST 2004
>Last-Modified:  Tue Mar 16 08:01:04 PST 2004
>Originator:     Martin Blapp
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
ImproWare AG
>Environment:
>Description:

	Since I'm to laze to set the mixer settings each time
	I like to watch DVD's, I've made the following patch.
	
	Some tips or a better solution are welcome !

>How-To-Repeat:
>Fix:

Index: rc
===================================================================
RCS file: /home/ncvs/src/etc/rc,v
retrieving revision 1.313
diff -u -r1.313 rc
--- rc	16 May 2002 02:10:03 -0000	1.313
+++ rc	12 Jun 2002 11:52:09 -0000
@@ -801,6 +801,22 @@
 	. /etc/rc.syscons
 fi
 
+if [ -e  /dev/sndstat ]; then
+	if [ -e /var/db/mixer.conf ]; then
+		mixer=`cat /var/db/mixer.conf`
+		counter=1
+ 
+		for value in ${mixer}; do
+			modulo=`expr ${counter} % 2`
+			if [ ${modulo} -eq 0 ]; then
+				mixer ${oldvalue} ${value}
+			fi
+			counter=`expr ${counter} + 1`
+			oldvalue=${value}
+		done
+	fi
+fi
+
 echo -n 'Additional ABI support:'
 
 # Load the SysV IPC API if requested.
Index: rc.shutdown
===================================================================
RCS file: /home/ncvs/src/etc/rc.shutdown,v
retrieving revision 1.22
diff -u -r1.22 rc.shutdown
--- rc.shutdown	18 May 2002 00:26:10 -0000	1.22
+++ rc.shutdown	12 Jun 2002 11:52:10 -0000
@@ -141,6 +141,11 @@
 
 # Insert other shutdown procedures here
 
+if [ -e /dev/sndstat ]; then
+	echo -n 'Saving pcm mixer settings:'
+	mixer -s > /var/db/mixer.conf
+fi
+
 # Saving firewall state tables should be done last
 echo -n 'Saving firewall state tables:'
 
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: Martin Blapp <mbr@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: conf/39192: [PATCH] Save pcm mixer settings during reboot
Date: Wed, 12 Jun 2002 15:05:35 +0300

 On Wed, Jun 12, 2002 at 02:00:27PM +0200, Martin Blapp wrote:
 > 
 > >Number:         39192
 > >Category:       conf
 > >Synopsis:       [PATCH] Save pcm mixer settings during reboot
 > >Originator:     Martin Blapp
 > >Description:
 > 
 > 	Since I'm to laze to set the mixer settings each time
 > 	I like to watch DVD's, I've made the following patch.
 > 	
 > 	Some tips or a better solution are welcome !
 
 Well, PR ports/35028 was committed a while ago, so you could use the
 sysutils/mixer port :)
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 The rest of this sentence is written in Thailand, on

From: Martin Blapp <mb@imp.ch>
To: Peter Pentchev <roam@ringlet.net>
Cc: <bug-followup@FreeBSD.org>
Subject: Re: conf/39192: [PATCH] Save pcm mixer settings during reboot
Date: Wed, 12 Jun 2002 14:13:21 +0200 (CEST)

 Hi,
 
 Why a port for this ? It's in every base system with a sound card.
 And many people like me did not know about sysutils/mixer port.
 
 And it seems that the port doesn't check if mixer is working at all.
 
 Martin
 
 Martin Blapp, <mb@imp.ch> <mbr@FreeBSD.org>
 ------------------------------------------------------------------
 ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH
 Phone: +41 061 826 93 00: +41 61 826 93 01
 PGP: <finger -l mbr@freebsd.org>
 PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E
 ------------------------------------------------------------------
 
 On Wed, 12 Jun 2002, Peter Pentchev wrote:
 
 > On Wed, Jun 12, 2002 at 02:00:27PM +0200, Martin Blapp wrote:
 > >
 > > >Number:         39192
 > > >Category:       conf
 > > >Synopsis:       [PATCH] Save pcm mixer settings during reboot
 > > >Originator:     Martin Blapp
 > > >Description:
 > >
 > > 	Since I'm to laze to set the mixer settings each time
 > > 	I like to watch DVD's, I've made the following patch.
 > >
 > > 	Some tips or a better solution are welcome !
 >
 > Well, PR ports/35028 was committed a while ago, so you could use the
 > sysutils/mixer port :)
 >
 > G'luck,
 > Peter
 >
 > --
 > Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
 > PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 > Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 > The rest of this sentence is written in Thailand, on
 >
 

From: Peter Pentchev <roam@ringlet.net>
To: Martin Blapp <mb@imp.ch>
Cc: bug-followup@FreeBSD.org, Mike Meyer <mwm@mired.org>
Subject: Re: conf/39192: [PATCH] Save pcm mixer settings during reboot
Date: Wed, 12 Jun 2002 15:39:30 +0300

 On Wed, Jun 12, 2002 at 02:13:21PM +0200, Martin Blapp wrote:
 > 
 > Hi,
 > 
 > Why a port for this ? It's in every base system with a sound card.
 > And many people like me did not know about sysutils/mixer port.
 > 
 > And it seems that the port doesn't check if mixer is working at all.
 
 Well, you should actually ask Mike W. Meyer (CC'd) about this; it was
 his PR conf/21722 that originally proposed something quite close to
 yours, and it was his PR ports/35028 that gave rise to the
 sysutils/mixer port after some discussion on -hackers.
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net	roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 This sentence claims to be an Epimenides paradox, but it is lying.

From: Mike Meyer <mwm-dated-1025733051.c7d57b@mired.org>
To: Peter Pentchev <roam@ringlet.net>
Cc: Martin Blapp <mb@imp.ch>, bug-followup@FreeBSD.org
Subject: Re: conf/39192: [PATCH] Save pcm mixer settings during reboot
Date: Fri, 28 Jun 2002 16:50:51 -0500

 In <20020612153930.A91891@straylight.oblivion.bg>, Peter Pentchev <roam@ringlet.net> typed:
 > > Why a port for this ? It's in every base system with a sound card.
 > > And many people like me did not know about sysutils/mixer port.
 
 It's a port because it's easier to get that committed than a patch to
 the base system - which I also submitted.
 
 > > And it seems that the port doesn't check if mixer is working at all.
 
 It also doesn't deal with multiple sound cards. If there's no mixer,
 it really doesn't do any harm. I'm not sure how you would go about
 checking for one in any case. Please feel free to submit fixes for any
 of these problems to me.
 
 	<mike
 --
 Mike Meyer <mwm@mired.org>		http://www.mired.org/consulting.html
 Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Responsible-Changed-From-To: freebsd-bugs->sound 
Responsible-Changed-By: kris 
Responsible-Changed-When: Sun Jul 13 02:52:50 PDT 2003 
Responsible-Changed-Why:  
Assign to sound maintainers 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39192 
State-Changed-From-To: open->closed 
State-Changed-By: jhb 
State-Changed-When: Tue Mar 16 07:57:46 PST 2004 
State-Changed-Why:  
A suitable rc.d script that saves/restores settings for all mixers in the 
system was committed to current and will be in 5.3. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=39192 
>Unformatted:
