Fixes Mac Audio
name: pull request about: submit changes to the project title: "[pr] Fix macOS audio resilience - prevent disconnections" labels: '' Issue: #1626
description
Fixes macOS audio recording randomly stopping after 48-50+ hours by implementing connection resilience instead of reactive restarts.
Changes:
- Improved error handling to continue on temporary audio errors (sleep/wake, driver hiccups)
- Added automatic device reconnection for disconnected streams within 30 seconds
- Added retry logic with exponential backoff for device startup failures
- Added lightweight monitoring for connection health on macOS (30s intervals)
- Removed heavy timer-based restart approach in favor of prevention
Root cause: macOS CoreAudio sessions get invalidated during sleep/wake cycles and the old code treated all audio errors as terminal, stopping recording completely.
related issue: (addresses reported macOS audio stability issues)
how to test
- Sleep/Wake Test: Run screenpipe on macOS, close laptop lid for 30+ seconds, open and verify audio recording continues
- Long Duration Test: Run for 24+ hours on macOS and verify audio doesn't stop (vs. previous 48-50h failure)
- Device Disconnection Test: Unplug/replug audio devices and verify automatic reconnection within 30 seconds
Expected behavior: Audio recording should maintain stable connections indefinitely on macOS, matching Windows reliability.
/claim #1626
🧪 testing bounty created!
a testing bounty has been created for this PR: view testing issue
testers will be awarded $20 each for providing quality test reports. please check the issue for testing requirements.
does it work