[pulseaudio-discuss] Standardising on the amount of software amplification is presented to the user

Lennart Poettering lennart at poettering.net
Tue Apr 13 14:04:05 PDT 2010


On Tue, 13.04.10 15:10, Colin Guthrie (gmane at colin.guthr.ie) wrote:

> Hi,
> 
> I'm trying to solve a bug where by mplayer is clamping the volume at
> 100%. If someone turns up the volume to >100% using e.g.
> gnome-volume-control, hitting volume up or down in mplayer will reset it
> to 100% again.
> 
> For a quick straw poll:
> 
>  g-v-c: 150%

Unfortunately g-v-c-a limits to 100%. Which is kinda weird.

>  pavucontrol: 100%
>  kmix & phonon: 100% (I wrote this so only me to blame!)
> 
>  vlc: 400% (but does not yet use PA per-application volume control).
>  mplayer: 100%
> 
> + numerous others.

Well, and for all of those the meaning of 150% probably differs. And it
probably makes more sense to speak about dB here.

> Now I believe we need some kind of standard amount of overdrive.
> Obviously we want to push the applications into using per-stream
> volumes, but this only really works if they all use the same range.
> 
> What is the best way to do this? Should we just decide on it now and
> then push this out to the apps? Should we have a constant? e.g.
> PA_VOLUME_OVERDRIVE == +3dB or something?

Hmm, this is purely a UI decision, not sure this belongs in PA. And
also, this all depends on whether the device does decibel volume scaling
at all. If it doesn't you need to end things at 100%.

> In VLC the 400% relates to a +6dB overdrive so a +3dB for them is 200%
> (and one of their devs said to me that he didn't think that anything
> over +3dB should be shown to the user). Perhaps even this is too far?

In PA +6dB is at 125% or so (with the current mapping algorithm).

We currently use the same cubic mapping both below and above 100%. I am
not sure that is even a good choice, and if we shouldn't change that one
of those days.

We probably should say that applications should end their scale at +6dB
and in the PA case they should map that back via pa_sw_volume_from_dB() to a
percentage, so that we have the freedom to change the mapping later on,
without changing the meaning of the overdrive setting.

So, we could do this:

#define PA_VOLUME_OVERDRIVE (pa_sw_volume_from_dB(+3.0f))

instead of this:

#define PA_VOLUME_OVERDRIVE (PA_VOLUME_NORM+PA_VOLUME_NORM/2)

And then have the freedom of changing our mapping. OTOH that would mean
that volume scales would end at a weird 112%. 

But yes, I guess I am not opposed in adding something like this.

Lennart

-- 
Lennart Poettering                        Red Hat, Inc.
lennart [at] poettering [dot] net
http://0pointer.net/lennart/           GnuPG 0x1A015CC4



More information about the pulseaudio-discuss mailing list