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

High CPU Usage by legacyScreenSaver Process on MacBook M1 After Sonoma 14.X Update #25

Open
HoBeom opened this issue Feb 28, 2024 · 16 comments

Comments

@HoBeom
Copy link

HoBeom commented Feb 28, 2024

Environment:

  • Device: MacBook M1
  • OS: Sonoma 14.X
  • Application: LifeSaver Screen Saver

Issue Description:
After updating my MacBook M1 to Sonoma 14.X, I've started experiencing an issue with the LifeSaver screen saver causing excessive CPU usage. Specifically, the legacyScreenSaver process consumes over 100% CPU. This issue began immediately following the OS update.

Steps to Reproduce:

  1. Update the MacBook M1 to Sonoma 14.X.
  2. Use LifeSaver as the screen saver.
  3. Observe the legacyScreenSaver process's CPU usage in Activity Monitor.

Expected Behavior:
The legacyScreenSaver process should not consume excessive CPU resources, allowing the screen saver to run smoothly without impacting system performance.

Actual Behavior:

  • The legacyScreenSaver process exceeds 100% CPU usage when the LifeSaver screen saver is active.
  • Restarting the MacBook and changing the screen saver temporarily resolves the issue, but it reoccurs when switching back to LifeSaver.
  • It appears that the screen saver might be causing the legacyScreenSaver process to persistently use CPU resources in the background, even when not active. Additionally, entering the screen saver seems to compound the CPU usage each time, suggesting possible resource allocation or release issues.

Troubleshooting Steps Taken:

  • Changed the screen saver to default
  • Restarted the MacBook M1 or kill process 'legacyScreenSaver-x86_64'

Request:

  • Could the compatibility of LifeSaver with Sonoma 14.X on MacBook M1 be investigated?
  • Is this issue observed on other Mac models, particularly those not using Intel processors?

Additional Information:

  • This problem was not present before the Sonoma 14.X update, indicating a potential compatibility issue with the new OS version.

Thank you for your attention to this matter. I look forward to any updates or suggestions for resolving this issue.

SCR-20240228-qigr

@amiantos
Copy link
Owner

I think all legacy screensavers have issues in Sonoma, but maybe I'm wrong. I'll look around to see what I can find. I would be surprised if Apple doesn't remove legacy screensaver support at some point but that depends on them releasing the new screensaver framework and they haven't...

@amiantos
Copy link
Owner

A quick google indicates this is a widespread issue with screensavers in Sonoma :(

@amiantos
Copy link
Owner

In case someone else lands here, allegedly there is an open radar for this: FB13041503. Not sure how to look it up myself at the moment to see what the deal is.

@HoBeom
Copy link
Author

HoBeom commented Mar 7, 2024

Thank you for your quick comments.
I've tested your other screensaver, multiclock, and it doesn't exhibit the same high CPU usage issue.
This makes me wonder if the underlying codebase or implementation between LifeSaver and multiclock differs in a way that affects how they interact with the Sonoma update.
Could this observation provide any insight or potential direction for troubleshooting the high CPU usage issue with LifeSaver?

@amiantos
Copy link
Owner

amiantos commented Mar 8, 2024

Thank you for your quick comments. I've tested your other screensaver, multiclock, and it doesn't exhibit the same high CPU usage issue. This makes me wonder if the underlying codebase or implementation between LifeSaver and multiclock differs in a way that affects how they interact with the Sonoma update. Could this observation provide any insight or potential direction for troubleshooting the high CPU usage issue with LifeSaver?

Hmm, good idea. I thought Multiclock did it too, but I'll test them both out and see how it goes. I know that as I learned more, I built the screensavers a bit differently, so you might be right that there is something I can fix. I have another screensaver, Ealain, that is built much differently from the others and I think it exhibits the same issue, so I've been assuming it's just all screensavers. But maybe it isn't...

I'll look into it!

@amiantos
Copy link
Owner

I hoped the newest macOS would have solved this, but it didn't, so I guess I can't drag my feet any longer and need to figure out how to get a new version together that runs well on macOS Sonoma+.

@amiantos
Copy link
Owner

There doesn't seem to be a difference in how the screensaver is initalized between MultiClock and LifeSaver, so the issue must be somewhere in my SKScene. Since LifeSaver was essentially my first major programming project, so many years ago, it's probably worth just rewriting a lot of it from scratch and seeing if something better comes out. I need to rewrite how the field is generated no matter what to fix #24 anyway.

@amiantos amiantos added this to the Screensaver v2.0 milestone Jan 26, 2025
@amiantos
Copy link
Owner

I noticed in Activity Monitor just now hat the screensaver is running in Intel mode on Apple Silicon computers and maybe that is part of the issue. It could be a rewrite isn't even necessary and I just need to make a new build for Apple Silicon…

@amiantos amiantos changed the title High CPU Usage by legacyScreenSaver Process on MacBook M1 After Sonoma 14.X Update High CPU Usage by legacyScreenSaver Process on MacBook M1 After Sonoma 14.X Update Jan 27, 2025
@amiantos
Copy link
Owner

I made a silicon build and installed it and it ran horribly, like 5 frames per second, I don't get it…

@amiantos
Copy link
Owner

Okay it's because Life Saver v1.2 ruins the LegacyScreensaver process somehow, and every legacyscreensaver process in activity monitor has to be quit to fix performance again without rebooting. Gonna see if silicon one works fine now..

@amiantos
Copy link
Owner

Now I'm getting a weird bug where the preview has the right color settings but the actual screensaver isn't loading the new preset…

@amiantos
Copy link
Owner

Okay I had to force close the legacyscreensaver process again to get settings to work, there must be something I am doing wrong in the app somewhere because multiclock doesn't have this issue for sure.

@amiantos
Copy link
Owner

Performance degrades in MultiClock over time too, or it's like subsequence launches past the first one... I'm probably rediscovering already known facts about this issue, but, this sucks! I don't feel like this happens to one of my other screensavers, Ealain, but I think it isn't using SpriteKit…

@amiantos
Copy link
Owner

I might be able to rewrite Life Saver to use basic views and CAAnimations and get rid of spritekit entirely, and both codebases should still work on Apple TV and the screensaver, I think…

@amiantos
Copy link
Owner

I found someone who suggests this commit has a fix for this issue: liquidx/webviewscreensaver@8271566

@amiantos
Copy link
Owner

amiantos commented Feb 2, 2025

I can confirm that, at least with my other screensavers, this is a fix for the issues on the last two/three versions of macOS... took me long enough to tackle this...

amiantos/ealain@ad9f29f

I'll report back when I have a fixed version of Life Saver, assuming this is the main problem with Life Saver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants