/
/
# What does this implement/fix? An announcement points the Snapcast group at its own stream, which makes the music stream read as unused. The idle bookkeeping then stopped that stream three seconds later, so switching the group back once the announcement finished landed on a stream with no producer: you hear the snapserver buffer drain, then silence, and playback has to be resumed by hand. Any announcement longer than ~3 seconds hits this. The music stream is now pinned for the duration of the announcement and released afterwards, with a usage re-evaluation so a genuinely idle stream still stops as before. - add `SnapcastMAStream.set_pinned()`, which exempts a stream from the inactivity stop timer - take the pin in `SnapCastPlayer.play_announcement` and release it in a `finally`, followed by `update_stream_usage()` - add a regression test covering the stream outliving an announcement, and the idle stop still firing once the pin is released Note that this fixes the "music never resumes" half of the issue only. Snapcast does not duck music under an announcement, it swaps the stream, and it cannot do otherwise: a snapserver group carries exactly one `stream_id`. The docs' "native support" wording promising the music keeps playing needs a separate correction. **Related issue (if applicable):** - related issue https://github.com/music-assistant/support/issues/6179 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives the label from the ticked box and applies it automatically; the release-notes generator uses that same label to slot this change into the next release notes. --> - [x] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.