Scope ALSA get_state() to Playback channels on mixed Capture/Playback controls#237
Merged
Scope ALSA get_state() to Playback channels on mixed Capture/Playback controls#237
get_state() to Playback channels on mixed Capture/Playback controls#237Conversation
Agent-Logs-Url: https://github.com/Sendspin/sendspin-cli/sessions/71814e52-76f6-412e-8f91-988345eb45f7 Co-authored-by: balloob <1444314+balloob@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix alsa_volume.py to read correct Playback volume
Scope ALSA Apr 28, 2026
get_state() to Playback channels on mixed Capture/Playback controls
balloob
approved these changes
Apr 28, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an ALSA parsing ambiguity by ensuring AlsaVolumeController.get_state() queries only Playback channels on mixer elements that expose both Capture and Playback, and adds regression tests to lock in the intended amixer invocation.
Changes:
- Update
AlsaVolumeController.get_state()to callamixer ... sget <element> playbackto avoid mixed-channel ambiguity. - Add a focused test asserting
get_state()includes theplaybackqualifier for mixed Capture/Playback controls. - Update an existing ALSA controller test’s expected
amixer sgetarguments to includeplayback.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
sendspin/alsa_volume.py |
Scopes get_state()’s amixer sget call to Playback channels by appending playback. |
tests/test_alsa_volume.py |
Adds/updates expectations to verify get_state() invokes amixer sget ... playback and remains correct on mixed controls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
AlsaVolumeController.get_state()could parse the wrong value on mixer elements that expose both Capture and Playback channels, becauseamixer sgetoutput was not constrained to Playback. This change makesget_state()explicitly read Playback state and locks that behavior with focused tests.Playback-only ALSA state read
get_state()to call:amixer -M -c <card> sget <element> playbackset_state()(already usingplayback) and avoids capture-line ambiguity in mixed controls.Regression coverage for mixed-channel elements
get_state()invokessget ... playback.