Bug 542437 - pulseaudio messing with multiple volume controls is terrible
Summary: pulseaudio messing with multiple volume controls is terrible
Keywords:
Status: CLOSED DUPLICATE of bug 552310
Alias: None
Product: Fedora
Classification: Fedora
Component: pulseaudio
Version: 12
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-29 19:49 UTC by Nicholas Miell
Modified: 2010-01-07 16:45 UTC (History)
6 users (show)

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


Attachments (Terms of Use)
alsa-info (34.84 KB, text/plain)
2009-11-29 19:49 UTC, Nicholas Miell
no flags Details
Maximum safe volume (9.46 KB, text/plain)
2009-12-03 21:38 UTC, Nicholas Miell
no flags Details
Minimum volume at which things go pear shaped (9.46 KB, text/plain)
2009-12-03 21:39 UTC, Nicholas Miell
no flags Details
before (66.01 KB, image/png)
2010-01-06 20:06 UTC, Nicholas Miell
no flags Details
after (63.09 KB, image/png)
2010-01-06 20:06 UTC, Nicholas Miell
no flags Details

Description Nicholas Miell 2009-11-29 19:49:49 UTC
Created attachment 374603 [details]
alsa-info

Description of problem:
In F11, PulseAudio only touched the master volume control, and everything worked reasonably fine.

In F12, PulseAudio messes with all sorts of different volume controls, and now it is impossible to get the volume decently loud without the speakers clipping.

Version-Release number of selected component (if applicable):
pulseaudio-module-bluetooth-0.9.21-1.fc12.x86_64
pulseaudio-libs-zeroconf-0.9.21-1.fc12.x86_64
pulseaudio-libs-0.9.21-1.fc12.i686
pulseaudio-module-x11-0.9.21-1.fc12.x86_64
pulseaudio-0.9.21-1.fc12.x86_64
pulseaudio-gdm-hooks-0.9.21-1.fc12.x86_64
pulseaudio-utils-0.9.21-1.fc12.x86_64
pulseaudio-libs-0.9.21-1.fc12.x86_64
pulseaudio-module-gconf-0.9.21-1.fc12.x86_64
pulseaudio-libs-glib2-0.9.21-1.fc12.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Turn the volume up to something that can be heard across the room.
  
Actual results:
Speakers start clipping

Expected results:
Speakers don't clip.

Additional info:
00:05.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 07)

Comment 1 Adam Williamson 2009-12-03 18:55:44 UTC
can you say exactly which channels PA is controlling, and at what levels they start to clip?

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 2 Nicholas Miell 2009-12-03 20:14:54 UTC
It messes with Master, PCM and (with lower volume levels) Surround, Center and LFE. The last three don't seem to actually do anything.

Honestly, I don't really get what exactly PulseAudio is trying to do.

What I typically did in the pre-PA world was set PCM to 75% or so and then control the volume using Master, and this carried over fine to PA in F11, where PA only touched Master.

In F12, my typical listening levels (master 75%, pcm 75%) translate to something like 25% in the PA volume slider, max volume (master 100%) is PA 50%, and as I increase the PA volume beyond 50%, it starts adjusting PCM higher than 75% and my speakers start buzzing/clipping.

Comment 3 Adam Williamson 2009-12-03 20:28:49 UTC
what PA tries to do is produce a composite volume control from all available controls that do essentially the same thing - like Master and PCM - so that you get more fine-grained volume control.

I don't think it should be touching the surround / center / LFE channels when you try to just set the regular volume, that seems like a bug. What happens with Master / PCM sounds like a problem in the volume information provided by ALSA to PA: PA thinks it's safe to set PCM higher than '75%' (PA actually uses dBA volume information, not the percentages), but it isn't.

Can you provide the output of 'amixer -c0' - assuming your real sound card is ALSA card 0 - both at the highest volume settings where no clipping occurs, and the lowest volume settings where clipping does occur? Thanks.

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 4 Nicholas Miell 2009-12-03 21:38:36 UTC
Created attachment 375923 [details]
Maximum safe volume

Comment 5 Nicholas Miell 2009-12-03 21:39:09 UTC
Created attachment 375924 [details]
Minimum volume at which things go pear shaped

Comment 6 Nicholas Miell 2009-12-03 21:40:10 UTC
And the difference between the two PCM settings

--- maxsafe.txt	2009-12-03 13:36:46.000000000 -0800
+++ minclip.txt	2009-12-03 13:37:00.000000000 -0800
@@ -45,8 +45,8 @@
   Playback channels: Front Left - Front Right
   Limits: Playback 0 - 31
   Mono:
-  Front Left: Playback 23 [74%] [0.00dB] [on]
-  Front Right: Playback 23 [74%] [0.00dB] [on]
+  Front Left: Playback 24 [77%] [1.50dB] [on]
+  Front Right: Playback 24 [77%] [1.50dB] [on]
 Simple mixer control 'Front',0
   Capabilities: cvolume cswitch cswitch-joined
   Capture channels: Front Left - Front Right

Comment 7 Adam Williamson 2009-12-03 22:37:00 UTC
hmm. aiui PA is supposed to max out at 0dB, so this may be a PA problem indeed. assigning to Lennart for now.

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 8 Florian Fahr 2009-12-05 15:55:52 UTC
My two cents about this issue:

I don't know about the energy saving capabilities of the "regular" volume sliders (Master, Surround, Center, LFE). If there is no implication altogether, then I'd suggest that Pulseaudio should leave them alone altogether and should only mess with the PCM slider . Since gnome-volume-control has a nice indicator of where 100% is, this 100% should set the PCM value to 74, because beyond that it'll start amplifying (alsamixer shows this, by the way).

On the other hand, if there is an energy-saving aspect to those controls, then Pulseaudio should of course leave PCM alone at 74 and instead control the four other sliders (Master, Surround, Center, LFE) _proportionally_, because at least on my sound card (an 82801DB-ICH4) the "Surround" slider controls the volume of the rear speakers independently from the Master volume (I can still hear them when the Master volume slider is at 0). Now, when gnome-volume-control has its volume slider at 100%, all sliders except PCM should be at 100%. Beyond that point it should move that slider between 74% and 100%.

Comment 9 Florian Fahr 2009-12-05 16:07:44 UTC
On second thought, in case that there aren't any energy saving implications, Pulseaudio should leave ALL sound card volume sliders alone and instead modify the volumes of the streams itself. The hardware volume controls should be set to a safe standard value (Gain of 0.00dB everywhere) and the "real" work should be done by Pulseaudio itself (except for cases where the Master volume is set to >100).

Comment 10 Lennart Poettering 2009-12-17 15:34:42 UTC
Please don't speak of percentages when referring to volumes, as they have almost no defined meaning. Use dB instead.

In your case the dB information supplied by your audio driver seems to be incorrect.

Also, please read this:

http://pulseaudio.org/wiki/PulseAudioStoleMyVolumes

Most likely the 0dB level is simply shifted for your cards. In "alsamixer -c0" 0dB should be at a level where no clipping occurs. If that is not the case please tell us exactly which control needs to be shifted in which way.

Comment 11 Florian Fahr 2009-12-25 12:08:23 UTC
Actually, no. Alsamixer reports this correctly, but Pulseaudio still goes beyond the 0.0dB threshold.

Comment 12 Nicholas Miell 2009-12-31 23:12:31 UTC
0 dB is the value above which clipping occurs.

If I raise the PulseAudio volume above 63 (according to alsamixer), PA raises the card's PCM volume above 0 dB.

Comment 13 Lennart Poettering 2010-01-04 17:50:39 UTC
So, is there any problem to fix here?

Comment 14 Nicholas Miell 2010-01-04 18:36:14 UTC
Yes. The problem is as follows:

If I raise the PulseAudio volume high enough, PA raises my cards PCM volume above 0.0 dB and the audio starts clipping.

This is a problem because:

1) Clipping is bad.

2) Having to look at alsamixer -c0 to verify that my PCM volume is still 0.0 dB or lower whenever I raise the PA volume is bad.

Comment 15 Lennart Poettering 2010-01-06 13:38:52 UTC
"high enough"? What do you mean? g-v-c shows the point where no clipping occurs, so if you stay below that everything is fine. If you move the slider beyond that you will get clipping, so don't do that.

Originally we didn't allow setting the volume to where we assume that clipping happens. Thing is that people complained and rightly so. So now we show the full scale and simple mark where max amp with no clipping is on it.

Comment 16 Florian Fahr 2010-01-06 18:54:30 UTC
Sorry, but that's only partially correct. G-v-c shows some point where it says "Here's 100%" which implies that beyond that point the sound card starts amplifying and probably clipping. Also nice thing that you cannot go beyond that point with your ultimedia keys or via flat volumes However, that magical 0.0dB mark exported by amixer is reached earlier (at 74% in g-v-c SP34K).

Therefore please re-open that bug.

Comment 17 Nicholas Miell 2010-01-06 19:56:25 UTC
I'm not raising the volume above 100%, I'm raising it above 63% or so.

Comment 18 Nicholas Miell 2010-01-06 20:06:01 UTC
Created attachment 382063 [details]
before

Here are some pictures, since words don't seem to be enough.

Comment 19 Nicholas Miell 2010-01-06 20:06:32 UTC
Created attachment 382064 [details]
after

Comment 20 Lennart Poettering 2010-01-07 16:45:40 UTC
Yes, unfortunately g-v-c does not show the "base" mark on output volume sliders right now, only for input. That needs to be fixed. See bug 552310

*** This bug has been marked as a duplicate of bug 552310 ***


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