Repository navigation
Commit 9d81b05
Fall back to software volume when PulseAudio is unreachable (#143)
## Summary
- Add `async_check_available()` to `hardware_volume.py` that tests
actual PulseAudio connectivity, not just library import
- In `cli.py`, use the runtime check before starting — if PulseAudio
isn't reachable, disable hardware volume upfront with a warning
- In `audio_connector.py`, add a safety net in `read_initial_volume()`
so if PulseAudio fails at runtime, it falls back to software volume
instead of crashing
Fixes #141
## Test plan
- [ ] On Linux with PulseAudio running: hardware volume should work as
before
- [ ] On Linux without PulseAudio running: should log a warning and fall
back to software volume
- [ ] On Linux without `pulsectl-asyncio` installed + `--hardware-volume
true`: should still raise a clear error asking the user to install the
library
- [ ] Daemon mode auto-detection: should only enable hardware volume if
PulseAudio is actually reachable
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1ac529a commit 9d81b05
2 files changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
600 | 601 | | |
601 | 602 | | |
602 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
603 | 608 | | |
604 | 609 | | |
605 | 610 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
26 | 47 | | |
27 | 48 | | |
28 | 49 | | |
| |||
0 commit comments