Skip to main content

Documentation Index

Fetch the complete documentation index at: https://rockboxzig.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Rockbox runs a minimal Logitech Media Server that any number of squeezelite clients can attach to. A Slim Protocol TCP server accepts connections; an HTTP PCM broadcast server serves the actual audio stream.
music_dir             = "/path/to/Music"
audio_output          = "squeezelite"
squeezelite_port      = 3483   # Slim Protocol TCP port  (default 3483)
squeezelite_http_port = 9999   # HTTP PCM broadcast port (default 9999)

Connecting clients

squeezelite -s localhost -n "Living Room"
squeezelite -s localhost -n "Kitchen"
squeezelite -s localhost -n "Bedroom"
Each client gets an independent BroadcastReceiver cursor into the shared buffer, so adding or removing clients never blocks the writer or interrupts playback in other rooms.

Selecting a specific output device

squeezelite -s localhost -l                       # list available devices
squeezelite -s localhost -o ""                    # system default
squeezelite -s localhost -o "Built-in Output"     # specific device

How it stays in sync

Rockbox sends a sync packet to every client once per second so they all align to the same playback clock. The DMA loop in firmware/target/hosted/pcm-squeezelite.c paces output to real time using CLOCK_MONOTONIC, which keeps the broadcast buffer from drifting against the wall clock.

Buffer behaviour

PropertyValue
Capacity4 MB
EvictionOldest-first when full
Per-client cursorYes — each receiver tracks its own position
Lagging client policySkip forward (does not block the writer)
A slow client never stalls the others.

Slim Protocol details

Internal — useful if you’re debugging or building your own client.
  • Framing:
    • client → server: opcode[4] + u32_t length BE + payload
    • server → client: u16_t length BE + opcode[4] + payload (length excludes the 2-byte length field itself)
  • STRM 's' points clients at the HTTP port (defaults to 9999).
  • STMt heartbeat from the client must be answered with audg, otherwise squeezelite’s 36-second watchdog will tear down the session.
  • ASCII-encoded PCM fields in the STRM packet — squeezelite subtracts '0' from pcm_sample_size, pcm_sample_rate, pcm_channels and pcm_endianness. Correct values: '1' (16-bit), '3' (44 100 Hz), '2' (stereo), '1' (little-endian).

Debugging

RUST_LOG=rockbox_slim=debug rockboxd
squeezelite -s localhost -d slimproto=debug -d output=info