decky-plugin-database icon indicating copy to clipboard operation
decky-plugin-database copied to clipboard

Add decky-spy plugin

Open Seraphli opened this issue 1 year ago • 25 comments

Decky Spy

Decky Spy is a plugin to monitor memory and processes on your Steam Deck. It depends on DeckyLoader.

Features

  • Monitor CPU usage, network information.
  • Monitor memory usage of processes, and warn when the memory usage is high.
  • Monitor battery level, and warn when the battery is low.
  • Monitor current session playtime, and remind you to take a break when you play games for a long time.

Checklist:

Developer Checklist

  • [x] I am the original author or an authorized maintainer of this plugin.
  • [x] I have abided by the licenses of the libraries I am utilizing, including attaching license notices where appropriate.

Plugin Checklist

  • [x] I have verified that my plugin works properly on the Stable and Beta update channels of SteamOS.
  • [x] I have verified my plugin is unique or alternatively provides more/alternative functionality to a similar plugin already on the store.

Plugin Backend Checklist

  • No: I am using a custom backend other than Python.
  • No: I am using a tool or software from a 3rd party FOSS project that does not have it's dependencies statically linked.
  • No: I am using a custom binary that has all of it's dependencies statically linked.

Testing

  • [ ] Tested on SteamOS Stable/Beta Update Channel.

Seraphli avatar May 10 '24 08:05 Seraphli

Any update about this PR?

Seraphli avatar Jun 28 '24 13:06 Seraphli

@Seraphli apologies, I suspect the workflow failed and then the PR was passed over due to having to prioritize PRs without failed builds. It looks like the workflow worked this go around and the plugin should now be on the testing store.

TrainDoctor avatar Jul 31 '24 23:07 TrainDoctor

Thanks. BTW, can anyone fix the installer? https://github.com/SteamDeckHomebrew/decky-installer/issues/16

Seraphli avatar Aug 01 '24 03:08 Seraphli

@TrainDoctor I test the plugin in test store, but I find the plugin is not built properly. May I ask how the plugin is built? So I can fix the process. When I build the plugin, I use my modified task to build a python module in a docker environment, which avoids install python requirements on Steam Desk. https://github.com/Seraphli/decky-spy/blob/1063de3e9b4b5cbd56341f215420d89033a8de9c/.vscode/tasks.json#L79-L112 But this module is not present in the store version.

Seraphli avatar Aug 01 '24 05:08 Seraphli

@TrainDoctor I test the plugin in test store, but I find the plugin is not built properly. May I ask how the plugin is built? So I can fix the process. When I build the plugin, I use my modified task to build a python module in a docker environment, which avoids install python requirements on Steam Desk. https://github.com/Seraphli/decky-spy/blob/1063de3e9b4b5cbd56341f215420d89033a8de9c/.vscode/tasks.json#L79-L112 But this module is not present in the store version.

All python requirements must be bundled into the defaults folder in order to work properly. Use the CLI builder to see what the plugin will build as on the store.

TrainDoctor avatar Aug 01 '24 12:08 TrainDoctor

@Seraphli your recent commit bundles our CLI binary into your defaults folder which will not accomplish anything other than shipping an unnecessary binary with a broken plugin. You need to take any python libraries into a py_modules folder and place that folder in the defaults folder where the plugin can grab the libraries directly from py_modules etc. Please look towards other plugins that use python libraries for examples of how to do this properly.

TrainDoctor avatar Aug 02 '24 19:08 TrainDoctor

I have moved the python libraries into py_modules

Seraphli avatar Aug 03 '24 11:08 Seraphli

I have moved the python libraries into py_modules

Please understand that these will not be deployed with your plugin unless you move py_modules into the defaults folder.

TrainDoctor avatar Aug 03 '24 13:08 TrainDoctor

I follow this repo, https://github.com/steam3d/MagicPodsDecky This repo didn't move py_modules into default And I tested the package locally, the plugin works.

Seraphli avatar Aug 03 '24 13:08 Seraphli

I follow this repo, https://github.com/steam3d/MagicPodsDecky This repo didn't move py_modules into default And I tested the package locally, the plugin works.

Ah, I think I missed a change in our CI/CD at some point. Just checked the built plugin and it seems to be layed out correctly. All good for testing. @SteamDeckHomebrew/decky-testers

TrainDoctor avatar Aug 05 '24 22:08 TrainDoctor

I update the plugin using test-store. The plugin works fine on Steam family beta and decky loader beta.

Seraphli avatar Aug 06 '24 06:08 Seraphli

I update the plugin using test-store. The plugin works fine on Steam family beta and decky loader beta.

A user other than the plugin developer needs to submit a testing report for the plugin to go to production. Thanks.

TrainDoctor avatar Aug 06 '24 06:08 TrainDoctor

A user other than the plugin developer needs to submit a testing report for the plugin to go to production. Thanks.

Yeah I get it. I just report my test result.

Seraphli avatar Aug 06 '24 07:08 Seraphli

I update the plugin using test-store. The plugin works fine on Steam family beta and decky loader beta.

Testing on Stable Decky/SteamOS/Client; get error: [ERROR]: Failed to start DeckySpy! 2024-08-04 23.49.47.log

aaburri avatar Aug 07 '24 22:08 aaburri

I update the plugin using test-store. The plugin works fine on Steam family beta and decky loader beta.

Testing on Stable Decky/SteamOS/Client; get error: [ERROR]: Failed to start DeckySpy! 2024-08-04 23.49.47.log

@aaburri Could you make another test? Swtich to desktop mode and then open a terminal. run python and then import psutil. And then print(psutil.__version__)

I just notice there already have psutil installed in the system python library. But I don't know whether this psutil on my steam deck is installed by myself or come with SteamOS. And the log shows the error seems to be related with importing module from system's psutil.

Seraphli avatar Aug 08 '24 04:08 Seraphli

I update the plugin using test-store. The plugin works fine on Steam family beta and decky loader beta.

Testing on Stable Decky/SteamOS/Client; get error: [ERROR]: Failed to start DeckySpy! 2024-08-04 23.49.47.log

@aaburri Could you make another test? Swtich to desktop mode and then open a terminal. run python and then import psutil. And then print(psutil.__version__)

I just notice there already have psutil installed in the system python library. But I don't know whether this psutil on my steam deck is installed by myself or come with SteamOS. And the log shows the error seems to be related with importing module from system's psutil.

(deck@steamdeck ~)$ python
Python 3.11.3 (main, Jun  5 2023, 09:32:32) [GCC 13.1.1 20230429] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import psutil
>>> print(psutil.__version__)
5.9.5
>>> 

aaburri avatar Aug 11 '24 01:08 aaburri

@TrainDoctor I have made an update. Still waiting for building the plugin.

Seraphli avatar Aug 18 '24 17:08 Seraphli

@aaburri I have done a test on my SteamDeck. Could you please do another test about the new version? Thanks. @TrainDoctor Is there a docker image that can help testing the plugin? I don't know where to find a clean test environment.

Seraphli avatar Aug 20 '24 06:08 Seraphli

Not sure if this is supported but thought maybe I should report this

On decky v3 stable , bazzite, steam game session, desktop pc

the plugin seems to kill the decky process

See: https://github.com/SteamDeckHomebrew/decky-loader/issues/662#issuecomment-2350781843

Uninstalling the decky spy plugin fixes those issues.

I reinstalled it and the issues came back

Left all settings at default values except the addition timer i set it to 2 hours and enabled it

zany130 avatar Sep 14 '24 23:09 zany130

Not sure if this is supported but thought maybe I should report this

On decky v3 stable , bazzite, steam game session, desktop pc

the plugin seems to kill the decky process

See: SteamDeckHomebrew/decky-loader#662 (comment)

Uninstalling the decky spy plugin fixes those issues.

I reinstalled it and the issues came back

Left all settings at default values except the addition timer i set it to 2 hours and enabled it

@zany130 Thanks for reporting. I don't have anyissue on SteamOS 3.5.19 and DeckyLoader v3.0.0. I will try to update OS and test again. I switched to stable channel and my SteamDeck still stays at SteamOS 3.5.19. I don't have this issue. Maybe I can modify the button to disable refreshing process info later. So this psutils issue don't happen.

Seraphli avatar Sep 15 '24 07:09 Seraphli

Idk if this is maybe because of something in fedora( vs the arch base of steamos) which bazzite is based on maybe systemd's oom thing?

zany130 avatar Sep 15 '24 21:09 zany130

Idk if this is maybe because of something in fedora( vs the arch base of steamos) which bazzite is based on maybe systemd's oom thing?

From your log, it shows psutils library crash with some problem. This plugin current is using psutils that already in the system, since SteamOS seems have psutils installed. So there might be some problems with your system psutils. Maybe reinstall it (which may re-compile it) will solve this issue.

Seraphli avatar Sep 24 '24 17:09 Seraphli

I don't think bazzite has psutils at least I don't find it the path

also you cant really "install or reinstall "packages on bazzite on the system level since its immutable just like steam os (technically you can overlay rpm packages but its recommended you don't)

EDIT: NVM bazzite does seems to pre install python3-psutil from fedora https://packages.fedoraproject.org/pkgs/python-psutil/python3-psutil/

EDIT2: it looks like the package has been updated since I last tried decky-spy. I will try it again after making sure I am fully up to date. otherwise I guess I should open a bug report on the package since steam-os psutil seems fine?

zany130 avatar Sep 24 '24 19:09 zany130

It could be an issue with psutil, or it might be due to a misalignment between some underlying C++ dynamic library on your system and the version it was compiled with. It could also be caused by Python, because from the log you provided last time, psutil actually ran for a while before indicating a memory issue related to C.

Sep 13 20:41:01 bazzite PluginLoader[6070]: Fatal Python error: none_dealloc: deallocating None: bug likely caused by a refcount error in a C extension
Sep 13 20:41:01 bazzite PluginLoader[6070]: Python runtime state: initialized

You can check if your version differs from the one mentioned above. From my experience, the Python version and the psutil version mentioned above don't have any issues.

Seraphli avatar Sep 25 '24 01:09 Seraphli

Still happens on a update bazzite system so it's probably an issue with psutils or Python like you said from fedora (bazzite doesn't change this from fedora)

deckylog.txt

zany130 avatar Sep 28 '24 01:09 zany130

Need testers for this. Giving until the end of the month for this plugin to receive a proper testing report or the PR will be closed.

TrainDoctor avatar Oct 13 '24 18:10 TrainDoctor

Does this mean I need to find a tester for testing?

Seraphli avatar Oct 17 '24 18:10 Seraphli

Does this mean I need to find a tester for testing?

Yes, just like any other plugin update/submission.

TrainDoctor avatar Oct 22 '24 18:10 TrainDoctor

Decky 3.0.1, SteamOS 3.5.19 A) No major blocking issues B) No minor issues C) A list of currently installed plugins

  • To Moon - 0.2.5
  • DeckySpy - 0.6.7-96d61e6

D) Yay

lichi1993315 avatar Oct 29 '24 17:10 lichi1993315

IMG_2022 IMG_2024

lichi1993315 avatar Oct 29 '24 17:10 lichi1993315