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

Erik Auerswald auerswal at unix-ag.uni-kl.de
Thu Jul 27 08:23:23 MDT 2006


Hi,

On Thu, Jul 27, 2006 at 08:46:53AM -0400, Paul Fox wrote:
> erik wrote:
> documentation thought:  i think we need to start stating, in both
> the man page and in the config file comments, what the default
> behavior is for each of our booleans.  there's a tendency to edit
> the originally-installed file to make changes, and then any
> indication of the server default is lost.

I agree.

>  > The patch is attached to this mail. It is not without issues, though:
> 
> one change:  when reading the gain, you have to do inverse gain scaling:
> 
> --- server/dda/voxware/auvoxware.c.erik	Thu Jul 27 08:18:38 2006
> +++ server/dda/voxware/auvoxware.c	Thu Jul 27 08:21:29 2006
> @@ -361,6 +361,11 @@
>                       sndStatOut.mixer, mixerfd, strerror(errno));
>          }
>          pcm_level = pcm_level >> 8;
> +        if (sndStatOut.gainScale ) {
> +	    pcm_level *= 100;
> +	    pcm_level /= sndStatOut.gainScale;
> +	    if (pcm_level > 100) pcm_level = 100;
> +	}
>      } else {
>          pcm_level = sndStatOut.gain;
>      }

I'll do this in the next version of the patch, thanks.

> the tracking seems to work for me, after applying this.  thanks!
> 
> another question though:  i haven't tried it, but since you've
> eliminated the last* variables, if the mixer is closed, you
> always report the default sndStatOut.mixer.

Exactly. Without a mixer device no true value can be reported. This way
the user tries to change it but nothing happens, which is at least
consistent.

> but if the user sets
> keepmixer to false, doesn't this mean that no nas-based mixer can
> report a true value?  i'm confused.  (in fact, i did just try
> setting keepmixer to "no", and sure enough, my "audiooss aumix"
> is now locked at 50%.  oh.  wait.  i didn't have a stream
> playing.  if i play a stream, then the nas mixer works correctly. 
> is the total lockout when the pcm device isn't open the expected
> behavior?  i thought it would work like it did before.

Before (in the development version) changes made while there is no mixer
are kept and applied when the mixer is re-opened. In the released
version the server tells it changed the value but it is lost as soon as
the mixer is re-opened.

>  > When reading the IGain value from the mixer the ioctl returns -1 with
>  > errno == 0 (success) most of the time. The value was read correctly
>  > every time I tested this regardless of error reported. I have no idea
>  > why this happens. The patch works for me, it justs spams the logfiles
>  > with lots of error: success messages. I was using aupanel to control the
>  > NAS mixer, I did not check if auctl behaves the same (it should).
> 
> my logs look like this.  i got one "success" message, but a bunch of
> EINTR. calls.  not sure what those are from.

I've found my error: I checked ioctl() != -1 and thought I would check
ioctl() == -1... It will be corrected in the next version of the patch
along with error handling besides reporting (I took this out after the
errors seemed to be bogus).

Erik



More information about the Nas mailing list