Skip to content
OszkarPublic

About

Local Sonos speaker control

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

oto logo

oto

License: MIT CI Release

A fast, local-first Sonos controller for Windows and Android. Flutter UI over a Rust core, connected by generated flutter_rust_bridge bindings. Sonos discovery, control, and live events run locally in Rust.

oto is a side project, primarily built with agentic engineering methods. The name means "sound" in Japanese and is a palindrome, like Sonos.

Features

  • Discover Sonos rooms on your LAN, including hosts with multiple network interfaces.
  • Play, pause, skip tracks, and control room or group volume and mute.
  • Group and ungroup rooms, with live topology and playback updates. Unchanged topology notifications preserve subscriptions even when startup notifications arrive late.
  • View Now Playing metadata and track progress.
  • Use phone, tablet, and desktop layouts with light/dark themes and local preferences.

Device observations remain authoritative during optimistic controls: a failed command restores the latest observed value, or its successful predecessor when no newer observation has arrived. A user scan clears displayed unreachable errors to permit another attempt; every subsequent command reports fresh health evidence. Room controls and open details follow speaker/coordinator identity through regrouping, and responsive overlays retain valid action lifetimes.

Scope

Windows and Android 15+ (API 35), with 64-bit Android ABIs only. Other platform folders are scaffolding, not supported or routinely validated targets.

Local control only: no Sonos account, cloud API, or multi-household support. Shuffle, repeat, seek, queue editing, and EQ controls are not implemented. oto is not affiliated with Sonos.

Development setup

  • Flutter version from .fvmrc.
  • Rust 1.99.1 from rust-toolchain.toml, installed by rustup.
  • just (preferred), or make for the mirrored recipes.
  • Windows: Visual Studio 2022 with the "Desktop development with C++" workload and PowerShell 7+ for just.
  • Android: Java 21, Android SDK, and the NDK selected by Flutter. See Android cross-builds.

Install Cargo tools, then resolve app and workspace dependencies:

cargo install flutter_rust_bridge_codegen --version 2.12.0 --locked
cargo install cargo-ndk cargo-nextest cargo-deny --locked
just bootstrap

Optional Git hooks: install Lefthook, then run just install-hooks.

Common commands

Run from the repository root:

just gen               # regenerate committed FRB + Riverpod bindings
just check             # generated freshness, Rust fmt/clippy, Flutter analyze, cargo deny
just test              # Rust + Flutter unit/widget tests
just test-integration  # Windows desktop, real FRB bridge with MockWire
just dev               # run the app, using speakers on the LAN
just showcase          # fixture-driven UI gallery, no speakers needed
just build-apk         # debug Android APK
just build-win         # debug Windows desktop

Regenerate after changing the bridge API or an @riverpod provider. The contributor guide covers validation, version pins, hooks, and PRs.

Local network setup

The app and speakers must be able to reach each other on the LAN. Guest-network isolation or multicast filtering can prevent discovery.

Allow oto's outbound SSDP multicast to UDP port 1900 and the replies to its per-interface ephemeral UDP sockets. SOAP uses TCP port 1400 on the speakers; GENA notifications require speakers to reach the app's callback listener (SDK range 3400-3500). Prefer an application-scoped firewall rule on the private LAN.

Discovery validates SSDP replies against their sender and retains up to 32 distinct hosts. Each topology lookup tries at most 8 distinct hosts, with a 30-second check before each attempt. The three-second SSDP receive window is shared across interfaces; the complete scan can take longer due to SOAP and initialization. These limits do not cap the speakers returned by a successful topology lookup or authenticate LAN peers.

On Android, oto acquires a Wi-Fi MulticastLock around discovery. GENA notifications use unicast TCP. Protocol details and discovery limitations are in Sonos notes.

Sonos SOAP and live events use the aligned SDK 0.9.0 crates from crates.io. oto retains its own bounded discovery and explicit multicast interface selection.

Repository guide

Location Purpose
app/ Flutter UI, Riverpod state, generated Dart bridge
app/rust_builder/ Cargokit plugin that builds the Rust library for Flutter
native/src/ FRB API, DTO mapping, event consumer, generated Rust glue
native/crates/{core,wire,mock,app}/ Domain, Sonos integration, test wire, runtime ownership
Architecture Current layers, state ownership, command and event flows
Sonos notes Protocol constraints and SDK integration pitfalls
Design system Canonical tokens, showcase, brand assets
Local patches Vendored changes and upgrade instructions
Agent contract Engineering boundaries and required checks

CI and releases

CI checks generated source, Rust, Flutter, dependencies, and Android Rust cross-compilation on PRs. The build workflow builds a debug APK on main, relevant PRs, and manual dispatch. The manually dispatched integration gate runs the full FRB integration tests on Windows. PR-title linting and Dependabot auto-merge are described in Contributing.

The app is pre-1.0; behavior and API compatibility may change between releases. See the roadmap for milestone status and forward scope, the changelog for release history, and Releasing for the release procedure. Signed distribution packages are still planned.

About

Local Sonos speaker control

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages