On Fri, 24 Apr 2009 11:29:02 -0400
Nick Guenther <kou...@gmail.com> wrote:
> I'm playing with the new aucat. Or rather, running it, since unlike
> every other soundserver it doesn't require endless tweaking to just
> work. There is one issue I'm having, and I'm not sure if it's on
> purpose or not. Whenever (say) pidgin (or anything else) plays sound
> my music dims in volume. It makes sense the clients have to be turned
> down so two playing at 100% don't blow the speakers, but the trouble
> is the dip in sound is -really obvious-.

I also think the current "algorithm" is too aggressive; the output
volume is calculated by dividing the maximum volume by the number of
streams (or clients).  While this does guarantee that there will be
no clipping, it means the change in volume is indeed very audible.

Excerpts from /usr/src/usr.bin/aucat/aproc.c:

  n = 0;
  LIST_FOREACH(buf, &p->ibuflist, ient) {
          n++;
  }
  LIST_FOREACH(buf, &p->ibuflist, ient) {
          weight = ADATA_UNIT / n;
          [...]
          buf->mixeight = weight;
  }

Mixing two (or more) streams is not likely to cause any clipping
(sample value out of range) as most samples are not exactly at
peak values all the time.  I don't have a better solution, but I
think something should be done about the current approach; it
just doesn't sound right to me.

I wonder what the other sound daemons do ...

Reply via email to