From eugen@grosbein.pp.ru  Thu Mar  4 10:57:09 2004
Return-Path: <eugen@grosbein.pp.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 76FE516A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Mar 2004 10:57:09 -0800 (PST)
Received: from grosbein.pp.ru (grgw.svzserv.kemerovo.su [213.184.64.130])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6345943D39
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  4 Mar 2004 10:57:08 -0800 (PST)
	(envelope-from eugen@grosbein.pp.ru)
Received: from grosbein.pp.ru (eugen@localhost [127.0.0.1])
	by grosbein.pp.ru (8.12.11/8.12.11) with ESMTP id i24Iv5uR000522
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 5 Mar 2004 01:57:05 +0700 (KRAT)
	(envelope-from eugen@grosbein.pp.ru)
Received: (from eugen@localhost)
	by grosbein.pp.ru (8.12.11/8.12.11/Submit) id i24Iv5D4000521;
	Fri, 5 Mar 2004 01:57:05 +0700 (KRAT)
	(envelope-from eugen)
Message-Id: <200403041857.i24Iv5D4000521@grosbein.pp.ru>
Date: Fri, 5 Mar 2004 01:57:05 +0700 (KRAT)
From: Eugene Grosbein <eugen@grosbein.pp.ru>
Reply-To: Eugene Grosbein <eugen@grosbein.pp.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Line input level of pcm(4)'s mixer should be zero by default
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63771
>Category:       kern
>Synopsis:       Line input level of pcm(4)'s mixer should be zero by default
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    josef
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 04 11:00:29 PST 2004
>Closed-Date:    Sun Jun 20 15:39:40 GMT 2004
>Last-Modified:  Sun Jun 20 15:39:40 GMT 2004
>Originator:     Eugene Grosbein
>Release:        FreeBSD 4.9-STABLE i386
>Organization:
Svyaz Service JSC
>Environment:
System: FreeBSD grosbein.pp.ru 4.9-STABLE FreeBSD 4.9-STABLE #2: Fri Mar 5 01:39:32 KRAT 2004 eu@grosbein.pp.ru:/tmp/obj/usr/local/src/sys/DADV i386
	Yamaha OPL3-SA2 sound card

>Description:
	
	It is convinient to have a source of sound like TV set
	permanently connected to the line input of sound card.

	Unfortunately, device pcm sets level 75 for line input by default,
	and some cards will divert line input to speakers just in a moment
	of card initialization (read: even before single user).

	That is inconvinient in some cases or even unacceptable as there is
	no way for silent startup in such configuration. The solution is
	to make zero default for line input level.

	OTOH, it's easy to turn the level back to non-zero value
	using /usr/local/etc/rc.d/ script, if needed.

>How-To-Repeat:

	Connect audio out of TV set to audio in of Yamaha OPL3-SA2.
	Connect power speakers to it.

	Turn TV set on, boot FreeBSD and try to make it silent at startup.

>Fix:

	Apply this trivial patch.

--- sys/dev/sound/pcm/mixer.c.orig	Fri Mar  5 01:38:59 2004
+++ sys/dev/sound/pcm/mixer.c	Fri Mar  5 01:39:09 2004
@@ -57,7 +57,7 @@
 	[SOUND_MIXER_SYNTH]	= 75,
 	[SOUND_MIXER_PCM]	= 75,
 	[SOUND_MIXER_SPEAKER]	= 75,
-	[SOUND_MIXER_LINE]	= 75,
+	[SOUND_MIXER_LINE]	= 0,
 	[SOUND_MIXER_MIC] 	= 0,
 	[SOUND_MIXER_CD]	= 75,
 	[SOUND_MIXER_LINE1]	= 75,

Eugene Grosbein
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->josef 
Responsible-Changed-By: josef 
Responsible-Changed-When: Tue Jun 15 23:58:01 GMT 2004 
Responsible-Changed-Why:  
I'll handle this one. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63771 
State-Changed-From-To: open->patched 
State-Changed-By: josef 
State-Changed-When: Thu Jun 17 20:44:27 GMT 2004 
State-Changed-Why:  
Hi Eugene! 

I had a conversation with cg (pcm maintainer) and he 
proposed to implement the possibility to set the levels of 
pcm channels via /boot/loader.conf. I wrote a patch[1], 
please test it. 

for example: 
josef@marie~>cat /boot/loader.conf 
pcm0.line=0 
pcm0.mic=23 

results in the following after loading the sound modules: 

marie# mixer 
... 
Mixer line     is currently set to   0:0 
... 
Mixer mic      is currently set to  23:23 
... 

greets, josef 
[1] http://people.freebsd.org/~josef/stuff/mixer.c.diff 


http://www.freebsd.org/cgi/query-pr.cgi?pr=63771 

From: Eugene Grosbein <eugen@grosbein.pp.ru>
To: bug-followup@freebsd.org
Cc: josef@freebsd.org
Subject: Re: kern/63771: Line input level of pcm(4)'s mixer should be zero by default
Date: Sat, 19 Jun 2004 00:44:45 +0800

 Hi!
 
 I've adjusted the patch for my 4.10-STABLE and it works.
 
 Eugene
State-Changed-From-To: patched->closed 
State-Changed-By: josef 
State-Changed-When: Sun Jun 20 15:39:32 GMT 2004 
State-Changed-Why:  
Committed, thanks. 

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