screenpipe icon indicating copy to clipboard operation
screenpipe copied to clipboard

Fixes Mac Audio

Open Anmol202005 opened this issue 4 months ago • 2 comments


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

  1. Sleep/Wake Test: Run screenpipe on macOS, close laptop lid for 30+ seconds, open and verify audio recording continues
  2. Long Duration Test: Run for 24+ hours on macOS and verify audio doesn't stop (vs. previous 48-50h failure)
  3. 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

Anmol202005 avatar Aug 15 '25 18:08 Anmol202005

🧪 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.

github-actions[bot] avatar Aug 15 '25 18:08 github-actions[bot]

does it work

louis030195 avatar Sep 01 '25 19:09 louis030195