Skip to content

Bump sendspin-cpp pin to v0.10.0 - #340

Open
bbangert wants to merge 1 commit into
mainfrom
chore/sendspin-cpp-bump-a10289a
Open

bbangert wants to merge 1 commit into
mainfrom
chore/sendspin-cpp-bump-a10289a

Conversation

@bbangert

Copy link
Copy Markdown
Owner

Pin

Old 78b13d5edcd38b9c95295722884edb60d7a3284d — post-v0.9.5 (main @ #263)
New a10289a838a0c3e777efdd73b8ad19506b8f2bc9 — v0.10.0 (upstream #281)

17 upstream commits. Upstream main is 3 commits further along (#282 CI-only, #283 dead-code removal, #284 a role-visitor refactor); the pin stops at the tagged release rather than chasing untagged post-release churn, and #283 is the one of those three that touches src/host/ws_server.cpp, so stopping at the tag also keeps our patch off fresh drift. Nothing in those three is needed here.

Why this matters to us

The headline change is upstream #281, which ties the player, visualizer and source streams to the 'playback' activity. On a connection that does not carry 'playback', the client now ignores the player and visualizer sections of stream/start and discards player audio outright, and an activation that drops 'playback' ends any player, visualizer or source stream the server left running. This is a real runtime behaviour change for our player, not a refactor: against a server that does not advertise the activity, audio stops rather than plays. Artwork is deliberately not gated, so a paused group keeps its artwork stream.

Around that sit a cluster of connection- and wire-level hardening changes we care about because they decide when our socket drops: the connection now closes on an empty plaintext or malformed JSON message (#280) and on a player or visualizer frame shorter than its header (#279). Stream handling gets stricter and more correct — stream/start player parameters are validated and a rejected stream is ended (#272), stream/clear with a from_timestamp now discards only from that timestamp on instead of the whole buffer (#274), and queued audio is timed per sample rate across an in-place format change (#271). On the clock side, time-sync bursts are now started no more than 10 s apart (#277) and a player connection's client/state is held until its clock syncs (#278), both of which feed the sync behaviour our playback depends on.

The decode path picks up a required bump to micro-flac 0.3.1 (#273), whose decoder keeps its sample buffers across reset(); that flows into our build through cmake/host.cmake, so it changes what we compile whether or not we touch anything. Smaller items in the range: burst receive work moved out of periodic yield windows (#265), client-sent names and player timing values clamped to the dev spec's limits (#275), and a pairing round-count reset fix (#276).

Patch 0003 re-validation

patch -p1 --dry-run against upstream at a10289a:

checking file src/host/ws_server.cpp
Hunk #1 succeeded at 27 (offset 1 line).
Hunk #2 succeeded at 183 (offset 9 lines).

Clean — context offsets only, no regeneration needed, and the patch file is unchanged in this PR. src/host/ws_server.cpp is byte-identical between the old pin and v0.10.0; upstream has not absorbed the hook natively (grep -c sendspin_host_listener_bound on the unpatched source returns 0), so we still carry it. Both markers CMake asserts (sendspin_host_listener_bound(uint16_t port) __attribute__((weak)) and sendspin_host_listener_bound(port)) are present after apply — the configure step passing is itself that proof, since assert_patch_markers is fatal otherwise.

Build verification (host, cloud env)

Compile is verified here. cmake -S c_src/sendspin_player -B /tmp/ssp-build && cmake --build /tmp/ssp-build -j4 configures and builds clean to a linked sendspin_player (gcc 13.3, cmake 3.28, libasound2-dev installed). The sendspin_player_unit_tests target also builds and passes (OK).

No errors; warnings only. Two deprecation warnings are new with this bump, both with compatibility shims upstream and removal scheduled for v0.11.0:

Two further APIs we implement went deprecated silently — overriding a deprecated virtual draws no warning from gcc, so these will surface as hard breakage at v0.11.0, not as a warning first: PlayerRoleListener::on_audio_write() (superseded by on_audio_output(pcm, format, timeout_ms), #268) and SendspinPersistenceProvider::load_blob()/save_blob() in FilePersistence (superseded by read_blob()/write_blob(), #270). I verified by reading upstream's implementations that the new defaults forward to our deprecated overrides — on_audio_output() calls on_audio_write(), and read_blob()/write_blob() call load_blob()/save_blob() — so audio output and pairing/keypair persistence both still work at this pin. Migrating all four is a follow-up, not part of this bump; on_audio_output() is the one with real upside, since it hands the format with every write instead of leaving our ALSA sink to infer it from on_stream_start(). (I did check that an in-place stream update re-fires on_stream_start(), so the sink is not left configured for a stale format today.)

The pre-existing GroupUpdateObject, ServerMetadataStateObject and pairing_token() deprecation warnings are unchanged from the old pin — confirmed by building the old pin side by side.

Only CMakeLists.txt changes. No priv/ binaries or build output committed.

Before release

Firmware needs a rebuild (mise run firmware -- <target>) and rpi3 hardware validation before this ships. Worth aiming the HW pass at the 'playback' gating specifically: confirm our server advertises the activity and that playback survives a pause/resume cycle, since #281 is the change most able to silently stop audio against a server that doesn't.

Also note for reviewers: the maintenance job's context claimed only the player role is compiled, but CMakeLists.txt in fact has controller, metadata, color, artwork and visualizer all ON. The review above was done against the real configuration, which is why the visualizer and metadata changes are treated as in scope.

Opened for review only — not merged.


Generated by Claude Code

Picks up the release that gates the player, visualizer and source streams
on the 'playback' activity, hardens the connection against malformed JSON
and short player/visualizer frames, bounds time-sync burst spacing, and
requires micro-flac 0.3.1 so the FLAC decoder keeps its sample buffers
across reset(). Patch 0003 still applies at the new ref with context
offsets only, and the host build and wrapper unit tests pass.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142hBhdBiYkxpDGh3FN2yru

Copy link
Copy Markdown
Owner Author

CI: Hex audit is red, and it isn't this PR's

Hex audit failed. mix hex.audit exited 1 on three newly-published advisories against our existing Elixir dependencies:

Package Version Advisory Severity
phoenix 1.8.16 EEF-CVE-2026-128361 (GHSA-pvfx-rx4x-phrr) — unsanitized presence key crashes Presence tracker HIGH
phoenix 1.8.16 EEF-CVE-2026-129344 (GHSA-5vmc-qgf8-rw36) — client-selected V1 serializer crashes shared broadcast dispatch on binary payloads HIGH
phoenix_live_view 1.2.13 EEF-CVE-2026-126334 (GHSA-v4p7-3pm2-wq6c) — joining a LiveView without "url" skips its live_session on_mount hooks MEDIUM

This is not caused by the bump. The diff here is a single line in c_src/sendspin_player/CMakeLists.txt; it touches no .ex/.exs file, and neither mix.exs nor mix.lock is modified (git diff --name-only main..HEAD is that one C++ file). mix hex.audit is a function of mix.lock plus the live advisory database, and mix.lock on this branch is byte-identical to main — the flagged phoenix 1.8.16 and phoenix_live_view 1.2.13 are the versions already on main. So the same job run against main today fails the same way; the advisories were published after main's last CI run, which was green on 2026-11-19 (run 1029).

Scope of my verification, so it's on the record: I could not execute mix hex.audit against main to demonstrate this directly — the cloud environment this ran in has no Elixir/mise toolchain — and I did not re-run CI on main to avoid kicking a run on the default branch. The reasoning above rests on the diff contents and the identical lockfile, not on an observed main failure. I also could not retrieve the patched versions: the GHSA pages 404 for anonymous clients and api.osv.dev is blocked by this environment's egress proxy.

The three advisories are a real finding against shipping code on main, not an artifact of this PR, and the fix is a dependency bump that belongs in its own PR — out of scope for a sendspin-cpp pin bump, and folding it in here would mix an unreviewed security upgrade into a C++ dependency change. Flagging rather than fixing; someone should decide on the phoenix upgrade separately. Until that lands, this check will stay red on every PR against main.

The rest of CI is healthy on this head: Compile · Format, Credo, Sobelow and circuits_cec all passed; Test, Dialyzer and Argus were still running when this was written, and I'll follow up if any of them fails.


Generated by Claude Code

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants