Sonos is a great system, but it doesn't accept arbitrary audio input. You can't just plug in a turntable and have it play. The app lists pre-approved sources. A USB sound card connected to a record player isn't one of them.
The workaround is to treat your audio input as a radio station and add that station to Sonos. Sonos will happily play a custom Icecast stream. So that's what I built.
How it works
SonoCast is a two-container Docker stack. The first container runs JACK and darkice, which captures audio from a USB sound card, encodes it as MP3, and streams it to an Icecast server running in the second container. Sonos then connects to that stream as if it were a radio station.
On top of that, there's a small web UI that shows the current stream status, detected silence (useful for knowing when a record side has ended), and USB device connection state. It also handles USB hotplug - if you disconnect and reconnect the sound card, the stream recovers automatically.
What I actually use it for
The setup is: turntable → USB audio interface → Raspberry Pi running SonoCast → Sonos. The Pi runs headless, SonoCast starts on boot, and the Sonos radio station points at it.
It works well enough that I've forgotten it's there, which is the goal. The latency is about 3–4 seconds, which is fine for background listening. For vinyl, it doesn't matter at all.
The repo is on GitHub with a compose file and setup instructions.