Skip to content

Commit f894604

Browse files
authored
chore: upgrade SendSpin.SDK 9.2.0 -> 9.3.0 (#289)
Hands sync correction back to the SDK. BufferedAudioSampleSource ran its own frame drop/insert corrector against ReadRaw, which duplicated the SDK's interpolation, exceeded the spec's +/-0.5% speed cap by ~20x, and could not coordinate with the one-shot snap tier 9.3.0 adds - both correctors would act on the same measured error. Reading through ITimedAudioBuffer.Read puts the whole loop in one place, where the tiers already stand down for one another. Removes ~330 lines: the corrector, its anti-oscillation debounce, the startup deadband, and the ArrayPool staging buffer the external path needed. MaxSpeedCorrection and ResamplingThresholdMicroseconds drop out of PulseAudioSyncOptions as inert on this path - the buffer applies correction as frame stepping rather than driving a resampler, and a value above the spec cap is clamped anyway. Read still carries a stale [Obsolete] pointing at ReadRaw plus an external provider. The 9.x line froze its published surface and so could not remove it; 9.3.0 rewrote the method's own docs to describe it as the complete path and put the new snap tier behind it. Suppressed at the call site with that reasoning recorded. Also stops advertising a fixed 32MB buffer_capacity - roughly 16 minutes of Opus, far past what the decoded buffer holds - and lets the SDK derive it from real capacity instead. The spec makes buffer_capacity a promise the server may fill toward, so over-advertising only licensed it to queue audio we would discard unplayed (see #272). Caveat on the 9.x line: the derivation assumes the SDK's own 30s default and has no public hook for ours, so BUFFER_SECONDS below 30 still over-advertises, by far less than before. SyncAlignmentTests now exercise the same Read path the app uses and assert on outcome - final sync error and correction actually applied - rather than on a recommended playback rate that stays 1.0 when correction is expressed as frame stepping.
1 parent 8526016 commit f894604

6 files changed

Lines changed: 121 additions & 448 deletions

File tree

multiroom-audio/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313

1414
### Changed
1515
- **After upgrading, existing custom sinks are renamed in Home Assistant and Music Assistant.** Sinks reload from `custom-sinks.yaml` on restart and now register their stored description verbatim, so underscores become spaces and `_and_` becomes `&`. Sink names, players and configuration are untouched - only the display name changes, and you may need to fix up entity names on the Home Assistant side
16+
- Audio sync correction now runs entirely inside the Sendspin SDK (upgraded to 9.3.0). The add-on used to run a second corrector of its own alongside the SDK's, so two loops chased the same timing error and the add-on's one pulled playback speed up to 20x harder than the Sendspin spec allows. Correction is now a single loop that stays inside the spec's +/-0.5% limit, escalating to a one-shot snap past ~5ms of error. Expect steadier multi-room alignment and fewer correction artifacts
17+
- Players now tell the server how much audio they can really hold. They used to advertise a flat 32MB - roughly 16 minutes of compressed audio, far past anything the add-on actually buffers - which licensed the server to queue audio the player would only discard unplayed, and could fill the buffer until the SDK began dropping samples. Capacity is now derived from the real decoded buffer. If you have lowered **Buffer Seconds** below 30 the advertised figure is still slightly generous, but far closer than before (#272)
1618

1719
## [5.2.2] - Volume Curve, MQTT Volume & Trigger Fixes
1820

0 commit comments

Comments
 (0)