Bug 315920 - capture volume is set to very high amplification
Summary: capture volume is set to very high amplification
Status: RESOLVED FIXED
Alias: None
Product: kmix
Classification: Applications
Component: Backend: Pulseaudio (show other bugs)
Version: 4.3
Platform: Ubuntu Linux
: NOR grave
Target Milestone: ---
Assignee: Colin Guthrie
URL:
Keywords:
: 316957 317002 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-02-28 17:33 UTC by Matthias Kretz
Modified: 2013-03-19 12:01 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.2


Attachments
screenshot of kmix and pavucontrol initially (125.00 KB, image/png)
2013-02-28 18:29 UTC, Matthias Kretz
Details
screenshot of kmix and pavucontrol after unchecking "capture" (130.39 KB, image/png)
2013-02-28 18:30 UTC, Matthias Kretz
Details
fix the bug: code was referencing incorrect Volume object (2.82 KB, patch)
2013-03-04 08:05 UTC, Matthias Kretz
Details
Alternative fix for the issue. (2.00 KB, text/plain)
2013-03-12 12:20 UTC, Colin Guthrie
Details
Screenshot of capture "icon" (23.04 KB, image/png)
2013-03-14 10:20 UTC, Colin Guthrie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Kretz 2013-02-28 17:33:15 UTC
on all capture devices and streams, (un)checking the "capture" checkbox or moving the slider makes the capture volume jump to somewhere in the range of 200000% and 270000%. Pulseaudio happily creates loud static as a result. The only workaround right now is not to touch kmix and control volume via the GTK tools.

Reproducible: Always
Comment 1 Colin Guthrie 2013-02-28 17:57:12 UTC
Hmm, there is a capture checkbox? Weird. All stream in PA backend should be modelled as "Playback" items (even the capture ones)... wonder when this changed...
Comment 2 Matthias Kretz 2013-02-28 18:29:54 UTC
Created attachment 77652 [details]
screenshot of kmix and pavucontrol initially
Comment 3 Matthias Kretz 2013-02-28 18:30:29 UTC
Created attachment 77653 [details]
screenshot of kmix and pavucontrol after unchecking "capture"
Comment 4 Matthias Kretz 2013-02-28 18:33:07 UTC
It seems as if the capture checkbox simply tries to pull the slider down to 0% to achieve the effect. So maybe this is as simple as finding the place where the request for a certain capture amplification is lost and replaced by garbage.
Comment 5 Colin Guthrie 2013-02-28 18:35:29 UTC
Hmm, I wonder if "capture" is just a cosmetic thing and it really is a playback control and it's the "mute" ticky box. Not looked at the source for ages so hard to say without poking.

At first glance it looks like it could be some mishandling of the mute functionality at some level. At least it's the capture volume that's doing this and not the output volume :s
Comment 6 Matthias Kretz 2013-03-04 08:05:39 UTC
Created attachment 77726 [details]
fix the bug: code was referencing incorrect Volume object

I prepared the commit against KDE/4.10. Let me know and I'll commit to 4.10 and master.
Comment 7 Colin Guthrie 2013-03-12 12:02:59 UTC
While the patch seems sensible, I'm still confused as to why things were changed....

As I mentioned above, all streams and devices were originally represented by playback objects, and capture stuff was never used. This was originally because the "capture" stuff had a built in premise that only one device could be marked as capture at any given time and they had no mute button.

I want to be able to mute my Mic or even just a single stream. I would personally favour finding whatever commit changed the capture devices and streams to use capture volumes and revert it. This should both fix this issue and also give the mute buttons back.

Of course if others feel differently, then this patch looks sensible enough.
Comment 8 Colin Guthrie 2013-03-12 12:20:30 UTC
Created attachment 77979 [details]
Alternative fix for the issue.

It seems the capture volume was done in 5c57272a along with a comment to check with me if it was correct.... it isn't :) 

Sorry if I missed you asking me about that Christian :(

Anyway the applied patch appears to work also and return the ability to mute my mic. Can someone else confirm that this is OK and that there are no other unexpected side effects (i.e. if there was a valid reason to switch to capture volumes that I've missed).
Comment 9 Colin Guthrie 2013-03-12 12:21:24 UTC
(In reply to comment #8)
> Anyway the applied patch appears to work also and return the ability to mute
> my mic.

s/applied patch/attached patch/
Comment 10 Volkan 2013-03-13 15:42:05 UTC
Yes I have the same problem. I tried audacity to record but whatever the level change is, it does not effect real microphone recording level.

I used alsamixer to fix it. It seems it is maximizing the `Mic Boost`.
Comment 11 Colin Guthrie 2013-03-13 15:51:09 UTC
Pulseaudio will control all the underlying ALSA mixer elements then add it's own software amplification as requested to get the desired level. The fact it's controlling Mic Boost is simply a detail resulting from PA controlling all the mixer elements.

I'm pretty sure my patch is correct, but I'd like Christian or Matthias' feedback first!
Comment 12 Matthias Kretz 2013-03-14 10:11:28 UTC
I just tested your patch. It solves my issue. Also in my patch the "mute" 
button didn't work. In yours it does. The button just has the wrong icon. 
Maybe that was the reason to switch to a record control? In any case, a fix 
for this issue is way more important than the correct icon.
Comment 13 Colin Guthrie 2013-03-14 10:20:45 UTC
Created attachment 78055 [details]
Screenshot of capture "icon"

Hmm, what icon do you see?

For me capture "icon" is really broken... it's not even an icon, but a ticky box. The "Mute" icon on the other hand is just a speaker icon (which I guess is wrong, but I've never really thought about it before until you said it!!)

Anyway, I think this is OK to push so I'll do that now and CP it to the 4.10 branch.
Comment 14 Colin Guthrie 2013-03-14 10:21:27 UTC
Git commit 64afb1660b808ea8f1ba3d8d54a5db1cfe5a2acd by Colin Guthrie.
Committed on 12/03/2013 at 13:17.
Pushed by cguthrie into branch 'master'.

pulse: Revert the use of capture volumes added in 5c57272a.

Using capture controls does not give proper mute handling.
This is why all streams in the PA backend are treated as 'playback'
even if they are technically capture streams/devices.

This fixes two problems:
 1. You cannot mute mics or recording streams
 2. Capture volume is set to crazy high values

M  +2    -6    backends/mixer_pulse.cpp

http://commits.kde.org/kmix/64afb1660b808ea8f1ba3d8d54a5db1cfe5a2acd
Comment 15 Colin Guthrie 2013-03-14 10:22:42 UTC
Git commit 22f9ea6a1d6dbf530c8593af7b2331a83c990e37 by Colin Guthrie.
Committed on 12/03/2013 at 13:17.
Pushed by cguthrie into branch 'KDE/4.10'.

pulse: Revert the use of capture volumes added in 5c57272a.

Using capture controls does not give proper mute handling.
This is why all streams in the PA backend are treated as 'playback'
even if they are technically capture streams/devices.

This fixes two problems:
 1. You cannot mute mics or recording streams
 2. Capture volume is set to crazy high values
(cherry picked from commit 64afb1660b808ea8f1ba3d8d54a5db1cfe5a2acd)

M  +2    -6    backends/mixer_pulse.cpp

http://commits.kde.org/kmix/22f9ea6a1d6dbf530c8593af7b2331a83c990e37
Comment 16 Matthias Kretz 2013-03-14 11:42:33 UTC
On Thursday 14 March 2013 10:20:45 you wrote:
> For me capture "icon" is really broken... it's not even an icon, but a ticky
> box. The "Mute" icon on the other hand is just a speaker icon (which I
> guess is wrong, but I've never really thought about it before until you
> said it!!)

True, the capture checkbox is not really better. Maybe the icon could be a red 
circle or microphone for capture?
 
> Anyway, I think this is OK to push so I'll do that now and CP it to the 4.10
> branch.

Yes. Thanks!
Comment 17 Volkan 2013-03-14 13:36:00 UTC
By the way, currently I was not using the PulseAudio, but was having the same problem with it, too. Will the problem also solve this issue or the patch is only related to pulseaudio?

Because when I install pulseaudio, I cannot even talk via Skype, Hangout or SIP programs.
Comment 18 Colin Guthrie 2013-03-14 13:41:22 UTC
(In reply to comment #17)
> By the way, currently I was not using the PulseAudio, but was having the
> same problem with it, too. Will the problem also solve this issue or the
> patch is only related to pulseaudio?

This patch only relates to the PulseAudio backend in Kmix.

> Because when I install pulseaudio, I cannot even talk via Skype, Hangout or
> SIP programs.

Something is likely busted with your setup as I happily use Skypes and Google+ hangouts quite frequently. While I've not used it for a while, Empathy with SIP also works great for me.
Comment 19 Volkan 2013-03-14 13:46:11 UTC
(In reply to comment #18)
> (In reply to comment #17)
> > Because when I install pulseaudio, I cannot even talk via Skype, Hangout or
> > SIP programs.
> 
> Something is likely busted with your setup as I happily use Skypes and
> Google+ hangouts quite frequently. While I've not used it for a while,
> Empathy with SIP also works great for me.

Maybe it is not OK to write here, but could you attach your PulseAudio conf file here, maybe I could solve my PulseAudio problem, too?
Comment 20 Colin Guthrie 2013-03-14 14:59:01 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > (In reply to comment #17)
> > > Because when I install pulseaudio, I cannot even talk via Skype, Hangout or
> > > SIP programs.
> > 
> > Something is likely busted with your setup as I happily use Skypes and
> > Google+ hangouts quite frequently. While I've not used it for a while,
> > Empathy with SIP also works great for me.
> 
> Maybe it is not OK to write here, but could you attach your PulseAudio conf
> file here, maybe I could solve my PulseAudio problem, too?

This is really something to take up with your distro. As I'm a PulseAudio developer and maintain PulseAudio in Mageia distribution, I can only really offer support if that's the setup you use. I'm not familiar with how other distributions intend the setup to work, so my advice may not apply. My setup however is basically just what we do Out of the Box on Mageia. Nothing special involved.
Comment 21 Colin Guthrie 2013-03-18 09:42:46 UTC
*** Bug 316957 has been marked as a duplicate of this bug. ***
Comment 22 Jekyll Wu 2013-03-19 02:50:22 UTC
*** Bug 317002 has been marked as a duplicate of this bug. ***
Comment 23 Jekyll Wu 2013-03-19 12:01:50 UTC
*** Bug 317024 has been marked as a duplicate of this bug. ***