Skip to main content
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.

Connecting clients

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

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

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