Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Steam is started as a child process of /usr/bin/sunshine-run #151

Open
luzfcb opened this issue Jun 18, 2024 · 3 comments
Open

Ensure Steam is started as a child process of /usr/bin/sunshine-run #151

luzfcb opened this issue Jun 18, 2024 · 3 comments
Labels
status:awaiting-triage type:enhancement New feature or request for feature enhancement

Comments

@luzfcb
Copy link

luzfcb commented Jun 18, 2024

Is your feature request related to a problem?

Yes.

In the process of figuring out why I could connect on Sunshine via moonlight but the sometimes the controls on Steam didn't work, I discovered that the controls only work if and only if Steam is launched via /usr/bin/sunshine-run like /usr/bin/sunshine-run /usr/games/steam steam://open /bigpicture .

This is also the same for Heroic Game Launcher and others. In other words, for control via Moonlight to work, the software must be a child process of Sunshine's /usr/bin/sunshine-run command.

The problem is that docker-steam-headless starts Steam in some places independently of sunshine-run :

command=/usr/games/steam %(ENV_STEAM_ARGS)s

Exec=/usr/games/steam %U ${STEAM_ARGS:-}

and also the session autostart Steam option and the shortcuts on the menu

What is your feature request?

Ensure Steam is started as a child process of /usr/bin/sunshine-run in all parts that maybe start steam automatically or manually, like the Steam entry on the menu and all the autostart scripts

Are there any workarounds?

I replaced the default "Detached Commands" of the Steam Big Picture application configuration inside Sunshine

from

/usr/bin/sunshine-run /usr/games/steam steam://open/bigpicture

to

/mnt/games/mycustom_helpers/start_steam_via_sunshine.sh

This is the content of the start_steam_via_sunshine.sh command

#!/bin/bash

echo "Stopping Steam"

# Check if Steam is running before attempting to stop it
if ps h -C steam > /dev/null; then
    /usr/games/steam steam://exit
else
    echo "Steam is not running."
fi

# Wait for Steam to stop
while ps h -C steam > /dev/null; do
    echo "Waiting for Steam to stop..."
    sleep 1
done

echo "Starting Steam Big Picture via Sunshine"
/usr/bin/sunshine-run /usr/games/steam steam://open/bigpicture

I read https://developer.valvesoftware.com/wiki/Command_line_options#SteamCMD and just tested the commands and discovered that I can make Steam exit and close via /usr/games/steam steam://exit

Note: The best way to ensure that everything will always work is to force quit Steam even if Steam was launched via sunshine-run, but quitting and starting Steam again is a slow process.

Maybe it would be better to improve my script so as not to force exit if it was started via sunshine-run

Additional Context

No response

@luzfcb luzfcb added status:awaiting-triage type:enhancement New feature or request for feature enhancement labels Jun 18, 2024
@Josh5
Copy link
Collaborator

Josh5 commented Jun 20, 2024

This is interesting. I have not experienced this myself.

One thing i would point out is that by stopping steam and restarting it every time you connect via sunshine, it means I would also always need to select the profile each time. This means steam link would stop working after using a sunshine session.

@luzfcb
Copy link
Author

luzfcb commented Jun 20, 2024

@Josh5 What did you mean by always need to select the profile each time?

What profile?

@Josh5
Copy link
Collaborator

Josh5 commented Jun 21, 2024

@Josh5 What did you mean by always need to select the profile each time?

What profile?

Selecting which user to log into steam as. My setup has my whole family.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:awaiting-triage type:enhancement New feature or request for feature enhancement
Projects
None yet
Development

No branches or pull requests

2 participants