Skip to content

fix: recover the Rust audio engine from a dead output stream - #161

Merged
noFAYZ merged 1 commit into
mainfrom
fix/alsa-stream-recovery-154
Oct 7, 2026
Merged

noFAYZ merged 1 commit into
mainfrom
fix/alsa-stream-recovery-154

Conversation

@noFAYZ

@noFAYZ noFAYZ commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Fixes #154.

  • Cause: rodio's default stream error callback only logs. On ALSA, cpal re-polls after POLLERR with no recovery, so a dead device spun the boosted audio thread and froze playback.
  • Fix: each stream gets its own error callback. Underruns are ignored; any other error is reported once. The engine drops the dead stream and emits an early native-audio-ended, so the existing premature-end path reloads the track at its position. The next load reopens the device.
  • Paused: the lost track is reloaded on the next play instead of autoplaying.
  • Device that keeps failing: a stream dying within 10s of opening makes loads return an error for 10s, instead of walking the queue.
  • SetOutputDevice shares the same reopen path.
  • Test: an underrun is never reported, and repeated POLLERR is reported once.

Linux PipeWire branch not compiled locally; not tested against a real ALSA failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
zuno Ready Ready Preview Oct 7, 2026 2:52pm UTC

@noFAYZ
noFAYZ merged commit d14888b into main Oct 7, 2026
10 checks passed

This branch was successfully deployed

1 active deployment
Preview — 2a0d055e Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audio playback intermittently fails with alsa::poll() returning POLLERR

1 participant