Skip to content

feature(audio): release audio sink on client pause#1465

Open
RJNY wants to merge 1 commit into
ClassicOldSong:masterfrom
RJNY:feature/sleep-on-pause
Open

feature(audio): release audio sink on client pause#1465
RJNY wants to merge 1 commit into
ClassicOldSong:masterfrom
RJNY:feature/sleep-on-pause

Conversation

@RJNY

@RJNY RJNY commented Apr 15, 2026

Copy link
Copy Markdown

I was going crazy trying to figure out why the PC refused to sleep (thread) while using your AHK sleep scripts and realized it's one of 2 things:

  • game full screen prevents sleep. (obviously, but irrelevant to this PR)
  • audio sink holds audio driver hostage on disconnect (directly relates to this PR)

This change introduces a fix for the second bullet point. It releases the audio driver when all clients disconnect, so it no longer prevents the PC from sleeping.
I've tested these changes on my local machine for over a week now using my own personal AHK script (still needs work) that freezes and minimizes the game, allowing the host PC to sleep on disconnect!

Trying not to go too deep into the AHK script specifics on this audio sink PR, but thought it was relevant to understanding why I want this change.

This is an opt-in feature. original behavior is preserved by default.

@RJNY RJNY changed the title feature(audio): release audio sink on pause feature(audio): release audio sink on client disconnect Apr 15, 2026
@RJNY RJNY force-pushed the feature/sleep-on-pause branch 2 times, most recently from f91e087 to 59df475 Compare April 15, 2026 20:42
@RJNY RJNY force-pushed the feature/sleep-on-pause branch from 59df475 to 60e9cf9 Compare April 15, 2026 22:39
@ClassicOldSong

Copy link
Copy Markdown
Owner

Thank you but why change the title? Technically you should only release it when paused, which means all clients are disconnected.

@RJNY

RJNY commented Apr 16, 2026

Copy link
Copy Markdown
Author

Thank you but why change the title? Technically you should only release it when paused, which means all clients are disconnected.

the short answer is, I was arguing with myself about semantics.

I was concerned about conflating the two concepts. For my use case, I am “pausing” with pause.ahk, but likely a majority of users don’t use the ahk scripts to pause, they disconnect but keep the session alive. So I was making sure not to conflate the two and keep the language neutral and not break expected behavior without scripts. but the process is indeed “paused”, so I had it right the first time.

reverted title back to pause.

@RJNY RJNY changed the title feature(audio): release audio sink on client disconnect feature(audio): release audio sink on client pause Apr 16, 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