Zerodya / hyprfreeze

Utility to suspend a game process (and other programs) in Hyprland and Sway
GNU General Public License v3.0
74 stars 2 forks source link

No sound in other programs when pausing a Linux native game (e.g. Minecraft) #2

Open reteov opened 11 months ago

reteov commented 11 months ago

I have encountered an issue when using this script with Minecraft... when using this script to pause a running Minecraft client, any other audio being played (I use Pipewire) is muted (the clip/video/program continues running). This seems to be one-way; audio in MC does not shut down when I pause the other app.

Zerodya commented 11 months ago

I've tested this and I'm able to replicate the issue not just with Minecraft, but with SuperTuxKart too, so my guess is that this problem is related to how some linux native games handle their sound implementation. They probably use native libraries to implement sound and by stopping the game process, it also stops the sound for every other program in linux.

I don't have control over the sound implementation of these games and there is no direct way to resume only a specific thread within a process in linux from another process, so unfortunately this doesn't seem fixable.

Running the games in gamescope doesn't fix this either. I use Pipewire too so it would be useful if someone else could test this with a different sound server like Pulseaudio and Jack, but I highly doubt that Pipewire is the issue.

Zerodya commented 9 months ago

but I highly doubt that Pipewire is the issue.

As it turns out, Pipeware was in fact the issue 😅

I've been in contact with @Merrit, the developer behind Nyrna (which is an awesome utility to suspend games in X11 desktops that I recommend you check out), and they were able to pin down the issue to Pipewire#3509.

Will have to wait until that issue is solved or a workaround is found.

Related issue at Merrit/nyrna#199

reteov commented 9 months ago

Looking at the thread, it looks like the issue will not be resolved without introducing latency to the audio, so it probably won't get fixed. ☹ Thanks for looking into it, at least it wasn't anything to do with hyprfreeze.