[nas] [PATCH] changed method of setting the input gain
Jon Trulson
jon at radscan.com
Mon Jul 24 18:53:44 MDT 2006
On Mon, 24 Jul 2006, Paul Fox wrote:
> i wrote:
> > erik wrote:
> > > On Sun, Jul 23, 2006 at 10:29:07PM -0600, Jon Trulson wrote:
> > > > Hmm... It should setup default gains and recsrc if mixerinit
> > > > is true.
> > >
> > > That's my opinion as well.
> > >
> > > > It should probaby setup these defaults every time it
> > > > opens the device, shouldn't it?
> > >
> > > I don't think so. The defaults should be applied the first time the
> > > device is opened. After that the last set values should be activated
> > > (what is done now to keep the changes made while the device was
> > > released).
> >
> > but isn't the point of releasing the device that you want to play
> > well with other users of the device? in that case, shouldn't you
> > touch nothing at all on a re-acquire of the device? seems to me
> > the server should query the device for current settings when it
> > re-opens, and start from there.
>
> looking at the code (for other reasons) i see that this is
> complicated by the fact that auvoxware.c goes out of its way to
> never ever read the current mixer settings. it only writes to
> them. seems to me that if the device is being shared with other
> applications, that nas should be sharing the levels as well.
>
But, aside from RECSRC and devmask, nas doesn't have to 'read'
the mixer (for example, the output gain). Why would it?
If some external app has set output gain to '50' and a nas app
sends data, it will use whatever the mixer is already setup at
(well it will :). Right now it will simply write the
'default' gains in nasd.conf.
You want MixerInit option '0' as entioned previously, where it
never sets the gains/rec's unless specifically asked to.
> i'm putting together a patch to implement a "gainscale"
> configuration item, which will be a percentage by which all
> output gain requests will be reduced. (this is to keep nas from
> causing my sound devices to go into their distortion zone.)
>
> i can also do a patch to eliminate the use of (the recently
> renamed :-) "lastPhysicalOutput" variable, in favor of actually
> reading the device.
>
Don't do that. Again, your problem is not that NAS isn't
'reading' the mixer gains, it's that NAS is writing the
default gains to the device, without your express written
approval.
> does this make sense?
>
You tell me. :)
> paul
> =---------------------
> paul fox, pgf at foxharp.boston.ma.us (arlington, ma, where it's 77.0 degrees)
>
--
Jon Trulson
mailto:jon at radscan.com http://radscan.com/~jon
#include <std/disclaimer.h>
"No Kill I" -Horta
More information about the Nas
mailing list