Skip to content

bug: linux-pulseaudio: a source stays silent for good when the server drops its stream's own connection (follow-up of #532) #1056

Closed

Description

@rdoupe

Follow-up of #532, found in the release check of #1031 (not an upstream report). Since #532 each Audio Input or Output Capture stream has a connection to the sound server of its own, besides the shared one the plugin uses for everything else. When the server drops only a stream's connection, the source stops recording and never starts again: no restart, no reconnection, and no line in the log.

Location

Reproduced in 0.1.0-beta.20261014

The released AppImage (built from 9e2325e), headless: private PipeWire, WirePlumber and pipewire-pulse with no hardware, an Audio Input Capture on a virtual source. pw-cli destroy on the PipeWire client of the source's stream (its own connection): 5 s later the source has no stream and was restarted 0 times; the log shows nothing after the drop.

Build After its stream's connection is dropped
master before #532 (06ef6aa, one shared connection) "Lost the connection to the server, reconnecting", "Reconnected", "Started recording" within 10 ms; records again
0.1.0-beta.20261014 AppImage no stream, 0 restarts, no log line
current master (87582ae) the same: no stream, 0 restarts, no log line

Class

Silent audio loss with nothing in the log. No crash. It needs the server to drop one client connection on its own and keep the rest (for example pactl kill-client, or an error on that connection). No real-world report is known yet. Before #532 the same drop was a lost shared connection, and the reconnection recovered from it.

Proposed fix

In pulse_stream_state_changed(), check the shared connection instead of the stream's own one. A stream whose own connection is gone is then restarted like any failed stream, through the retry, pause and limit from #1031. A lost shared connection or a server restart is still left to the reconnection. Stacked on #1031; it will be posted after that one merges.

RED: test_pulse_stream_restart (private PipeWire, no hardware, no display) gains 5 cases. 2 fail today:

  • the server drops the connection of one source's stream: audio must return within 3 s, and the other source must not restart;
  • the connection is dropped 5 times, then twice in a row: audio returns each time, the source never gives up, and no connection is leaked.

3 cases are controls and pass today:

  • a source destroyed while its restart after a drop is pending leaks nothing;
  • only the shared connection is dropped: the reconnection restarts each source once;
  • pipewire-pulse restarts: each source is restarted once.

It skips in CI (the Tier 2 image has no PipeWire), like the existing cases.

Activity

  1. rdoupe commented on Oct 16, 2026

    @rdoupe
    CollaboratorAuthor

    Claiming: this issue.

    This is a follow-up of our #532 and builds on #1031, so the fix stays inside plugins/linux-pulseaudio and goes up after #1031 merges:

    1. RED: test_pulse_stream_restart drops the server connection of one source's stream (pw-cli destroy on its client). Audio must return within 3 s, and the other source must not restart. A second case drops it 5 times, then twice in a row. Three control cases cover a source destroyed while its restart is pending, a lost shared connection, and a pipewire-pulse restart (each source restarted once). Today the first two fail.
    2. GREEN: pulse_stream_state_changed() checks the shared connection instead of the stream's own one, so a stream whose connection is gone restarts through linux-pulseaudio: Retry failed stream restarts with a pause and a limit #1031's retry path. The reconnection still handles a lost shared connection or a server restart.
    3. Run the end-to-end test 10 times in each lane, run full ctest in both lanes, and run the released AppImage case again on the fixed build.
  2. added
    claimed
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions