Skip to content

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

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

fix(receiver): release audio device while idle#172
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

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

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.

1 participant