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

Add decky-spy plugin #621

Merged
merged 6 commits into from
Oct 29, 2024
Merged

Add decky-spy plugin #621

merged 6 commits into from
Oct 29, 2024

Conversation

Seraphli
Copy link
Contributor

@Seraphli Seraphli commented May 10, 2024

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

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

Plugin Checklist

  • I have verified that my plugin works properly on the Stable and Beta update channels of SteamOS.
  • 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 Seraphli requested a review from a team as a code owner May 10, 2024 08:17
@Seraphli
Copy link
Contributor Author

Any update about this PR?

@TrainDoctor
Copy link
Member

@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 TrainDoctor requested a review from a team July 31, 2024 23:05
@Seraphli
Copy link
Contributor Author

Seraphli commented Aug 1, 2024

Thanks. BTW, can anyone fix the installer? SteamDeckHomebrew/decky-installer#16

@Seraphli
Copy link
Contributor Author

Seraphli commented Aug 1, 2024

@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.

@TrainDoctor
Copy link
Member

@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
Copy link
Member

@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.

@Seraphli
Copy link
Contributor Author

Seraphli commented Aug 3, 2024

I have moved the python libraries into py_modules

@TrainDoctor
Copy link
Member

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.

@Seraphli
Copy link
Contributor Author

Seraphli commented Aug 3, 2024

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.

@TrainDoctor
Copy link
Member

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

@Seraphli
Copy link
Contributor Author

Seraphli commented Aug 6, 2024

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

@TrainDoctor
Copy link
Member

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.

@Seraphli
Copy link
Contributor Author

Seraphli commented Aug 6, 2024

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.

@aaburri
Copy link

aaburri commented Aug 7, 2024

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

@Seraphli
Copy link
Contributor Author

Seraphli commented Aug 8, 2024

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.

@aaburri
Copy link

aaburri commented Aug 11, 2024

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
>>> 

@Seraphli
Copy link
Contributor Author

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

@Seraphli
Copy link
Contributor Author

@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.

@zany130
Copy link

zany130 commented Sep 14, 2024

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

@Seraphli
Copy link
Contributor Author

Seraphli commented Sep 15, 2024

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.

@zany130
Copy link

zany130 commented Sep 15, 2024

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?

@Seraphli
Copy link
Contributor Author

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.

@zany130
Copy link

zany130 commented Sep 24, 2024

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?

@Seraphli
Copy link
Contributor Author

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.

@zany130
Copy link

zany130 commented Sep 28, 2024

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

@TrainDoctor
Copy link
Member

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.

@Seraphli
Copy link
Contributor Author

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

@TrainDoctor
Copy link
Member

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

Yes, just like any other plugin update/submission.

@lichi1993315
Copy link

lichi1993315 commented Oct 29, 2024

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
Copy link

IMG_2022
IMG_2024

@TrainDoctor
Copy link
Member

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

Thanks for the review. Never heard of To Moon before though. :)

Copy link
Member

@TrainDoctor TrainDoctor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testers approve, off to production.

@TrainDoctor TrainDoctor merged commit fc142d4 into SteamDeckHomebrew:main Oct 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants