#Spyglass CPU usage on Pi5 (8Gb).

45 messages · Page 1 of 1 (latest)

cinder vessel
#

Spyglass CPU usage on Pi5 (8Gb).
The CPU usage of Spyglass on my pi5 + Picam3 is steadily sitting between 65-90% with 20-ish spyglass processes running when printer is idle. I used KIAUH and installed spyglass per instruction from the repo.
This doesn't seem right, see the screenshot.
Spyglass: 0.16.2-0-g54930cf9
Moonraker: v0.9.3-64-g4889a2dd
Klipper: v0.12.0-446-g98068bec
Klipperscreen: v0.4.5-52-g68fe1b0e
Mainsail: v2.13.2

#

Spyglass CPU usage on Pi5 (8Gb).

primal galeBOT
#

Ahoi @cinder vessel!
It looks like you did not provide all the necessary information we need to help you.
Please upload your logfiles and a detailed description of your problem.
For further information see: https://docs.mainsail.xyz/faq/getting-help/discord#provide-information
Note: We only accept .log and .txt files as log files.
This is an automated message

We are glad to help and chat with you on our Community Discord, but if you need help and want the best support possible you should, follow a few simple rules:

sonic tiger
#

I recommend to disable WebRTC

#

You can do that in your spyglass.conf, if you uncomment DISABLE_WEBRTC="true"

#

The problem is that a Pi5 is encoding WebRTC on the CPU. This creates high loads

#

I will make sure to update my guide that I post in future for the Pi5, but overall I don't want to disable WebRTC by default

cinder vessel
#

WebRTC is disabled

sonic tiger
#

The Pi5 will get it's own section in the Readme on the repo soon, that people will see it more easily

sonic tiger
#

Can you scroll to the side on the htop output?

#

Just so that I can see all the used parameters

cinder vessel
#

Sure, just a sec...

sonic tiger
#

Fyi, I testedit real quick on my Pi5 and it's indeed way lower. It's sitting at 85%/400%

#

So like 21% if you go by your measures

#

The amount of processes is normal. Nothing I can do about that

cinder vessel
#

Here you go.

#

Res 1920x1080, 30fps

sonic tiger
#

Even with 30fps I only get up to 180%/400%

cinder vessel
#

Is it normal to have so many processes?

sonic tiger
#

Yep, it's nothing I can control

#

Those come from picamera2, the libcamera library we are using

#

I recommend to reduce the fps to 15. My tests are done with a picam v1 and v2, but I don't get to 288% unless I increase the fps to like 60fps

#

I will try the picam v3 later, to see if it's better or worse

cinder vessel
#

Sure, I'll try that now.

#

That dropped it down to 25-30

sonic tiger
#

Also something else you can do, to improve performance is to change from picamera2.encoders import MJPEGEncoder, H264Encoder to from picamera2.encoders import JpegEncoder as MJPEGEncoder, H264Encoder inside spyglass/camera/csi.py

sonic tiger
#

Maybe that's increasing the load

cinder vessel
#

UV4L-MJPEG

sonic tiger
#

Oh, I'm dumb you meant % xD

#

I thought fps somehow xD

cinder vessel
#

ahhhh..haha

sonic tiger
#

I will add some parameter to apply that automatically soon

cinder vessel
#

UV4L-MJPEG, 1920x1080, 15fps = 25-30% CPU

sonic tiger
#

Yes, got it ^^

#

Still apply that change and it should get you further down

cinder vessel
#

Sure, will apply those changes

#

That change dropped CPU down to 18-22%

sonic tiger
#

That seems more reasonable and closer to my values

#

Overall the only way to get further down is either drop resolution or fps

#

Or don't use a Pi5

cinder vessel
#

I'm fine with this.

sonic tiger
#

Perfect, if you don't have any further questions, please close this post