[nas] [PATCH] changed method of setting the input gain
Jon Trulson
jon at radscan.com
Mon Jul 24 23:35:30 MDT 2006
On Tue, 25 Jul 2006, Erik Auerswald wrote:
> Hi,
>
> On Mon, Jul 24, 2006 at 06:53:44PM -0600, Jon Trulson wrote:
>> On Mon, 24 Jul 2006, Paul Fox wrote:
>>> i wrote:
>>>> erik wrote:
[...]
>> But, aside from RECSRC and devmask, nas doesn't have to 'read'
>> the mixer (for example, the output gain). Why would it?
>
> Well, it _does_ already read them (and ignores them later on...). It
> would want to to read them to use these values on startup instead of
> it's own default values.
Yes, in that case, we would use them :)
>
>> 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.
>
> This is kind of a complicated matter... The NAS server will write it's
> own gains (default or previously set) whenever opening a device or when
> there is an open device and some app changes the settings. An external
> app can alter the gain settings while NAS is playing without the NAS
> server even noticing this.
>
True.
>> 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.
>
> IMHO the NAS server should have some internal settings that are used
> whenever playing a sound. To achieve this these settings have to be
> written to the mixer whenever opening the device, because some other app
> using it might have changed the settings. Then it is possible to control
> NAS playback even with a released device and other (local) apps using
> the same audio device when NAS is not playing/recording.
>
I agree... I think Paul does too... What we are trying to
determine here is how the mixer shou;d be initted - 1. left
alone 2. set to the last NAS setting (last*) or 3. set to the
configured default (gain).
> The MixerInit option should define whether or not the NAS default values
> are used on NAS server startup.
>
Well, we can stretch it to also mean 'How' the devices are
setup too.
> A RestoreMixer option could be used to restore the previous values of
> the audio device whenever it is closed by NAS. I don't think this is
> needed, because the current mixer settings should be viewed as
> "undefined" by every sound app and therefore set if some specific values
> are needed (hence the default behaviour of NAS to set the default
> gains).
>
> A NoMixer option could be used to not change the mixer settings at all.
> This could be useful when an external amplifier should be used to
> control the volume. The internal amplifiers of most sound hardware are
> of low quality, the Gravis Ultrasound even had a special output port
> with fixed amplification because of this. I prefer to set my sound
> hardware to some working values (without distorted sound) and use
> external amplifiers to control the volume.
>
> The effect of this option can be had with setting the mixer device to
> something not a mixer (or not existing), but the NAS server still thinks
> it can change the settings, NAS mixer applications will report changed
> values but the mixer will not change.
>
Yeah I thought of that too, but it seems hacky - tell someone
they should specify some non-existant file for the mixer device...
> If I understand Paul correctly he wants to be able to control the NAS
> sound via NAS mixer applications but the NAS server to use the current
> mixer settings whenever opening the device (losing the changes made by
> NAS applications before). IMHO this should be a seperate Option (or a
> seperate value for MixerInit ("startup", "reopen", "never" instead of
> "yes", "no"). With these values "startup" is the same as "yes" and
> "reopen" the same as "no".
>
Yes seperate string or integer options as to how the device is
used. We just need to define these options :)
> Erik
>
--
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