Skip to content

pipewire-pulse fixes for clients in passthrough mode

This MR fixes pipewire-pulse to work with clients if they are configured in passthrough mode by media-session.

When the client adapter is configured in passthrough mode, the stream param changed event in pipewire-pulse is emitted BEFORE the session manager creates the link. This is a race condition problem that causes pulse-server to reply with NULL sink (here) and makes the pulseaudio client to disconnect with stream error (here) because the device name is not valid.

The first commit delays the create stream reply until the link is added if the peer cannot be found, fixing the above race condition to allow pulseaudio passthrough mode clients to not receive stream error.

Regarding the last commit of this MR, I am not sure if it is the proper fix. However, the current calculated buffer size is too small for 2 channel S32 audio in passthrough mode, and calculating the buffer size based on the frame size fixes playback issues.

With both fixes, paplay or any other pulseaudio client configured in passthrough mode does not have issues when playing or recording audio. This has been tested using my wip branch: https://gitlab.freedesktop.org/julian/pipewire/-/commits/no-dsp

Edited by Julian Bouzas

Merge request reports