Summary: | Widget tooltip shows wrong volume level | ||
---|---|---|---|
Product: | [Plasma] plasma-pa | Reporter: | Riccardo Robecchi <sephiroth_pk> |
Component: | applet | Assignee: | David Rosca <nowrep> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nate, plasma-bugs |
Priority: | NOR | ||
Version: | 5.21.4 | ||
Target Milestone: | --- | ||
Platform: | Neon | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-pa/commit/26994d67552d21ce41f641de473be2b7b3509834 | Version Fixed In: | 5.21.5 |
Description
Riccardo Robecchi
2021-04-08 18:44:06 UTC
Will be fixed with https://invent.kde.org/plasma/plasma-pa/-/merge_requests/57. Git commit dedcbccf753545795c0194fd98cca081e47baf70 by Chris Holland. Committed on 20/04/2021 at 02:56. Pushed by ngraham into branch 'master'. Increment volume by percent instead of a constant volumeStep Jumping by a fixed volumeStep has issues as the value is rounded. 65536/100 = 655.36 65536/100*5 = 3276.8 volumeStep = round(3276.8) = 3277 The floor() patch has an easy to test bug when jumping from 100% to 94% instead of 95% since volumeStep is rounded up. Eg: 65536 => 62259 (-3277) 100% => 94% (-6%) The original round() logic also has issues when volume is around: f(x) = (65536/100) / 2 + (65536/100) * x amixer sset Master 983 # f(1)=983.04 Eg: 983 => 4260 (+3277) 1% => 7% (+6%) This patch adds changeVolumeByPercent(volumeObject, deltaPercent) to increment any sink or source by a %volume. It also moves the common code in increaseVolume() and decreaseVolume() into a new function. Related: bug 434769 FIXED-IN: 5.21.5 M +33 -32 applet/contents/ui/main.qml https://invent.kde.org/plasma/plasma-pa/commit/dedcbccf753545795c0194fd98cca081e47baf70 Git commit 26994d67552d21ce41f641de473be2b7b3509834 by Nate Graham, on behalf of Chris Holland. Committed on 20/04/2021 at 15:42. Pushed by ngraham into branch 'Plasma/5.21'. Increment volume by percent instead of a constant volumeStep Jumping by a fixed volumeStep has issues as the value is rounded. 65536/100 = 655.36 65536/100*5 = 3276.8 volumeStep = round(3276.8) = 3277 The floor() patch has an easy to test bug when jumping from 100% to 94% instead of 95% since volumeStep is rounded up. Eg: 65536 => 62259 (-3277) 100% => 94% (-6%) The original round() logic also has issues when volume is around: f(x) = (65536/100) / 2 + (65536/100) * x amixer sset Master 983 # f(1)=983.04 Eg: 983 => 4260 (+3277) 1% => 7% (+6%) This patch adds changeVolumeByPercent(volumeObject, deltaPercent) to increment any sink or source by a %volume. It also moves the common code in increaseVolume() and decreaseVolume() into a new function. Related: bug 434769 FIXED-IN: 5.21.5 (cherry picked from commit dedcbccf753545795c0194fd98cca081e47baf70) M +33 -32 applet/contents/ui/main.qml https://invent.kde.org/plasma/plasma-pa/commit/26994d67552d21ce41f641de473be2b7b3509834 |