A WiiM (or any DLNA control point) can't feed a line-in input
From discussion #395 (@Holzmusik): a WiiM Ultra can stream its analog input over the network, and recent firmware adds "DLNA Out" (Ultra, Pro, Pro Plus) which pushes whatever the WiiM plays to a DLNA renderer. It would be nice to bring that into sonn as a source.
What already works, sort of
Every zone with inputs.dlna.enabled is advertised as a MediaRenderer (dlnaInputService.ts), so a WiiM should already find it and cast to it. That treats the WiiM as a one-off cast to one zone though. WiiM itself says DLNA Out to several speakers is not synced, so grouping only works if sonn receives one stream and fans it out itself. The analog input also behaves like a line-in, not like a track: it's continuous, there's no queue, and it should be selectable from Loxone and the BeoRemote like any other line-in.
Proposal: DLNA as a line-in source
A line-in entry in inputs.lineIn.inputs[] with source: { type: 'dlna', publishName? } gets its own UpnpMediaRenderer, with a stable UDN derived from the input id and served under its own path (/dlna-linein/<inputId>/*), next to the per-zone ones.
On SetAVTransportURI + Play we spawn ffmpeg on the cast URL (through the local proxy), decode to s16le/48k/2ch, and hand stdout to LineInIngestRegistry.start(inputId, stream, { format }), which is the same entry point TCP, WS and sendspin use. Stop or end of stream kills ffmpeg and stops the session.
From there the existing line-in path does the rest: a zone sitting on linein:<id> starts when audio arrives (lineInActivationService onStart watch), grouped zones play in sync, and the input shows up in Loxone and the BeoRemote menus. DIDL title/artist from the control point can feed the line-in metadata.
Because ffmpeg probes by content type, raw audio/L16 should be fine this way. The current zone renderer hands the URL to the engine as-is, and I'm not sure it plays raw L16.
Open questions
- The WiiM probably keeps streaming silence when nothing is plugged in, so the input would never go idle. We likely need the same VAD handling sendspin line-ins have.
- Latency: the WiiM adds its own buffer (configurable under DLNA Out), plus our proxy and decode. Fine for music, not for TV lip-sync.
- Admin UI needs the
dlnasource type and the publish name.
Nobody has tested this on actual WiiM hardware yet.