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

Jon Trulson jon at radscan.com
Mon Jul 24 18:41:09 MDT 2006


On Mon, 24 Jul 2006, Erik Auerswald wrote:

> Hi,
>
> On Sun, Jul 23, 2006 at 10:29:07PM -0600, Jon Trulson wrote:
>> On Mon, 24 Jul 2006, Erik Auerswald wrote:
>>>
[...]
>>
>>         Hmm... It should setup default gains and recsrc if mixerinit
>>         is true.
>
> That's my opinion as well.
>

         But you believe it should only ever do this _once_?

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

         Right now, the default gains and linemode are set the
         first time createServerComponents() is called.

         Then, the behavior you prefer is actually the way it
         should be working now... As long as it's a NAS app doing the
         changing (volume, etc), these settings will be remembered
         across open/close.

         If a non-NAS aware app (say... xmms) accesses the device
         directly, then NAS will reset the specified default values the
         next time it opens the device.

         It seems to me, that this is the behavior that you do not
         like?

         Hehe, I actually like this behaviour... I'd even prefer one
         further and have NAS reset to the defaults on every server
         iteration (essentially whenever NAS opens the device), not
         caring about what previous NAS client did, in case some
         nas/non-nas set the volume to low for me to hear what
         'festival' is telling me :)

         So, right now MixerInit simply sets/doesnotset the RECSRC.
         Perhaps this needs to be expanded:

         Assuming I were to make MixerInit handle an integers well as
         a bool:

         0 = do not modify mixer characteristics at startup at all.
             Use whatever is there.

         1 = setup all default gains/recording options the
             first time NAS is started, and never again thereafter.

         2 = setup all default gains/recording options everytime the
             device is opened (actually, every server 'generation' so
             it would work even if releasedevice == no). This would of
             course ignore any of the last* settings.

         If MixerInit is "yes", this would be equivalent to '1' above.
         If "no", then '0', above (for compatibility).

         The default would be 1.  Personally, I'd use '2'. :)

         Would this cover all the bases?

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