Open
Conversation
|
Thanks for trying to fix https://github.com/orgs/music-assistant/discussions/3288 Was wondering, would it be possible to implement also a option to scale the volume ? Something like this:
|
3 tasks
|
Readjusted the mentioned pull request above to only scale volume. |
Member
|
For me personally I don't need min volume, however was someone that requested it, and cant see what it hurts implementing it at the same time. Mute still works. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


FRONTEND CHANGES: music-assistant/frontend#1569
Satisifies: https://github.com/orgs/music-assistant/discussions/3288
Add configurable min/max volume limits per player
Summary
Edge cases and functionality covered
cmd_volume_set — The 0-100 input is linearly mapped to
[min_volume, max_volume]viamin_volume + (volume_level * (max_volume - min_volume)) // 100before reaching the device. Applies to all programmatic and API invocations.cmd_volume_up / cmd_volume_down — Step-based changes still operate in the 0-100 UI range (step sizes of 1-3 depending on position). Scaling happens downstream in _handle_cmd_volume_set, so no special casing is needed here.
External volume changes — When a device reports a volume change (e.g. user pressed a physical volume button, or used a manufacturer app), signal_player_state_update reverse-scales the reported value back to the 0-100 range before it reaches the UI. This keeps the slider position consistent with user expectations regardless of how the volume was changed.
Group volume — Each child player is scaled independently using its own min_volume/max_volume, so a group volume of 80 translates correctly for each member (e.g. a soundbar with max=50 receives 40, a regular speaker with max=100 receives 80).
Config validation — on_player_config_change validates that min_volume <= max_volume and raises InvalidDataError if not.
Falsy value handling — Uses explicit is not None checks rather than truthiness when reading config values, so min_volume=0 (a valid and common default) isn’t incorrectly treated as missing.
Advanced settings — Both config entries are marked as advanced so they don’t clutter the basic player settings for users who don’t need them.
Default behavior unchanged — With defaults of min=0 and max=100, the scaling formula is the identity function, so all existing behavior is preserved.