Documentation for controlling and preserving Bose SoundTouch devices
This document provides a comparative analysis of the current Go implementation and the deborahgu/soundcork project, identifying functional gaps and potential improvements.
chi for routing and encoding/xml for data. High performance, strong typing, and precise MIME type handling (application/vnd.bose.streaming-v1.2+xml).FastAPI and xml.etree.ElementTree. Prioritizes flexibility and rapid prototyping of streaming service mocks.| Feature | Bose-SoundTouch (Go) | SoundCork (Python) |
|---|---|---|
| Group Management | Full CRUD: POST /group, POST /group/{id}, DELETE /group/{id} with XML datastore persistence (Group_{id}.xml). |
Active group management (groups.py), supporting /addGroup and stereo pairing logic. |
| ZeroConf Priming | Full DH key exchange + encrypted blob; fallback to tokenType=accesstoken for older firmware. |
Simple tokenType=accesstoken push only; token expires after ~60 minutes. |
| BMX Services | Supports TuneIn, Orion, and custom streams. | More modular bmx_services.json registry with broader mock support. |
| Persistence | Mixed JSON/XML datastore. | Pure XML-based persistence per device/account. |
| Admin UI | CLI-based (soundtouch-cli) or API-driven. |
Draft Web UI for device discovery and account management (admin.py). |
| Discovery | Integrated setup tools and SSDP/MDNS awareness. | Leverages bosesoundtouchapi Python library for active discovery. |
customerSupport).HandleNotFound (registered via r.NotFound) logs every unimplemented endpoint as [UNHANDLED] and forwards the request to the Bose upstream via HandleBoseProxy. This provides at least the same coverage as static dummy responses, while also aiding discovery of new endpoints.POST /group, POST /group/{id}, DELETE /group/{id} implemented in pkg/service/handlers/handlers_marge.go.Group_{id}.xml) via pkg/service/datastore/datastore.go.GET /group on device registration reads the group the device belongs to.pkg/service/spotify/zeroconf.go.getInfo (fetch speaker DH public key) → 768-bit DH key exchange → AES-128-CTR encrypted LoginCredentials protobuf blob → addUser.tokenType=accesstoken if getInfo fails (older firmware without DH support).docs/concepts/spotify-priming-strategy.md for full protocol details.HandleBMXRegistry into an external bmx-services.json file.sourceAccount and sourceName metadata is correctly captured during synchronization, using patterns from soundcork’s learnSource.Group support and ZeroConf Spotify priming are now feature-complete in AfterTouch. The Go implementation is structurally more consistent with recent reference recordings (e.g., buttonNumber, detailed components). SoundCork’s remaining functional advantages are:
bmx_services.json registry makes it trivial to add or mock new streaming providers without code changes (step C above).For the broader ecosystem context (feature matrix across all community projects, AfterTouch open tasks, and cross-project observations) see docs/analysis/bose-soundtouch-community-tools.md.