Skip to main content

Clients

Web UI · GTK · GPUI · macOS (Swift) · TUI · REPL · MPD · MPRIS

Protocols

gRPC :6061 · GraphQL :6062 · REST :6063 · MPD :6600

Rust services

playback · library · settings · search · playlists · airplay · slim · chromecast · upnp · netstream · cpal-sink · bluetooth · discovery

Rockbox C

audio engine · DSP · codecs · tag database

PCM sinks

cpal · fifo · airplay · squeezelite · chromecast · snapcast_tcp · upnp
The entire system ships as one binary, rockboxd, produced by Zig’s linker. There’s no separate “rockbox-server” service, no per-feature sidecar, no IPC. The Zig build script (zig/build.zig) glues them together, ensuring force-included symbols stay in the staticlib through the link.

Repository layout

Cross-cutting concerns

macOS CPAL audio

CPAL uses CoreAudio natively on macOS. The built-in sink implementation lives in firmware/target/hosted/headless/pcm-cpal.c (C side) and crates/cpal-sink/ (Rust side, ring buffer + resampler). No extra initialisation is required beyond what CPAL performs at stream open time.

SIGTERM handling

crates/cli/src/lib.rs overrides SIGTERM/SIGINT to kill the typesense child process and _exit(0). The default Rockbox handler in system-hosted.c would otherwise loop forever waiting for a quit event from the audio subsystem.

Typesense subprocess

Typesense is spawned with Stdio::piped() and its stdout/stderr lines are forwarded to tracing in background threads — this keeps the PCM stdout stream clean when running in fifo_path = "-" mode.

HTTP streaming for cloud sources

HTTP file descriptors are encoded as values ≤ -1000 (the STREAM_HTTP_FD_BASE constant). stream_open/read/lseek/close in crates/netstream/ dispatch between HTTP and POSIX based on fd value, so the rest of the firmware doesn’t know it’s reading from the network.