Skip to content

fix(receiver): release audio device while idle - #172

Closed
Betafer wants to merge 1 commit into
swellweb:maint-3.5from
Betafer:codex/fix-receiver-idle-audio-v3.5
Closed

Betafer wants to merge 1 commit into
swellweb:maint-3.5from
Betafer:codex/fix-receiver-idle-audio-v3.5

Conversation

@Betafer

@Betafer Betafer commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Keep the Receiver audio output device closed while it is waiting for a Sender, and open it lazily on the first audio packet.

On macOS, an open SDL output device can cause coreaudiod to hold PreventUserIdleSystemSleep even when the callback only emits silence. It also touches the system output unnecessarily for sessions where audio relay is disabled.

Behavior

  • no audio device is opened while the Receiver is idle
  • the device opens on the first audio frame and playback starts after that frame is queued
  • the device and queued samples are released when the client disconnects
  • failed device opens are rate-limited to one retry every five seconds
  • existing audio packet and buffering behavior is otherwise unchanged

Verification

  • rebased onto maint-3.5 at v3.5.1-rc.3
  • Receiver make test: 67 parser checks, 562 input-queue checks, 13 receiver-profile checks; all pass
  • full Receiver build succeeds
  • verified on a 2017 Intel iMac: audio opens during an active relayed-audio session and the Receiver no longer owns a coreaudiod sleep assertion after disconnect

@swellweb

swellweb commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Thanks @Betafer for this contribution! Integrated into maint-3.5 through #191, with original author credit preserved. The integration passed Sender/Receiver CI on Intel and Apple Silicon, targeted tests and live testing. Closing this PR as incorporated; the fixes are included in the upcoming 3.5.1 maintenance release.

@swellweb swellweb closed this Sep 5, 2026
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