Skip to content

Make Opus optional for servers and warn about its license fees - #238

Merged
chrisuthe merged 4 commits into
mainfrom
opus-hardware-guidance
Sep 15, 2026
Merged

chrisuthe merged 4 commits into
mainfrom
opus-hardware-guidance

Conversation

@marcelveldt

@marcelveldt marcelveldt commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Patent claims asserted as essential to Opus are licensed through a pool that charges per device, and the pool has started litigating. Sendspin does not need Opus on a LAN: FLAC and PCM are unencumbered and the bandwidth saving rarely matters there.

  • servers MUST support flac and pcm and MAY support opus; clients MUST list at least one flac or pcm format and sources MUST be able to produce one, so any client works with any server
  • servers that support the source role list the codecs they accept from sources in a new source@v1_support object in server/hello
  • the player and source roles note that Opus is patent-encumbered and that commercial implementers are responsible for any license fees

@marcelveldt marcelveldt added the documentation Improvements or additions to documentation label Sep 9, 2026
@marcelveldt
marcelveldt requested a lite review from Copilot September 9, 2026 09:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new text is internally inconsistent and ambiguous about server-vs-client scope and whether Opus fees apply to encoding vs decoding, which can mislead implementers.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates the Sendspin spec documentation to warn implementers that using the Opus codec in commercial products may involve patent licensing fees, and recommends preferring unencumbered codecs (PCM/FLAC) for LAN scenarios while keeping interoperability requirements intact.

Changes:

  • Add client/player guidance recommending listing pcm (and flac where feasible) and discouraging listing opus for commercial implementations.
  • Add source guidance recommending announcing pcm/flac and discouraging announcing opus for commercial implementations.
  • Add explanatory notes about an Opus licensing pool and why Opus bandwidth savings often don’t matter on a LAN.
File summaries
File Description
roles/source/v1.md Adds Opus licensing warning and codec recommendation text for sources.
roles/player/v1.md Adds Opus licensing warning and codec recommendation text for players/clients.
README.md Mirrors the player/source guidance and notes in the top-level spec README.
Review details

Suppressed comments (4)

roles/player/v1.md:24

  • This note says the Opus pool charges per device that decodes Opus, while the analogous source note says it charges per device that encodes Opus. As written, the spec is internally inconsistent about whether the pool targets encoders vs decoders; using a consistent “encodes or decodes” phrasing avoids contradicting itself.
**Note:** Patent holders operate a licensing pool for Opus that charges per device that decodes it, independently of Sendspin. FLAC and PCM carry no known patent encumbrance, and on a local network the bandwidth saving of Opus over FLAC rarely matters. Open-source software is not the pool's stated target, but vendors shipping Opus in a product should take their own licensing view.

roles/source/v1.md:24

  • This note says the Opus pool charges per device that encodes Opus, while the analogous player note says it charges per device that decodes Opus. That makes the spec internally inconsistent about the fee trigger; consider using a single “encodes or decodes” phrasing in both places.
**Note:** Patent holders operate a licensing pool for Opus that charges per device that encodes it, independently of Sendspin. FLAC and PCM carry no known patent encumbrance, and on a local network the bandwidth saving of Opus over FLAC rarely matters. Open-source software is not the pool's stated target, but vendors shipping Opus in a product should take their own licensing view.

README.md:1167

  • This note says the Opus pool charges per device that decodes Opus, but the corresponding source note later says it charges per device that encodes Opus. That contradiction makes it unclear what the spec is asserting; use consistent wording.
**Note:** Patent holders operate a licensing pool for Opus that charges per device that decodes it, independently of Sendspin. FLAC and PCM carry no known patent encumbrance, and on a local network the bandwidth saving of Opus over FLAC rarely matters. Open-source software is not the pool's stated target, but vendors shipping Opus in a product should take their own licensing view.

README.md:1346

  • This note says the Opus pool charges per device that encodes Opus, but the corresponding player note earlier says it charges per device that decodes Opus. As written, the README contradicts itself about the fee trigger; use consistent wording.
**Note:** Patent holders operate a licensing pool for Opus that charges per device that encodes it, independently of Sendspin. FLAC and PCM carry no known patent encumbrance, and on a local network the bandwidth saving of Opus over FLAC rarely matters. Open-source software is not the pool's stated target, but vendors shipping Opus in a product should take their own licensing view.
  • Files reviewed: 3/3 changed files
  • Comments generated: 4
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Resolved
Comment thread README.md Resolved
Comment thread roles/player/v1.md Resolved
Comment thread roles/source/v1.md Resolved
Comment thread roles/player/v1.md Resolved
Comment thread roles/player/v1.md Resolved
Comment thread roles/player/v1.md Resolved
Comment thread roles/source/v1.md Resolved
@marcelveldt
marcelveldt force-pushed the opus-hardware-guidance branch from 2fc72af to b6ecf79 Compare September 15, 2026 11:31
@marcelveldt marcelveldt changed the title Warn that Opus may carry license fees in commercial implementations Make Opus optional for servers and warn about its license fees Sep 15, 2026
@marcelveldt

Copy link
Copy Markdown
Contributor Author

Rebased and changed direction after the review: servers MUST support flac and pcm and MAY support opus, clients MUST list flac or pcm, and server/hello gets a source@v1_support object with the codecs the server accepts from sources. Description updated to match.

@marcelveldt
marcelveldt marked this pull request as ready for review September 15, 2026 12:25
@marcelveldt marcelveldt added this to the 1.0.0 milestone Sep 15, 2026

@chrisuthe chrisuthe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments would flow to other areas that share copy if taken.

@chrisuthe chrisuthe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only one I am somewhat strong on is the "Don't have to say which formats we support unless it includes opus" for input- I just don't see a big enough upside to not include the other two even though it is required. It just makes it easy/obvious that the message is there every time if you support source.

Comment thread roles/player/v1.md Resolved
Comment thread roles/player/v1.md Resolved
Comment thread roles/source/v1.md Resolved
Comment thread roles/source/v1.md Resolved
Comment thread roles/source/v1.md Resolved
Comment thread messaging.md Resolved
marcelveldt and others added 4 commits September 15, 2026 22:01
Patent claims asserted as essential to Opus are licensed through a pool
that charges per device, and the pool has started litigating. Sendspin
does not need Opus on a LAN: FLAC and PCM are unencumbered and the
bandwidth saving rarely matters there.

- player role: using opus in a commercial client or server may involve
  license fees; to avoid them, do not list opus
- source role: same guidance for sources announcing opus
- servers still MUST support all three codecs, so existing clients keep
  working
- servers MUST support flac and pcm and MAY support opus; clients MUST
  list at least one flac or pcm format and sources MUST be able to
  produce one, so any client works with any server
- new source@v1_support object in server/hello lists the codecs the
  server accepts from sources; absent means flac and pcm
- the fee sentence says how each side avoids the fees; the note covers
  encoding and decoding and mentions the open-source condition
… the note

- a server that accepts opus MUST send source@v1_support; the codec
  list MUST include flac and pcm; sources ignore unknown identifiers
- players are told why they get no such list: the server selects only
  among the formats it can produce
- the fee sentence lives in the note, which attributes the pool's
  statements instead of asserting them
- a server that supports source@v1 always sends source@v1_support, so
  the object is present whenever it matters and no fallback is needed
- the Opus note states the patent situation without the bandwidth
  argument or codec-by-codec advice
- players list either flac or pcm and may list both

Co-authored-by: chrisuthe <[email protected]>
@marcelveldt
marcelveldt force-pushed the opus-hardware-guidance branch from ff02d98 to d2215a4 Compare September 15, 2026 20:01
@marcelveldt

Copy link
Copy Markdown
Contributor Author

Applied all six suggestions, thanks. Agree on the unconditional rule: source@v1_support is now present whenever the server supports the source role and the fallback sentence is gone. Rebased on main as well.

@chrisuthe
chrisuthe merged commit df0e02d into main Sep 15, 2026
1 check passed
@chrisuthe
chrisuthe deleted the opus-hardware-guidance branch September 15, 2026 20:19
chrisuthe pushed a commit to Sendspin/aiosendspin that referenced this pull request Sep 16, 2026
…erver/hello

Implements Sendspin/spec#238. Servers must support flac and pcm and may
support opus; a server that offers source@v1 lists the codecs it accepts
in server/hello. The server probes PyAV for libopus instead of assuming
it, player format selection skips Opus without it, and the client SDK
announces only a codec the server listed, falling back to flac or pcm.
chrisuthe added a commit to Sendspin/aiosendspin that referenced this pull request Sep 16, 2026
Implements Sendspin/spec#238: servers must support FLAC and PCM and may
support Opus, and a server that accepts sources lists the codecs it
takes in `server/hello`.

Opus in PyAV depends on FFmpeg being built with libopus, which is not a
given on every platform. The server now probes for it instead of
assuming it, and the client SDK picks a codec the server actually
listed.

- `server/hello` carries `source@v1_support.supported_codecs` (`flac`,
`pcm`, plus `opus` when libopus is present); absent when the server does
not offer the source role
- Player format selection skips Opus formats when the server cannot
encode them
- The source role rejects a `client-stream/start` that announces a codec
the server did not list
- Client SDK: `ServerInfo.source_codecs` records the server's list,
`create_source_capture` falls back to FLAC (or PCM) when the requested
codec is not listed, and unknown codec identifiers are ignored on parse

---------

Co-authored-by: Chris Uthe <[email protected]>
@maximmaxim345 maximmaxim345 mentioned this pull request Sep 16, 2026
1 task done
kahrendt pushed a commit that referenced this pull request Sep 16, 2026
<!-- Describe the change and why it is needed. -->

Follow up fix for a tiny inconsistency introduced with #238.

The `format?` description summarizes priority ordering without
mentioning server capabilities or permitted overrides. Replace that
summary with a link to the existing format-selection rules, which cover
unsupported preferences such as Opus on a server that cannot produce it.
This is a wording clarification with no protocol behavior change.

- [x] I accept the [Contributor License
Agreement](../blob/main/CONTRIBUTOR-LICENSE-AGREEMENT.md) for this
contribution.
kahrendt added a commit to Sendspin/sendspin-cpp that referenced this pull request Sep 29, 2026
…r formats (#126)

Sendspin/spec#238 changed the codec rules: servers must support `flac`
and `pcm` and may support `opus`; players must list `flac` or `pcm` and
may add `opus`. A player is not told which codecs a server has, so one
that lists only `opus` can end up with nothing to play. Opus is also
patent-encumbered, and some products need a build without it.

## Changes

- `PlayerRoleConfig::audio_formats` must contain a `flac` or `pcm`
entry. A non-empty list without one makes `start()` log an error and
return `false`, and the client stays stopped (the same rollback path the
visualizer uses for an invalid ring size). Rejecting instead of
appending a `pcm` entry follows the fail-closed validation rule in
`docs/conventions.md` and keeps the advertised list equal to what the
consumer configured.
- New `SENDSPIN_ENABLE_OPUS` build option (CMake option and Kconfig
entry, on by default, so existing builds are unchanged). With it off,
micro-opus is not fetched, required, or linked; the Opus branches in the
decoder are compiled out; `opus` entries in `audio_formats` are refused
at `start()`; and an `opus` `stream/start` takes the unsupported-codec
path.
- The host examples guard their `opus` usage on the option, and CI gains
a job that builds and tests with Opus off (under ASan/UBSan, since one
test only exists in that configuration).
- Docs updated: README, integration guide, internals, conventions,
CLAUDE.md.

## Note for the ESPHome component

The ESPHome Sendspin component supplies the `audio_formats` list. It may
want to put `flac`/`pcm` first and leave `opus` out when it builds with
`CONFIG_SENDSPIN_ENABLE_OPUS=n`. That is a change in the esphome
repository, not here.

The ESP-IDF side (Kconfig entry, requires list, manifest rule) was not
compiled locally. The Kconfig entry was checked with Espressif's
kconfiglib (defaults to on, reads as off when the player role is off)
and the manifest rule with the component manager's own `if` parser on
2.2.0, 2.5.2 and 3.1.2 (true only with both options on; no error when
the player role is off and the Opus symbol is absent).

---------

Co-authored-by: Kevin Ahrendt <[email protected]>
maximmaxim345 added a commit to Sendspin/sendspin-js that referenced this pull request Oct 22, 2026
# What does this implement/fix?

Sendspin/spec#238 makes Opus optional for servers. Every server must
support FLAC and PCM and may support Opus, so every player must list
FLAC or PCM in its `supported_formats`; a player is not told which
codecs the server can produce. An app configured with `codecs: ["opus"]`
sent a hello that a server without Opus could not serve at all.

- The advertised format list now always carries FLAC or PCM. When
neither is requested, or neither survives the browser filter, FLAC and
PCM are appended as lowest-priority fallbacks (FLAC first, each only
where the browser decodes it) and a console warning says so. The "no
supported codecs" error and the up-front codec check that relied on it
are gone, since the list can no longer be empty.
- `server/hello` is typed per the spec, including the new
`source@v1_support` object a server sends when it accepts source
clients. This SDK implements no source role, so the field is
informational only.
- The decoder needs no change: it follows the codec the server picks in
`stream/start`, and the FLAC and PCM paths never touch the Opus
decoders.
- Tests cover the FLAC/PCM guarantee and the buffer capacity that
follows from the fallback.

**Related issue or spec PR (if applicable):**

- Sendspin/spec#238

## Types of changes

<!--
Tick exactly one box. CI (.github/workflows/pr-labels.yaml) applies the
matching label, and the release notes use it to sort this change.
-->

- [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`
- [ ] Breaking change (changes the public API or the protocol in a way
that is not backwards compatible): `breaking-change`
- [ ] Refactor (no behavior change): `refactor`
- [ ] Documentation only: `documentation`
- [ ] Maintenance / chore: `maintenance`
- [ ] CI / workflow change: `ci`
- [ ] Dependencies bump: `dependencies`

---------

Co-authored-by: Maxim Raznatovski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants