Set maximum volume of streams properly even if the user has configured a maximum volume <100% in the applet.
ClosedPublic

Authored by kishoreg on Sep 7 2019, 11:18 AM.

Details

Summary

Recently, I submitted this patch (https://phabricator.kde.org/D23082) which had a side-effect which I hadn't noticed at the time: If the user-configured maximum volume for the applet was less than 100%, it would also use this as the maximum value on the sliders for all streams.

Before this patch:
Devices tab:


Applications tab:

I have set the maximum volume in the applet settings to be 15%, and this setting is applied to all the sliders. Even the sliders which are intially at 100% get their maximum reset to 15% as soon as I interact with them. Note, for example, how even the microphone volume is capped at 15%.

After this patch:
Devices tab:


Applications tab:

The maximum volume is still set to 15% in the applet settings, but this is does not affect the maximum values of the sliders for the device or application streams.

Test Plan
  1. Right-click on applet > 'Configure audio
  2. Try to set maximum volume < 100% and click 'OK'.
  3. Scroll on the systray icon to change maximum volume. Check if it is limited to the configured maximum.
  4. Open the applet and check that all the streams are not limited to the value to the value the user configured in the applet.

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.
kishoreg created this revision.Sep 7 2019, 11:18 AM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 7 2019, 11:18 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
kishoreg requested review of this revision.Sep 7 2019, 11:18 AM
kishoreg edited the summary of this revision. (Show Details)
kishoreg edited the summary of this revision. (Show Details)
davidedmundson accepted this revision.Sep 7 2019, 3:07 PM
This revision is now accepted and ready to land.Sep 7 2019, 3:07 PM

Doesn't this kind of defeat the purpose of the original change? If you can easily override the maximum volume that you've deliberately set, then what's the point?

kishoreg added a comment.EditedSep 8 2019, 10:48 AM

The problem is that the original patch was changing the maximum range of the sliders for application streams and microphones as well. This seemed a bit counter-intuitive, as for example capping the volumes of both the speaker and the music player at 15% would lead to an 'effective volume' of 2.25%. There was also the issue that the slider maximum ranges for applications displayed this weird behaviour of having the reduced range applied only after the user interacted with them. In addition, the behaviour was inconsistent with the behaviour when the maximum volume is >100% (it doesn't automatically apply 'raise maximum volume' to application streams, for instance). After applying this patch, the limit only applies to the hardware volume keys and scrolling on the tray icon, which is also consistent with the behaviour when the limit is set to >100%.

All right, makes sense.

This revision was automatically updated to reflect the committed changes.