[arch-general] OT: [arch-dev-public] polkit package upgrade patch

Fons Adriaensen fons at linuxaudio.org
Sun Aug 12 09:07:32 EDT 2012


On Sun, Aug 12, 2012 at 02:47:59AM +0200, Tom Gundersen wrote:

> Argument by authority, nice. Care to elaborate? (Sorry to anyone who
> is sick of PA, but for once I'm seeing the chance to learn something
> from one of these threads ;-)).

No authority needed here, it's just extremely clumsy to use a mixer
that way, you'd need ten hands. For it means that whenever you want
to adjust a single channnel you may have to adjust *all* others and
the master at the same time. 

> If the problem is too complex to explain in layman terms, that's
> understandable. However, is the problem one that would be unacceptable
> in a professional setting (e.g. a recording studio, ...) as it would
> cause subtle issues. Or is it a problem that I should be able to
> observe on my crappy speakers at home? If so, what am I listening for?
> How would I go about reproducing it?

[1]

The first and sufficient argument is that is completely *unnecessary*
to do such things. 

Assume you have two or more apps producing sound, and one of them (A)
has its volume set to max, so PA will set the master fader to max.
Assume things are OK that way (which will probably be the case). 

Things will still work well when (A) happens to contribute nothing
(i.e. while it outputs silence). So things will still work well when
(A) isn't there at all. *There is no need to change anything at all*
when (A) goes away, even if all others have their volume set to lower
values.

[2]

As to technical arguments, I can try. First thing to know is that
you shouldn't confuse 'level' (a property of signal), and 'gain'
(the ratio of two levels, or difference if you think in dB).
Both are usually expressed in dB, but that doesn't make them the
same thing. Compare it to time: a instant (epoch) and a duration
are both expressed in the same units but they are different things.
For example the sum of two epochs doesn't have any meaning, while
the sum of two durations has. And if some activity has a duration
of 40 minutes, that doesn't mean it has to finish at 00:40. 

Similarly, if an apps has its gain set to -10 dB, that should not
be taken to imply that it can't output more than -10 dB. 

On 'real' mixers (digital or analog) you normally have considerable
'headroom'. Setting your master fader to -20 dB does not mean you
can't output more than -20 dB. For digital ones that means that
they use internally a wider format (more bits) than on the external
interfaces. So you can actually trade off input gains and master
gain to some extent. 

Soundcard mixers are different. The PCM input to the mixer (i.e.
the samples the SW provides) usually has the same format as the
AD converter, e.g. 16 or 24 bits. That means that if the master
is set to e.g. -20 dB, the card can't output any signal that is
larger than -20 dB (w.r.t. its normal maximum level).
Which is wrong. Assume you have two or more apps, all of them have
their volume set to -20 dB. So PA will set the master output to
-20 dB. Now even if all of these apps are limited to contributing
-20 dB (but there is no reason why that should be), the sum of
them can be higher, but your soundcard can't handle that. 

It all amounts to this: unless the user is using the soundcard's
'master' as his global volume control (similar to a volume knob
on an external amplifier) it should be left at 0 dB. No software
layer should ever touch it.

[3]

On many soundcards the master fader also controls the level of
things that PA or any software layer doesn't know about, e.g.
and external mic input. Which you'd use for karaoke, or to
hear yourself in your headphones while skyping. That level must
not depend on how other apps set their volume controls. Again
the software should not touch the master gain.

[4]

You can't apply a soundcard mixer gain change at some exact
point in a sample stream. So you can't change the master
gain and change your internal scaling to compensate at
exactly the same time. There will always be a glitch.

-- 
FA

A world of exhaustive, reliable metadata would be an utopia.
It's also a pipe-dream, founded on self-delusion, nerd hubris
and hysterically inflated market opportunities. (Cory Doctorow)



More information about the arch-general mailing list