[pulseaudio-discuss] Software volume: linear vs. logarithmic

"Günter Merz" lotan_rm at gmx.de
Wed Aug 22 06:14:45 PDT 2012


I'm a bit confused as to why so many pulseaudio implementations (xine, gstreamer to name two) seem to use linear software volumes rather than logarithmic ones.

Using linear volumes seems really counter intuitive to me as it leaves very little control (numerically) in the low volume area and very much flexibility in the high volume area, where it's not needed.  A quick search shows that other users seem to agree with me:


Can anyone explain the reasoning behind this?

I wonder if it has something to do with the second paragraph (Calculations) in


which advises:

   The volumes in PulseAudio are logarithmic in nature and applications shouldn't perform calculations with them directly. Instead, they should be converted to and from either dB or a linear scale

For xine I tried to resolve my problem by submitting the following patch, which does volume calculations (and which, sadly for me, wasn't accepted upstream):


The patch leaves me with a far more naturally feeling logarithmic volume scale.

I would like to do something similar to what I did in xine to pulsesink.c in the gstreamer-good package in order to change the rhythmbox and rygel (and others) volume handling but the fact that Lennart Poettering (once the lead developer) originally wrote the GStreamer pulseaudio plugin and will surely have had his reasons for doing it the way he did makes me ask here first.

More information about the pulseaudio-discuss mailing list