[pulseaudio-discuss] Per-app flat volume adjustment is highly unintuitive, if mathematically consistent.

Jud Craft craftjml at gmail.com
Mon May 25 10:51:51 PDT 2009


I understand how audacious it would be to post and tell you that
Pulseaudio is doing the volume scaling wrong, but let me demonstrate a
problem.  I won't post twice -- I know you guys are busy on this list
-- but I've really wanted to mention this.  I've seen Redhat Bugzilla
#494112, but it seems to glance over the problem.

I know that Pulse can remember the volume of an app.  And when Pulse
also scales the main-system volume (with only one program, App A,
present), it remember that app's volume, say 75%, and sets the main
system volume to it.  All is good.  Set App A to 75%, and Pulse sets
the system volume to 75%.

But what happens when you run another program (App B), that has a
per-app volume of 80%?  It appears that Pulse remembers the volume of
App B too.

In this case, it appears that Pulse rescales both apps, so that the
main system volume matches App B (80%), and App A is set so that it
has a relative volume to App B.  (ie, if App A has only 75% of the
main system volume, and 80% is the main volume, so App A now has .80 x
.75 = 60% volume).

This maintains the correct per-app ratio (App B is louder than App A),
but it changes the main system volume.  In addition, if a program that
has no per-app volume yet (with a default of 100%) is launched, then
Pulse resets system volume to 100% and scales _both_ apps to match
this one.

My apps are scaling fine, but here's the problem:  "main system
volume" is meaningless.  I have no control over it, since Pulse will
set it to whatever it wants.  There's no point in even changing it --
I should just merely set the per-app volumes and let Pulse figure out
what to do.

I don't have my laptop plugged into a stereo system with a big volume
knob that I can turn.  When I set the main volume to 80%, I want it to
stay that way.  I don't want something like playing a YouTube video or
playing a new CD to change the volume back to 100% or whatever it
wants.

In essence, the user should be able to set the volume of any program
he likes, and expect that the system will respect that.

One solution.
1.  When a new never-seen-before app is launched, Pulse defaults not
to 100% but to the current system volume.
2.  Pulse should never change the main system volume on its own.  That's mine.
3.  If I change the loudest App, then Pulse may change the main system
volume to match.  But only because I did it; whenever an App starts on
its own, Pulse matches it relative to the main system volume.

This, in fact, is the way Windows Vista behaves.  Pulse currently
doesn't behave like Windows Vista:  nothing ever changes your main
volume on Windows except you, or unless *you* change the highest
volume app.

It's also worth noting that System Sound Events are shown as an App in
the Windows Vista list (unlike Pulse, where they are separate) --
which means that since they usually don't change volume, they serve as
an arbitrary reference for the main system volume and all other apps
to match to.  This means that in Windows, when you adjust an App, it
doesn't change the system volume, since the system volume still
matches the Sound Events volume.

So, Solution B:  Make Sound Events show up on the Volume Control
Applications tab, and match the main system volume to it.  And make
sure that Pulse never changes or goes above the main system volume on
its own.  That would also fix the problem.

Thanks for your time, sorry about the long post.  I see in Redhat
Bugzilla #494112, there is the option to disable flat volumes, but I
don't want to do that -- I really just want the volume logic to be as
good as possible.



More information about the pulseaudio-discuss mailing list