Don't crash with newer pipewire and fix device selection

Don't crash with newer pipewire and fix device selection

Newer pipewire (at least 1.5.84 and newer) merely swap the port of the sink rather than updating the sink. As the current active port gets removed we crash in gvc_mixer_stream_get_port. We fix this by allowing a NULL port. However that is not enough as we also need to sync the device information to match the UI devices to the updated sink information. Finally we need to make sure that UI device carrying the old sink/port information is marked as invalid on the UI device as otherwise updating the sink would result only on a port update which then seemingly succeeds but fails silently as the port we set things to doesn't exist on the stream.

For that to work we need to remove some signal emissions that were emitting {source,sink}-updated signals based on the result of the setter rather than of the server actually changing the source/sink. This makes sure the client actually sees the result of the updated stream.

Finally as streams can now become portless we can't just add a UI device for them but rather clear known stream-ids from UI devices in that case as we need a proper default source / sink switch in that case rather than just activating the profile.

Closes #34 (closed)

Merge request reports

Loading