Bug 552310 - gnome-volume-control does not show "base" volume for output devices, but it should
Summary: gnome-volume-control does not show "base" volume for output devices, but it s...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-media
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Bastien Nocera
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 542437 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-04 16:47 UTC by Łukasz Lis
Modified: 2010-01-16 15:40 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2010-01-07 16:50:32 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
alsa-info.sh --output (6.44 KB, text/plain)
2010-01-04 16:47 UTC, Łukasz Lis
no flags Details
pacmd ls (22.46 KB, text/plain)
2010-01-04 16:50 UTC, Łukasz Lis
no flags Details
amixer -c0 (1.80 KB, text/plain)
2010-01-04 16:51 UTC, Łukasz Lis
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 606325 0 None None None Never

Description Łukasz Lis 2010-01-04 16:47:07 UTC
Created attachment 381585 [details]
alsa-info.sh --output

Description of problem:
pulseaudio miscalculates volume values.
This causes deafening sound blasts to appear around a setting of 20%-30% and sound clipping and distortion beyond that.

Version-Release number of selected component (if applicable):
pavucontrol-0.9.10-1.fc12.x86_64
pulseaudio-0.9.21-2.fc12.x86_64
kernel-2.6.31.9-174.fc12.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Set 'Master' and 'PCM' volume to 0 dB in alsamixer or 'Base' in 'pavucontrol'
  
Actual results:
amixer -c0 shows 0 dB on 'Master' and 'PCM' channels
pavucontrol and g-v-c applet both show -34.50 dB (27%)

Expected results:
amixer, pavucontrol and g-v-c all show 0 dB (100%)

Additional info:
$ lspci -v
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
	Subsystem: Lenovo ThinkPad T61
	Flags: bus master, fast devsel, latency 0, IRQ 17
	Memory at fe100000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: HDA Intel
	Kernel modules: snd-hda-intel

Comment 1 Łukasz Lis 2010-01-04 16:50:27 UTC
Created attachment 381586 [details]
pacmd ls

1 sink(s) available.
  * index: 0
        name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
        driver: <module-alsa-card.c>
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
        state: RUNNING
        suspend cause: 
        priority: 9959
        volume: 0:  27% 1:  27%
                0: -34.50 dB 1: -34.50 dB
                balance 0.00
        base volume:  27%
                     -34.50 dB
        volume steps: 65537

Comment 2 Łukasz Lis 2010-01-04 16:51:50 UTC
Created attachment 381587 [details]
amixer -c0

Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 43
  Mono:
  Front Left: Playback 43 [100%] [0.00dB] [on]
  Front Right: Playback 43 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch penum
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 43
  Mono:
  Front Left: Playback 20 [47%] [0.00dB] [on]
  Front Right: Playback 20 [47%] [0.00dB] [on]

Comment 3 Lennart Poettering 2010-01-04 17:59:38 UTC
PA puts 0dB always to max amplification, ALSA does not specify where 0dB is. That causes the scales to be shifted on some cards.

Also read:

http://pulseaudio.org/wiki/PulseAudioStoleMyVolumes

Comment 4 Łukasz Lis 2010-01-04 19:40:05 UTC
(In reply to comment #3)
> PA puts 0dB always to max amplification, ALSA does not specify where 0dB is.

If ALSA doesn't specify what 0 dB is and pulseaudio depends on ALSA then it's value is also meaningless. Pulseaudio redefined a undefined but usable default with "maximum ear damage".

The core of the problem is that anything past the ALSA value of 0 dB is unusable on both PCM and Master channels. There have been other bug reports (540099, 542124) which suggest that. This causes most of the available volume range to be either too loud (15% to 27% in my case) or distorted and clipped AND too loud (from 27% upwards in my case).

This basically boils down to these scenarios:
a) Master or PCM > 0 dB causes clips
b) Master and PCM > 0 dB is excessively loud AND clips 

> That causes the scales to be shifted on some cards.
> 
> Also read:
> 
> http://pulseaudio.org/wiki/PulseAudioStoleMyVolumes  

Other than a calibration tool, I think maybe a check box that would peg the maximum (100%) volume to the ALSA equivalent of 0 dB or whatever 'Base' stands for, would effectively fix this.

Comment 5 Lennart Poettering 2010-01-06 13:42:06 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > PA puts 0dB always to max amplification, ALSA does not specify where 0dB is.
> 
> If ALSA doesn't specify what 0 dB is and pulseaudio depends on ALSA then it's
> value is also meaningless. Pulseaudio redefined a undefined but usable default
> with "maximum ear damage".

ALSA has a range from x to y dB. PA now shifts that so that the range is from x-y to 0dB, making 0dB the top end of the scale and meaning max amplification. That happens to be exactly how all stereos handle this, if you every had a look.

> The core of the problem is that anything past the ALSA value of 0 dB is
> unusable on both PCM and Master channels. There have been other bug reports
> (540099, 542124) which suggest that. This causes most of the available volume
> range to be either too loud (15% to 27% in my case) or distorted and clipped
> AND too loud (from 27% upwards in my case).

That's why newer g-v-c shows the "base" volume on the slider which is where max amp is with no clipping. If you leave the slider below that everything is fine.

> > That causes the scales to be shifted on some cards.
> > 
> > Also read:
> > 
> > http://pulseaudio.org/wiki/PulseAudioStoleMyVolumes  
> 
> Other than a calibration tool, I think maybe a check box that would peg the
> maximum (100%) volume to the ALSA equivalent of 0 dB or whatever 'Base' stands
> for, would effectively fix this.  

I am sorry, but I don't think this would be a good UI. But please file a bug for this against g-v-c.

Comment 6 Łukasz Lis 2010-01-06 16:14:43 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> That's why newer g-v-c shows the "base" volume on the slider which is where max
> amp is with no clipping. If you leave the slider below that everything is fine.

My version doesn't (gnome-media-2.28.1-3.fc12.x86_64) indicate where the 'Base' volume is on the slider. It only shows 100%. I can't tell where the 'Base' volume is.

Now I've noticed something funny: g-v-c shows and available range of over 100% but pavucontrol doesn't. Both pavucontrol's and g-v-c's sliders are synchronised properly but I can select a "volume" of over 100% in g-v-c. Pavucontrol's available range ends at 100% but the value beside the slider goes over 100% when I change it in g-v-c.

Comment 7 Lennart Poettering 2010-01-07 16:36:04 UTC
Yes, pavucontrol limits its range more restricively than g-v-c does.

g-v-c unfortunately shows the base volume only for recording, not for playback. Will reassign this bug to g-v-c now, so that this is added, too.

Comment 8 Lennart Poettering 2010-01-07 16:36:35 UTC
Hmm, will file this as upstream.

Comment 9 Lennart Poettering 2010-01-07 16:37:46 UTC
(In reply to comment #7)
> Yes, pavucontrol limits its range more restricively than g-v-c does.

Just to note that explicitly: g-v-c is right in showing the scale up to 150%, since digital amp is often quite useful.

Comment 10 Lennart Poettering 2010-01-07 16:45:40 UTC
*** Bug 542437 has been marked as a duplicate of this bug. ***

Comment 11 Lennart Poettering 2010-01-07 16:50:32 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=606325

Comment 12 Łukasz Lis 2010-01-10 11:54:28 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > PA puts 0dB always to max amplification, ALSA does not specify where 0dB is.
> > 
> > If ALSA doesn't specify what 0 dB is and pulseaudio depends on ALSA then it's
> > value is also meaningless. Pulseaudio redefined a undefined but usable default
> > with "maximum ear damage".
> 
> ALSA has a range from x to y dB. PA now shifts that so that the range is from
> x-y to 0dB, making 0dB the top end of the scale and meaning max amplification.
> That happens to be exactly how all stereos handle this, if you every had a
> look.

There's something that occurred to me. Wouldn't it mean that the ALSA values follow the same scheme? i.e. 0 dB means max amplification. This would explain why values above 0 dB cause clipping.

Even if values a little above 0 dB don't cause clipping this would, at least in my case, make the whole volume range usable. Currently, only a third is usable and that gives me 3 values:
  0% mute
 17% medium
 30% loud and clipped
>30% unusable

(In reply to comment #9)
> Just to note that explicitly: g-v-c is right in showing the scale up to 150%,
since digital amp is often quite useful.    
It would be useful if the input to that digital amp wasn't clipped to all hell.

Comment 13 Lennart Poettering 2010-01-11 17:15:09 UTC
(In reply to comment #12)

> There's something that occurred to me. Wouldn't it mean that the ALSA values
> follow the same scheme? i.e. 0 dB means max amplification. This would explain
> why values above 0 dB cause clipping.

ALSA does not define what 0dB means. Some drivers set 0dB to max amp, others to max amp with no clipping. Others set it so that it reflects some "sane" output level, i.e. some defined output voltage. Others do the same but pick a different output voltage, since there is no standard for it. For even others 0dB means "not amplified".

So, there is really no defined meaning what 0dB refers to. PA now shifts that all so that 0dB is always max hw amplification. But because 0dB often actually *does* have a meaning, but which is very much card dependant we do export that value and call it "base".

> 
> Even if values a little above 0 dB don't cause clipping this would, at least in
> my case, make the whole volume range usable. Currently, only a third is usable
> and that gives me 3 values:
>   0% mute
>  17% medium
>  30% loud and clipped
> >30% unusable

3 values? There should be enough selection between 0-30%?

So are you complaining that too much of the full scale is already in the clipping range?

> 
> (In reply to comment #9)
> > Just to note that explicitly: g-v-c is right in showing the scale up to 150%,
> since digital amp is often quite useful.    
> It would be useful if the input to that digital amp wasn't clipped to all hell.    

If you ever played a DVD you might have noticed that they usually are recorded at a very low volume level and digital amp often does *not* result in clipping and distortion. For those cases we do allow it.

Comment 14 Łukasz Lis 2010-01-16 15:40:32 UTC
(In reply to comment #13)
> (In reply to comment #12)
> 
> ALSA does not define what 0dB means. Some drivers set 0dB to max amp, others to
> max amp with no clipping. Others set it so that it reflects some "sane" output
> level, i.e. some defined output voltage. Others do the same but pick a
> different output voltage, since there is no standard for it. For even others
> 0dB means "not amplified".
> 
> So, there is really no defined meaning what 0dB refers to. PA now shifts that
> all so that 0dB is always max hw amplification. But because 0dB often actually
> *does* have a meaning, but which is very much card dependant we do export that
> value and call it "base".
> 

It would be nice if the volume controls limited themselves automatically to the usable range, since composite volume control took that control from me. 


> > Even if values a little above 0 dB don't cause clipping this would, at least in
> > my case, make the whole volume range usable. Currently, only a third is usable
> > and that gives me 3 values:
> >   0% mute
> >  17% medium
> >  30% loud and clipped
> > >30% unusable
> 
> 3 values? There should be enough selection between 0-30%?
> 
> So are you complaining that too much of the full scale is already in the
> clipping range?

Yes. Over 70% percent of the range is clipped, as I've mentioned several times before.

> > (In reply to comment #9)
> > > Just to note that explicitly: g-v-c is right in showing the scale up to 150%,
> > since digital amp is often quite useful.    
> > It would be useful if the input to that digital amp wasn't clipped to all hell.    
> 
> If you ever played a DVD you might have noticed that they usually are recorded
> at a very low volume level and digital amp often does *not* result in clipping
> and distortion. For those cases we do allow it.    

You also allow it for cases where it _does_ result in clipping.


Note You need to log in before you can comment on or make changes to this bug.