Commit d4d30c9
Scope ALSA
`AlsaVolumeController.get_state()` could parse the wrong value on mixer
elements that expose both Capture and Playback channels, because `amixer
sget` output was not constrained to Playback. This change makes
`get_state()` explicitly read Playback state and locks that behavior
with focused tests.
- **Playback-only ALSA state read**
- Updated `get_state()` to call:
- `amixer -M -c <card> sget <element> playback`
- This aligns read-path behavior with `set_state()` (already using
`playback`) and avoids capture-line ambiguity in mixed controls.
- **Regression coverage for mixed-channel elements**
- Added a targeted test asserting `get_state()` invokes `sget ...
playback`.
- Updated existing command expectation in ALSA controller tests to
include the playback qualifier.
```python
proc = await asyncio.create_subprocess_exec(
"amixer",
"-M",
"-c",
self._card,
"sget",
self._element,
"playback",
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE,
)
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: balloob <1444314+balloob@users.noreply.github.com>get_state() to Playback channels on mixed Capture/Playback controls (#237)1 parent ccb2bfd commit d4d30c9
2 files changed
Lines changed: 26 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
274 | 298 | | |
275 | 299 | | |
276 | 300 | | |
| |||
422 | 446 | | |
423 | 447 | | |
424 | 448 | | |
425 | | - | |
| 449 | + | |
426 | 450 | | |
427 | 451 | | |
428 | 452 | | |
| |||
0 commit comments