Skip to content

Each pulseaudio playback leaks a PA stream #1188

@knz

Description

@knz

cpal::Stream::new_playback spawns a thread that runs block_on(stream.play_all()).
Internally play_all is source_eof().await?; drain().await?; : it waits for the cpal callback to return 0 bytes. But the CallbackWrapper in the pulseaudio crate (0.3.1) always returns buf.len(), never 0.

So that thread blocks forever, holds an Arc<InnerPlaybackStream> clone, and InnerPlaybackStream::drop (which sends DeletePlaybackStream) never fires.

Result: every playback = one leaked PA stream plus one stuck OS thread.

Stream::drop only calls handle.cancel(), which unblocks the latency-monitor thread, not the play_all thread.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions