Jovian-Experiments / Jovian-NixOS

Discussions: https://matrix.to/#/#Jovian-Experiments:matrix.org
https://jovian-experiments.github.io/Jovian-NixOS/
MIT License
481 stars 49 forks source link

Decky Loader plugins have mixed compatability #203

Open DylanRJohnston-FZ opened 9 months ago

DylanRJohnston-FZ commented 9 months ago

Any decky loader plugin functionality backed by a python script doesn't appear to work at all, with the only hint of errors in the deck-loader service at startup.

Nov 04 16:39:36 nixos systemd[1]: Starting Steam Deck Plugin Loader...
Nov 04 16:39:36 nixos systemd[1]: Started Steam Deck Plugin Loader.
Nov 04 16:39:36 nixos decky-loader[929]: [helpers][WARNING]: Failed to execute get_system_pythonpaths(): [Errno 2] No such file or directory: 'python3'
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: plugin_path: /var/lib/decky-loader/plugins
Nov 04 16:39:36 nixos decky-loader[929]: [base_events][ERROR]: Task exception was never retrieved
Nov 04 16:39:36 nixos decky-loader[929]: future: <Task finished name='Task-5' coro=<service_start() done, defined at /nix/store/frvbs0a50i2vn9wym9w9y4n91n9l053v-decky-loader-2.10.5/lib/d>
Nov 04 16:39:36 nixos decky-loader[929]: Traceback (most recent call last):
Nov 04 16:39:36 nixos decky-loader[929]:   File "/nix/store/frvbs0a50i2vn9wym9w9y4n91n9l053v-decky-loader-2.10.5/lib/decky-loader/localplatformlinux.py", line 138, in service_start
Nov 04 16:39:36 nixos decky-loader[929]:     res = run(cmd, stdout=PIPE, stderr=STDOUT)
Nov 04 16:39:36 nixos decky-loader[929]:           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 04 16:39:36 nixos decky-loader[929]:   File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/subprocess.py", line 548, in run
Nov 04 16:39:36 nixos decky-loader[929]:     with Popen(*popenargs, **kwargs) as process:
Nov 04 16:39:36 nixos decky-loader[929]:          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nov 04 16:39:36 nixos decky-loader[929]:   File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/subprocess.py", line 1026, in __init__
Nov 04 16:39:36 nixos decky-loader[929]:     self._execute_child(args, executable, preexec_fn, close_fds,
Nov 04 16:39:36 nixos decky-loader[929]:   File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/subprocess.py", line 1950, in _execute_child
Nov 04 16:39:36 nixos decky-loader[929]:     raise child_exception_type(errno_num, err_msg, err_filename)
Nov 04 16:39:36 nixos decky-loader[929]: FileNotFoundError: [Errno 2] No such file or directory: 'systemctl'
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: import plugins from /var/lib/decky-loader/plugins
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: ControllerTools
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded Controller Tools
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: vibrantDeck
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded vibrantDeck
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: moondeck
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded MoonDeck
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: hltb-for-deck
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Plugin HLTB for Deck is passive
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded HLTB for Deck
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: sharedeck-y
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded DeckSettings
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: decky-storage-cleaner
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded Storage Cleaner
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: Bluetooth
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded Bluetooth
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: found plugin: protondb-decky
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Plugin ProtonDB Badges is passive
Nov 04 16:39:36 nixos decky-loader[929]: [loader][INFO]: Loaded ProtonDB Badges
Nov 04 16:39:46 nixos decky-loader[929]: [loader][INFO]: Hot reload enabled
Nov 04 16:39:52 nixos decky-loader[929]: [main][INFO]: Loading Decky frontend!
Nov 04 16:40:08 nixos decky-loader[929]: [updater][INFO]: Updated remote version information

In particular this line

Nov 04 16:39:36 nixos decky-loader[929]: [helpers][WARNING]: Failed to execute get_system_pythonpaths(): [Errno 2] No such file or directory: 'python3'
DylanRJohnston-FZ commented 9 months ago

Decky loader plugins that don't have python backends like HLTB work just fine.

DylanRJohnston-FZ commented 9 months ago

The CEF console within Decky-Loader's developer tools is full of errors about being unable to connect to a websocket which appears to be the main way Decky-Loader's front-end communicates with its backend https://github.com/SteamDeckHomebrew/decky-loader/blob/44e6f03b0655a9f1e87530141ad907b9553744cc/backend/src/plugin.py#L163.

DylanRJohnston-FZ commented 9 months ago

So I did a bit more digging. Decky loader didn't appear to have any detailed logging so I forked it and added the fork as an overlay.

This let me discover that it isn't a global problem, but a series of problems with different plugins.

Storage Control

It tries to report the size of steam files here. It uses environ["HOME"] which is set up by decky-loader here. Based on this, you can fix it by changing the decky-loader user to your username e.g. dylanj.

Vibrant Deck

Vibrant Deck fails with errors, being unable to find xprop, I've tried adding xorg.xprop to the extraPackages option in the decky-loader module, and while this does get correctly written to the service definition in /etc/systemd/system/decky-loader.service, for some reason it's not in the PATH when I look via htop. Something in-between must be modifying the PATH of the process.

Should I start putting some documentation together on which plugins work and what the workarounds are if any?

DylanRJohnston-FZ commented 9 months ago

I also wonder if decky-loader upstream would welcome a DEBUG logging mode to help make tracking down these problems a lot easier.

pongo1231 commented 9 months ago

Does appending the bin path of xorg.xprop to the PATH in the decky-loader script work?

K900 commented 9 months ago

VibrantDeck is fundamentally a hack and should not be used, use Steam's native color management which is more correct.

DylanRJohnston-FZ commented 9 months ago

Hey K900, while that may be true, I was more proposing putting together a document detailing what decky-loader plugins work, and what, if any work-arounds are required for them. The entry for vibrant deck could be "Don't use it, use the native colour management instead" and would save people time trying to get it to work.

Further more it appears that injecting new packages into PATH via the extraPackages configuration option is not functioning correctly as something else is setting the PATH for the systemd service.

Cloudef commented 7 months ago

here is how I handle the deckyloader mess https://github.com/Cloudef/nixos-flake/blob/master/modules/steamdeck-experience.nix#L65-L103