Repository navigation
Add --fixed-volume for an output whose level is set elsewhere - #88
Merged
chrisuthe merged 1 commit intoOct 15, 2026
Merged
Conversation
With the flag the player plays at full gain, unmuted, and withholds volume and mute from the server: neither appears in client/state or supported_commands, and a server command for either is ignored. A volume remembered in the state file is kept but not restored, with one INFO line saying so, and returns once the flag is dropped. status prints the player volume as fixed. vol and mute on the control socket are group commands and stay as they are.
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.
Adopts sendspin-cpp#203 (
set_volume_adjustable/set_mute_adjustable, in the v0.9.5 pin) as one switch,--fixed-volume/fixed-volume = true, for an output whose level is set elsewhere, such as a line-out into an amplifier.What changes
volumenormutedinclient/stateand lists neither command insupported_commands, so a server's slider for this player disappears rather than silently doing nothing; a command for either is ignored by the library. A mute the server could still set would silence a fixed level, which is why the two go together.PlayerListener::fix_volume()pins the sink and marks the sourceVolumeSource::Fixed;update_volume(100)/update_muted(false)keep the role reporting what the sink applies. The listener'son_volume_changed/on_mute_changedare guarded while fixed, so a command can never reach the sink or the state file.statusprintsplayer volume: 100 (fixed; the server cannot set it).volandmuteon the control socket are untouched. They are group commands to the server, refused only on what the server publishes.--help, README, the config key table, Controlling the Player, and the example config.Verification
ctest: 519/519 apart fromConfigMerge.AConfiguredControlSocketIsAbsolutizedUnderDaemonize, which fails only because this worktree's socket path is 105 bytes; it passes from a short directory.mayberefused with theallow-unpairedwording), the status note verbatim, and a listener test that with a remembered volume a server volume or mute command under the flag leaves the state file byte-identical, next to one showing the same commands apply and persist without it.scripts/format.sh --check,scripts/smoke_test.shand a-DSENDSPIN_CLI_WERROR=ONbuild are clean.volume = 40,muted = truein the state file: with the flag, the log names the ignored value,statusprints the fixed note and the file is byte-identical after the run; without it,Restored volume 40 (muted)andstatusread as before.