Amarok + PulseAudio: volume control changes global volume

Colin Guthrie gmane at colin.guthr.ie
Tue Jul 6 15:43:28 BST 2010


'Twas brillig, and Nikos Chantziaras at 06/07/10 14:36 did gyre and gimble:
> On 07/06/2010 04:21 PM, Colin Guthrie wrote:
>> 'Twas brillig, and Nikos Chantziaras at 06/07/10 13:36 did gyre and gimble:
>>> On 07/06/2010 11:38 AM, Colin Guthrie wrote:
>>>> [...]
>>>> So what is this logic? Well, the general premise is that h/w volume
>>>> control is favoured whenever possible.
>>>
>>> Why?  As I mentioned in another post, lowering hardware volume results
>>> in a reduction of bit-depth, and thus sound quality.  PA is free to mix
>>> at a higher bit-depth than the hardware supports in order to avoid this,
>>> but the hardware can't.
>>
>> PA mixes the prior to sending it to h/w so doing so before applying
>> volume changes is clearly going to be better quality.
>>
>> Essentially the aim is to avoid touching the audio stream if at all
>> possible and that's what this approach does. As mentioned earlier it's
>> the same approach taken in the latest Windows incarnations too.
> 
> I suppose this is acceptable with cheap speaker systems.  But when I 
> have a higher quality system with its own volume control, I'd like to 
> have sound card hardware volume at 0db so my speakers can have the full 
> signal instead of something that's being attenuated.
> 
> But anyway, that's probably just me.

To be honest, I don't follow this logic!

If you want your sound to be <0dB then you have two choices.

Say you want -15dB, you can either:
 1. Set h/w knob to 0dB and then attenuate to -15dB in software prior to
pushing it into the h/w
 2. Set h/w to -15dB and then don't touch the stream at all before
giving it to the h/w.

In some pro-setups the h/w volume control knob could end up controlling
a physical knob on a desk!

So in PA we always consider h/w volume control to be "better" than our
software volume control and try as much as possible to use it whenever
we can (for both quality and for CPU reasons).

I guess on your setup you'd want to set the entire pipeline to 0dB on
the computer (e.g. both amarok and h/w volume being 0dB and then use the
volume knob on your receiver.

In actual fact, for this reason, PA makes finding the 0dB point easier
than with plain alsa as it clearly presents the 0dB in the pavucontrol
GUI as "Base Volume". Some cards have 0dB == 100% in which case the base
volume isn't shown, but on some cards, 12dB == 100% so 0dB is somewhere
around the 70% mark (depends how you convert your dB -> % tho'). So we
clearly mark the base volume in the GUI so users know exactly where to
put their sliders to avoid software attenuation.

Described a little better here:
http://pulseaudio.org/wiki/WritingVolumeControlUIs#Colouredvolumesliders

I've not yet had time to try and work out how to show the base volume in
kmix, but it'll come eventually.

(note there are some arguments about how best to present the 0dB point
(in terms of h/w 0dB) to the user. It's a bit of an issue that Raymond
(alsa guy) in particular disagrees with but he's impossible to have a
good constructive argument with as he ignores all the points and
concessions made and just restates the original point :s)


>>> I hope you'll be able to solve any remaining issues with it
>>> (mplayer with PA is something I simply cannot live with.)
>>
>> I've used mplayer with PA for about two or three years. There have been
>> a couple bugs along the way but none that are not solved AFAIK. Works
>> great here.
> 
> The main problem for me (while using latest PA and latest mplayer from 
> SVN) was that seeking in a video is slow and glitchy.  For example, 
> pressing the "left" button to go 5 seconds forwards results in the 
> video/audio getting out of sync and mplayer is then playing the video at 
> double speed for a few seconds, followed by the video being played at 
> half speed for another few seconds.  Without PA, seeking is instant with 
> no lag and no video-audio sync and speed problems.

Hmm, can't say I've noticed this but I'll be sure to take a look.

Cheers

Col


-- 

Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited [http://www.tribalogic.net/]
Open Source:
  Mandriva Linux Contributor [http://www.mandriva.com/]
  PulseAudio Hacker [http://www.pulseaudio.org/]
  Trac Hacker [http://trac.edgewall.org/]



More information about the kde-multimedia mailing list