[nas] [PATCH] changed method of setting the input gain

Erik Auerswald auerswal at unix-ag.uni-kl.de
Mon Jul 24 16:20:05 MDT 2006


Hi,

On Mon, Jul 24, 2006 at 02:59:06PM -0400, 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

IMHO the NAS server should keep it's settings even if after releasing
the sound device. I'd want to allow other programs to use (and change
the settings of) the sound device when NAS is not using it, but I would
not want this to screw up the settings of the NAS server.

If you want to be very polite you could save the current settings and
restore them just before releasing the device again.

>  > the server should query the device for current settings when it
>  > re-opens, and start from there.

The "mixerinit" option will keep the current mixer settings when first
opening the device. The "nomixer" option will always keep the mixer
settings and never change them.

My "consistent gain setting" patches had the reason that I wanted to be
able to control the NAS settings even if the device is currently
released. This is very useful if the last NAS user left the gain at 100
from watching a DVD and my music should be played with gain 30. If the
NAS server did not change the settings of a reopened device I would have
to endure some much too loud music for the time I need to react to the
starting playback.

> 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.

Well, it actually reads the levels in initMixer(), but never uses them.
This is to be changed by the reworked "mixerinit" option.

NAS is not sharing the device, it is just not blocking it. There is but
one user of the sound device at any time. And the useful gain levels can
differ a lot between applications.

> 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.)

Fine. :-)

> i can also do a patch to eliminate the use of (the recently
> renamed :-) "lastPhysicalOutput" variable, in favor of actually
> reading the device.

As stated above I would not like this.

Erik



More information about the Nas mailing list