badaix / snapcast

Synchronous multiroom audio player
GNU General Public License v3.0
6.22k stars 455 forks source link

Lazily load streams in meta streams #1277

Open jdecourval opened 3 months ago

jdecourval commented 3 months ago

TL/DR: This PR enables any pipewire on the local network to send its audio to snapcast. Just pick snapcast in your audio mixer: Picking snapcast in pavucontrol

Prior

As discussed in https://github.com/badaix/snapcast/issues/821, PipeWire can now automatically discover PipeWire server instances and register a new TCP stream to it. This works, but if you are using meta streams, it will be created outside of it, and it's currently not possible to do otherwise.

This is because meta streams are built at startup from their definition specified in the configuration file, and at startup, the pipewire stream does not yet exist, and so cannot be added.

In other words, this currently fail:

source = pipe:///tmp/snapfifo?name=default
source = meta:///default/PipeWire-Jerome-PC?name=meta

because PipeWire-Jerome-PC does not exist at startup.

Fix

What does not change

Everything else:

I think this PR partly fixes https://github.com/badaix/snapcast/issues/1232 when PipeWire is used.

Pull Request Checklist