Skip to content

systemd: make pipewire-pulse require one of the session managers

Where pipewire and friends are started via socket activation, a PA client connection to the pulse socket triggers pipewire-pulse.service. That in turn triggers pipewire.service through Wants/After and once that is started up, pipewire-pulse actually starts up.

At the same time, pipewire-media-session or wireplumber are started through WantedBy/after in the respective service files.

Depending on which leg the race condition got out of bed with today, pipewire-pulse may be finished before the session manager has set up the graph and the PA client doesn't see any devices.

Fix this by adding a dependency on the session manager in pipewire-pulse, installed via an alias so media-session and wireplumber can install the same alias. Wants is a light dependency, so for the case where it doesn't exist we fall back to the current behavior anyway.

This doesn't remove the race condition since systemd may deem the session manager to have started before the graph is set up, but it should reduce the occurances.

The disadvantage here: only one Alias will be installed by systemd, so first-come, first-serve in the case of both media-session and wireplumber being installed.

See #1553

cc @gkiagia, wireplumber will need the same Alias in its service file

Merge request reports