Skip to content

Proposal: an announcement stream role with ducking (music continues under the clip) #305

Open

Description

@kiwipaulrob

Proposal, not a PR — raising this as an issue first because it defines new protocol surface, and I'd rather agree the shape before writing against it.

What I'm proposing

A way for a server to play a short clip (an announcement, TTS, alarm) over a player's running audio, with the music continuing at reduced volume rather than stopping.

Why this seems to be anticipated already

The spec already sanctions the concept in two places, without defining a role for it:

  • messaging.md L267 — server-to-client stream roles are player, artwork, visualizer, "or an application-specific role with such a stream".
  • messaging.md L271 — on removal of a stream role, the client releases "temporary output effects applied by that role, such as ducking."

So ducking is named as a legitimate output effect, and application-specific stream roles are explicitly allowed. What's missing is a defined role that uses them. The player role itself has no effect hook — it covers volume, mute, timing and format only.

The problem this solves

I run Music Assistant against a SendSpin player (moOde, sendspin client). Announcements today are stop-and-resume: playback leaves playing, the clip plays, playback returns. Measured on the HA side, the entity transitions playing → idle → playing across each clip — there is no mixing and no ducking.

The reason is that MA has no protocol-level announcement path at all. Its SendSpin provider relays announcements through Home Assistant instead, and that relay is restricted to one manufacturer:

esphome_players = [p for p in players if p.device_info.manufacturer == "ESPHome"]

"ESPHome devices support announcements natively, but that capability is only reachable through the HA API. Players are correlated by MAC address (the Sendspin client id)."

So on any non-ESPHome SendSpin client the PLAY_ANNOUNCEMENT capability is never advertised, and no announcement is possible at all — not even stop-and-resume.

Relevant prior art in this org

sendspin-python-cli #248 (closed) is the closest existing work — a user ran MA play_announcement against a plain Pi sendspin daemon client and reported the startup gap. Its closing comment concluded:

"the multi-zone sync issue … is architectural in upstream Music Assistant (MA dispatches play_announcement per-member rather than leveraging Sendspin's native group pts sync)"

That's a separate defect, but it confirms announcements are a real SendSpin use case and that the missing piece is protocol-level.

Sketch of a shape (very open to alternatives)

  • A versioned role, e.g. announcement@v1, advertised by clients that can mix.
  • The server sends the clip as its own stream with a duck instruction (target gain or percentage) rather than a stop.
  • The player applies gain reduction to the player stream, mixes the clip, and restores on stream/end / stream/clear.
  • Removal of the role releases the duck, consistent with L271.

The open design question is whether this is a new role or an effect attached to the player role — the spec's own wording ("temporary output effects applied by that role") could support either, and that's the part I'd most like guidance on.

Second, smaller point — identity correlation

MA correlates a SendSpin client to a Home Assistant device by MAC address (the Sendspin client_id). Any client whose client_id is not a MAC can therefore never be correlated, and never gets announcements. A protocol-level announcement role would remove that dependency entirely, which is the main reason I'm folding it in here rather than filing it separately.

If it's more useful as its own issue, happy to split it.

Scope if this were pursued

A role definition here, a connector in the clients (sendspin-python-cli and the libraries for parity), and provider support in Music Assistant. I'm not proposing to write all of that now — I'd like to know whether the direction is wanted, and if so which of the two shapes above the maintainers prefer, before anyone writes code.

If the answer is "not now", that's completely fine — a one-line no is genuinely useful, and I'll stop there.

Activity

  1. Hedda commented on Oct 9, 2026

    @Hedda

    @kiwipaulrob FYI, your proposal more or less matches this existing pull request to add an optional announcement role to the Sendspin spec:

    Note! Your issue above does however look to raise two additional side points which does not seem to be mentioned that linked pull request:

    • ESPHome-only relay. Music Assistant currently relays announcements through Home Assistant only for ESPHome devices, so other clients get none.

    • MAC-based correlation. Music Assistant matches a Sendspin client to a Home Assistant device by MAC address, which fails when the client_id isn’t a MAC.

    Both are consequences of having no protocol-level announcement path, and the role in #126 would remove them without the second-server follow-up.

    PS: @kiwipaulrob Also be sure that you (and not just your AI) both read AND follow the Open Home Foundation AI policy (which among other things state that only humans may discuss with other humans and not to let autonomous agents to communicate for you):

    The reasons why are further fleshed out in this blog post:

  2. Hedda commented on Nov 4, 2026

    @Hedda

    Originally posted by @kiwipaulrob in #126 (comment)

    I reviewed the comments by my agent so only half agentic. All my points stand.

    @kiwipaulrob suggest you reformulate your suggestions/arguments without AI and re-post them as a new reply in #126 if they still stand.

    Hi — I'm the author of #305, which @Hedda linked above. Confirming from the non-ESPHome side: I run Music Assistant against a moOde sendspin client, and announcements today are pure stop-and-resume (playing → idle → playing per clip, measured on the HA entity). This PR's shape — per-client stream, media ducked locally, ducking bound to the stream's lifetime — is exactly the fix for that. It also kills the two workarounds documented in #305 at the root: the ESPHome-manufacturer filter in MA's relay and the MAC-as-client_id correlation, both of which exist only because there is no protocol-level announcement path.

    On the open design questions in this thread:

    Sync scope. @balloob's stereo-pair/area concern is real for music, but for announcements (doorbell, TTS, alarm) a coordinated start via the shared start_timestamp is the right v1 bar — nobody needs sample-accurate sync for a chime. Supporting evidence: MA dispatches play_announcement per-member anyway (see sendspin-python-cli #248), so sample-accurate group sync couldn't be consumed by today's callers regardless. Holding v1 at coordinated-start is correct.

    Duck defaults. This is the one thing I'd ask to reconsider before merge. media_duck_db defaults to 0 (off), so a server that sends no duck level gets an unducked mix — arguably the worst default for a role literally named "announcement." Either default to an audible duck or document what MA will send on every stream/start so the default never fires in practice. Happy to test candidate defaults against the moOde client if that helps.

    Out of scope. Second-server announcements and sample-accurate sync can stay deferred as far as my use case goes — MA routes through a single server today, so neither blocks adoption. And #126 resolves the open question in #305 (new versioned role vs effect hook on player) in favor of the new role, which I'm happy with.

    My two side points (ESPHome-only relay, MAC correlation) are Music Assistant provider issues, not spec issues — I'll pursue those against MA separately so this thread stays a clean spec review. No action needed here.

    Review-only comment, no merge demand — noting the branch currently reads conflicted. The design has my support as the generic-client user this thread was missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions