Skip to content

Fix macOS sleep issue via idle auto-pause and shared memory polling - #12

Open
joaopaulomello wants to merge 1 commit into
cvknage:mainfrom
joaopaulomello:fix-sleep-issue
Open

Fix macOS sleep issue via idle auto-pause and shared memory polling#12
joaopaulomello wants to merge 1 commit into
cvknage:mainfrom
joaopaulomello:fix-sleep-issue

Conversation

@joaopaulomello

@joaopaulomello joaopaulomello commented Aug 23, 2026

Copy link
Copy Markdown

This PR fixes the issue where the Equaliser app prevents macOS from sleeping.

It does this by monitoring the meters for complete silence. If silence is detected for 5 seconds, it pauses the CoreAudio output graph, which releases the PreventUserIdleSystemSleep power assertion.

While paused, it relies on a lightweight polling mechanism to read the lock-free writeIndex directly from the shared memory buffer. If the index advances and contains actual audio samples (>-80dB), it instantly resumes the audio graph.

This solution completely resolves the sleep issue without requiring any modifications to the C driver.
I did it for myself and decide to share. Have a good one.

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.

2 participants