Skip to content

fix: add init timeouts for PipeWire and PulseAudio#1194

Open
roderickvd wants to merge 2 commits intomasterfrom
fix/blocking-audio-servers
Open

fix: add init timeouts for PipeWire and PulseAudio#1194
roderickvd wants to merge 2 commits intomasterfrom
fix/blocking-audio-servers

Conversation

@roderickvd
Copy link
Copy Markdown
Member

(Hopefully) fixes #1192

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initialization timeouts to the Linux audio backends to avoid cpal::default_host() hanging indefinitely (per #1192), allowing host selection to fall back when PipeWire/PulseAudio initialization stalls.

Changes:

  • PulseAudio: wrap pulseaudio::Client::from_env in a helper thread and fail host init after a fixed timeout.
  • PipeWire: introduce a fixed init timeout constant and add a watchdog to stop the PipeWire mainloop if done events never arrive; also reuse the constant for stream init waits.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/host/pulseaudio/mod.rs Adds a bounded wait around Client::from_env to prevent indefinite blocking during PulseAudio host initialization.
src/host/pipewire/device.rs Adds a PipeWire init watchdog (and shared init timeout constant) to avoid hangs during device discovery and stream initialization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/host/pulseaudio/mod.rs Outdated
@roderickvd roderickvd force-pushed the fix/blocking-audio-servers branch from c94a90b to f5532e5 Compare May 9, 2026 13:34
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@marin-m
Copy link
Copy Markdown

marin-m commented May 9, 2026

works on my setup

@roderickvd
Copy link
Copy Markdown
Member Author

works on my setup

Just to be sure: was your setup hanging before too and is it now fixed?

@marin-m
Copy link
Copy Markdown

marin-m commented May 9, 2026

no issue on my setup but you requested me to test on the other ticket

@roderickvd
Copy link
Copy Markdown
Member Author

Yes would be great to hear from your users that suffered from it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CPAL 0.18 devel with PipeWire enabled and PipeWire+PulseAudio running not working on FuriOS - Seems to block quietly on initialization

3 participants