SteamDeckHomebrew / decky-loader

A plugin loader for the Steam Deck.
https://decky.xyz
GNU General Public License v2.0
4.25k stars 154 forks source link

[Request] Have plugin_loader exit if steam isn't detected or retry talking to steam. #633

Closed hjri closed 5 days ago

hjri commented 4 weeks ago

Please confirm

Feature Request Description

If plugin_loader fails to communicate with steam (due to using desktop session without steam auto-started) it just puts an error message in its log and remains there. Which causes plugin_loader to essentially remain in memory forever doing nothing, which in turn makes it essentially inactive, even if steam does become available.

Further Description

I'm making this a "feature request" and not a "bug" because on steamdeck steam is essentially always on, even in desktop session, but my usecase is a DIY Steambox that uses gamescope-session-steam alongside plasma wayland session and kodi session, and steam is only auto-started in its own session (naturally).

I use some config file swapping sudo/nopasswd and bash script trickery to make sddm boot into different session type, and so far everything works, except that switching to steam essentially requires a reboot because decky isn't working.

What happens underneath is, from my understanding is this:

Jun 03 17:57:36 wangan PluginLoader[1586]: [injector][DEBUG]: Steam isn't available yet. Wait for a moment...
Jun 03 17:57:46 wangan PluginLoader[1586]: [base_events][ERROR]: Task exception was never retrieved
Jun 03 17:57:46 wangan PluginLoader[1586]: future: <Task finished name='Task-6' coro=<PluginManager.loader_reinjector() done, defined at src/main.py:109> exception=Exception('/json did not return 200. ')>
Jun 03 17:57:46 wangan PluginLoader[1586]: Traceback (most recent call last):
Jun 03 17:57:46 wangan PluginLoader[1586]:   File "src/main.py", line 116, in loader_reinjector
Jun 03 17:57:46 wangan PluginLoader[1586]:   File "src/injector.py", line 421, in get_gamepadui_tab
Jun 03 17:57:46 wangan PluginLoader[1586]:   File "src/injector.py", line 396, in get_tabs
Jun 03 17:57:46 wangan PluginLoader[1586]: Exception: /json did not return 200.

PluginLoader starts (as system service), waits for steam to become a thing, fails (because steam doesn't start because it's a Kodi or Plasma session) and just does nothing, and because it's a system service and because it just doesn't exit it's never restarted. If it were a user service that would have been restarted automatically on session change.

I see couple of ways of resolving this 1) have plugin_loader periodically try talk to steam client if connection is lost/failed 2) have plugin_loader exit if connection to steam client is lost and therefore would be restarted by systemd 3) having separate user service that actually does the talking to steam client and communicating with system service

for now I guess I'll either stick to rebooting or if I'm really impatient make another sudo/nopasswd script that does the systemctl restart plugin_loader from user

AAGaming00 commented 5 days ago

have plugin_loader periodically try talk to steam client if connection is lost/failed

It already does this (silently). It always has. File a bug if it isn't.