NetBSD Problem Report #10221

Received: (qmail 8635 invoked from network); 29 May 2000 05:26:44 -0000
Message-Id: <20000528222614.A1382@redback.com>
Date: Sun, 28 May 2000 22:26:14 -0700
From: Tom Spindler <dogcow@redback.com>
Reply-To: dogcow@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: audioctl -w play.gain=xxx no longer works
X-Send-Pr-Version: 3.95

>Number:         10221
>Category:       kern
>Synopsis:       audioctl -w play.gain=xxx no longer works
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    fredb
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 29 05:27:00 +0000 2000
>Closed-Date:    Thu Feb 05 11:37:15 +0000 2004
>Last-Modified:  Thu Feb 05 11:37:15 +0000 2004
>Originator:     Tom Spindler
>Release:        20000527
>Organization:

>Environment:

System: NetBSD beefcake.biff.net 1.4Z NetBSD 1.4Z (DOGCOW) #6: Sun May 28 19:20:
18 PDT 2000 dogcow@beefcake.biff.net:/big/dc/current/src/src/sys/arch/i386/compi
le/DOGCOW i386


>Description:
You could formerly set the volume of your audio device by doing
audioctl -w play.gain=160
but this no longer works. The sound plays just fine, though.
In fact, none of the audioctl or mixerctl vars seem to work.

sb1 at isapnp0 port 0x220/16,0x330/2,0x388/4 irq 5 drq 1,5
sb1: Creative SB AWE64  PnP Audio: dsp v4.16
audio0 at sb1: full duplex, mmap, independent
mpu0 at sb1
opl0 at sb1: model OPL3

>How-To-Repeat:
p3 root@beefcake: /usr/local/home/dogcow 2506 % audioctl -w play.gain=190
play.gain: -> 127
p3 root@beefcake: /usr/local/home/dogcow 2507 % audioctl -a | grep play.gain
play.gain=127
>Fix:

unknown. None of the audioctl vars seem settable now.

>Release-Note:
>Audit-Trail:

From: Daniel Carosone <dan@geek.com.au>
To: dogcow@redback.com
Cc: gnats-bugs@gnats.netbsd.org
Subject: kern/10221: audioctl -w play.gain=xxx no longer works
Date: Mon, 29 May 2000 16:24:46 +1000 (EST)

 "me too"

 I just installed an fms card into my alpha:


 NetBSD anarres 1.4Y NetBSD 1.4Y (_anarres_) #19: Wed May 24 20:27:44 EST 2000
 dan@anarres:/home/NetBSD/src/sys/arch/alpha/compile/_anarres_ alpha

 fms0 at pci0 dev 5 function 0: Forte Media FM-801
 fms0: interrupting at eb164 irq 2
 fms0: SigmaTel STAC9704 codec; 18 bit DAC, 18 bit ADC, Rockwell 3D
 audio0 at fms0: full duplex, mmap, independent
 opl0 at fms0: model OPL3
 midi at opl0 not configured
 mpu0 at fms0
 midi at mpu0 not configured
 Forte Media product 0x0802 (miscellaneous input, revision 0xb2) at
 pci0 dev 5 function 1 not configured

 (I'm not worried about the unconfigured midi, I doubt it is relevant;
 the device at function 1 is a joystick, also not what I'm worried
 about).

 I notice that I can't set the play.gain levels; they're set at 127 and
 won't move.  I assumed this might be a "feature" since I can set the
 playback volume through mixerctl (inputs.dac and outputs.master).

 However,there's another setting I cannot change: outputs.tone=255,255
 The sound is very "tinny" and I suspect this is the problem, but it
 won't allow itself to be moved from this setting.

 --
 Dan.
State-Changed-From-To: open->analyzed 
State-Changed-By: fredb 
State-Changed-When: Tue Dec 23 19:36:39 CST 2003 
State-Changed-Why:  

The correct fix is non-trivial, involving incorrect assumptions that 
the MI layer makes about the underlying hardware. 



Responsible-Changed-From-To: kern-bug-people->fredb 
Responsible-Changed-By: fredb 
Responsible-Changed-When: Tue Dec 23 19:36:39 CST 2003 
Responsible-Changed-Why:  

I've posted a fix for review to 

ftp://ftp.netbsd.org/pub/NetBSD/misc/fredb/audio-volume-control.diff 
ftp://ftp.netbsd.org/pub/NetBSD/misc/fredb/audio-volume-control-1-6.diff 

the later being a pull-up to the netbsd-1-6 branch, for the 
convenience of would-be testers. 


From: Frederick Bruckman <fredb@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/10221 CVS commit: src
Date: Sat, 31 Jan 2004 00:07:56 +0000 (UTC)

 Module Name:	src
 Committed By:	fredb
 Date:		Sat Jan 31 00:07:56 UTC 2004

 Modified Files:
 	src/share/man/man4: audio.4
 	src/share/man/man9: audio.9
 	src/sys/dev: audio.c audiovar.h

 Log Message:
 Fix a couple of long-standing bugs in the volume control(s) part of the
 audio device interface:

 1) When attempting to match the appropriate mixer control, we weren't
 checking the class label, but only the second level label, so for
 devices that had both an "inputs.cd" and a "record.cd", for example,
 we could never do the right thing except by chance. For this reason,
 evidently, all the record masters were labeled (by the underlying
 drivers) either "record.record" or "record.volume", to distinguish
 from "outputs.master". We'll now accept "record.master", and document
 that as the the new preferred way.

 2) More importantly, the model was deficient. Selecting a port on many
 chips completely disables most of the level controls, which doesn't play
 nice with other applications which are trying to use the interface. Now,
 selecting a port simply sets which mixer input control shall be changed,
 setting state in the audio layer. In other words, the "mixerout" port
 is really selected all the time, enabling the final stage mixer, and
 setting "gain" sets the level of the appropriate input. It should be
 possible for separate applications to each control the mic, dac, and cd
 inputs at the same time using this interface, simply by reiterating their
 port selections with each change, but applications that don't bother to
 do that aren't any worse off than they were before.

 The user is expected to set the master output with another application,
 dedicated to that task. Though it is now meaningful to select "no port"
 with the audio device interface, to manipulate the master output, there's
 no particular reason for an audio device consumer to do that. (I added
 the capability in order to restore the initial state of the audio device,
 for testing purposes. It might also be useful to users of broken binary-
 only applications.)

 Observe that the mixer device interface (and so, "mixerctl") still
 retains all capabilities, including the ability to set the actual input
 port on the chip, overriding the level controls. No change is being made
 to the mixer device interface. The mixer device simply presents all the
 controls on the chip, with no attempt at abstraction, so there are no
 bugs there.

 The upshot is, that applications that have been trying to use the audio
 device interface to change the volume, such as mplayer, now "just work".

 I've tested these changes extensively with "eso" and "eap" since first
 proposing them on tech-kern last January, and somewhat with "esm" and a
 few others. This closes both PR kern/10221, and PR kern/17159.


 To generate a diff of this commit:
 cvs rdiff -r1.56 -r1.57 src/share/man/man4/audio.4
 cvs rdiff -r1.25 -r1.26 src/share/man/man9/audio.9
 cvs rdiff -r1.181 -r1.182 src/sys/dev/audio.c
 cvs rdiff -r1.29 -r1.30 src/sys/dev/audiovar.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: analyzed->feedback 
State-Changed-By: fredb 
State-Changed-When: Wed Feb 4 14:49:53 CST 2004 
State-Changed-Why:  

Tom -- I believe the title issue, which affected all ports, is now fixed. 
It sounds like there may be, or may have been, other issues with your sound 
card, as "mixerctl" was never broken for everyone. Would you please update, 
and report? -- Thanks, Fred 


From: Tom Spindler <dogcow@babymeat.com>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: Re: kern/10221
Date: Wed, 4 Feb 2004 21:55:12 -0800

 > State-Changed-From-To: analyzed->feedback
 > State-Changed-By: fredb
 > State-Changed-When: Wed Feb 4 14:49:53 CST 2004
 > State-Changed-Why: 
 > 
 > Tom -- I believe the title issue, which affected all ports, is now fixed.
 > It sounds like there may be, or may have been, other issues with your sound
 > card, as "mixerctl" was never broken for everyone. Would you please update,
 > and report? -- Thanks, Fred

 Yup, it seems to work. Go ahead and close this.

State-Changed-From-To: feedback->closed 
State-Changed-By: fredb 
State-Changed-When: Thu Feb 5 05:36:59 CST 2004 
State-Changed-Why:  

Fixed. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.