Skip to content

Conversation

Anmol202005
Copy link
Contributor


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

Copy link
Contributor

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

@louis030195
Copy link
Collaborator

does it work

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.

2 participants