Change device "master volume" to be the max of all channels instead of the avg
ClosedPublic

Authored by Zren on Jan 8 2018, 2:47 AM.

Details

Summary

When we use the avg, it's very easy to "boost" the "right speaker" over 100%.

Before this patch, if you set the left channel to 50% and leave the right channel at 100% (via pavucontrol), the "master channel" will be the average of 75%. If you then raise the "master channel" by 10%, you raise the right channel to 110%.

Bug: 388553


https://bugs.kde.org/show_bug.cgi?id=388553

Before: https://streamable.com/2kp7m
After: https://streamable.com/5n56s

Test Plan

Installed pavucontrol. Unlocked the channels. See "After" video.

Diff Detail

Repository
R115 Plasma Audio Volume Applet
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Zren created this revision.Jan 8 2018, 2:47 AM
Restricted Application added a project: Plasma. · View Herald TranscriptJan 8 2018, 2:47 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
Zren requested review of this revision.Jan 8 2018, 2:47 AM
drosca added a subscriber: drosca.Jan 8 2018, 7:07 PM

Well, this was actually intended to work like that. In case of split channels, I would say "avg" describes the merged volume better than "max", because with "max" you can have situation where one channel is 0%, second is 100% and merged volume now shows 100% which is wrong (is it?).

Zren added a comment.Jan 9 2018, 3:51 AM

one channel is 0%, second is 100% and merged volume now shows 100%

If you lower the volume on a speaker, you care more about what the volume of the louder speaker is. It's weird if the OSD shows 50% when the right speaker is blaring at 100% and annoying my neighbours. You'd need to do mental math that the right speaker is +50% (or whatever it is).


Most OSes usually have a master channel slider, and a second slider for the left/right balance.

  1. KMix apperently used avg in the OSD I believe (I should probably install it and confirm). When the channels were split, it would have 2 sliders (and hide the "master") I think.
  1. Windows 10 uses the max (https://www.youtube.com/watch?v=_9Zx4QMucx4#t=1m03)
  2. Can't find an OS X example. I think it uses a "Left <-> Right" channel balance slider (https://www.youtube.com/watch?v=UZxhBio-_18), but you can also edit the individual sliders too I think somehow.
  3. Mate (Gnome 2?) uses master volume slider + a "Left <-> Right" channel balance slider.
  4. Gnome 3 ?
  5. Unity?

Correct me if I'm wrong, but I believe a "Left <-> Right" channel balance slider means at least 1 channel is always at a 100% ratio of the master volume. Since the center means both speakers are at 100%.

  • =========O========= LeftRatio = 100% / RightRatio = 100%
  • O================== LeftRatio = 100% / RightRatio = 0%
  • ==================O LeftRatio = 0% / RightRatio = 100%
  • ==============O==== LeftRatio = 50% / RightRatio = 100%
  • ====O============== LeftRatio = 100% / RightRatio = 50%

This means the "master volume" represents the "max" of all the channels.

drosca accepted this revision.Jan 9 2018, 4:40 PM

Alright, thanks for the writeup.

This revision is now accepted and ready to land.Jan 9 2018, 4:40 PM

Do you have dev account?

This revision was automatically updated to reflect the committed changes.
Zren added a comment.Jan 10 2018, 5:15 PM

Yes I do. Sorry I didn't get to push it yesterday. Thanks for approving the change!

Hmm, it seems the bot didn't recognize "Bug: 388553" in the commit message. Looks like I need to remember to use all caps next time "BUG: 388553".