Use sendspin built-in volume control for instant response#15
Merged
marcelveldt merged 2 commits intomusic-assistant:mainfrom Mar 2, 2026
Merged
Use sendspin built-in volume control for instant response#15marcelveldt merged 2 commits intomusic-assistant:mainfrom
marcelveldt merged 2 commits intomusic-assistant:mainfrom
Conversation
Use sendspin's lock-free GainControl for software volume instead of only supporting hardware (OS-level) volume. The player mode is configurable in settings (hardware/software/disabled). Software mode applies a perceptual gain curve in the audio callback for instant, click-free response. Key changes: - Add volume mode setting (hardware/software/disabled) to settings UI - Route volume/mute commands to SyncedPlayer when in software mode - Track volume/mute state across player recreations (format changes) - Always echo volume state back to server to prevent slider desync - Pass initial volume/mute to SyncedPlayer constructor Note: Cargo.toml temporarily points to local sendspin-rs path for development. Will be switched back to git dependency before merge. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Guard volume_change_rx on Hardware mode only - Extract build_volume_state_msg() and save_volume_state() helpers - Consolidate redundant hardware volume reads at connection start - Persist software volume and mute state across reconnects - Add error handling with revert for volume mode changes in settings UI - Add restart warning text for volume mode dropdown - Log when volume commands are ignored in disabled mode - Add settings tests for software_volume and muted fields Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
709428d to
d6c9d00
Compare
Contributor
Author
|
Alright! I've been testing and iterating on this, along with Sendspin-rs changes, for a few days. The Sendspin-rs PR was merged and is available to build against now. I would love some feedback, if anyone has a chance to review this. |
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.
Replace the app-side SoftwareGainState (which applied gain before enqueue, causing ~2s latency) with sendspin's new GainControl that applies gain in the cpal output callback. Volume and mute changes now take effect instantly.
Depends on: Sendspin/sendspin-rs#10
NOTE: I tested this locally against the sendspin-rs in that PR but until that PR is merged, this code won't build. And even after, I'll need to update the Cargo.lock. So I'm marking this as DRAFT for now. But testing should be as easy as checking out the branch in the sendspin-rs PR, pointing the src-tauri/Cargo.toml to the local copy and building.