psieg / Lightpack

Lightpack and Prismatik open repository
GNU General Public License v3.0
1.58k stars 190 forks source link

Cpu usage with Ambibox / Lights turn off with Prismatik #282

Open Asryan2a opened 5 years ago

Asryan2a commented 5 years ago

Hi,

I've received this item today : https://www.aliexpress.com/item/32974224895.html?spm=a2g0s.9042311.0.0.79be4c4dR8UQlI

I've installed it and looks ok but I noticed that Ambibox uses 7 to 10% of CPU ressources thus heat my CPU more than usual when the screen capture mode is ON.

Is there any way to fix that?

I tried Prismatik wich seems to work fine but the light mood mode won't stay on and the lights shuts off after 15 sec...

Thanks for the help !

HighOnBuffs commented 4 years ago

This is not the right place asking Ambibox questions as this is the Prismatik fork. The timeout happens as you need to change it in your Arduino sketch from 60 sec to 0.

gavsiu commented 3 years ago

I was looking through the issues to help me solve another problem, but stumbled upon this open issue.

If anyone else is curious about the CPU usage during screen grabbing, I think it has to do with the grab frequency (FPS). I've noticed that if you lower the grab interval until the max grab frequency is about 30 FPS, the lights change more smoothly, but uses more CPU resources.

Since I sometimes game, the increased CPU usage by Prismatik hurts in-game FPS for some of the more demanding ones. I've since set my grab interval to 65 ms or about 15 FPS max grab frequency. CPU usage averages around 7%. The light change lag is slightly noticeable, but tolerable.

You're just gonna have to live with the extra CPU usage if you want dynamic ambient lighting through USB.

I'm running the same thing from a "different brand" on Linux. They use the same stock image as yours.

zomfg commented 3 years ago

if you lower the grab interval until the max grab frequency is about 30 FPS, the lights change more smoothly I'm running the same thing from a "different brand"

this has probably to do with whatever the "different brand" decided to use as baud rate, 115200 typically, which is low for modern setups you can change that by reflashing your thing also keep in mind that capture methods and optimizations are OS/CPU specific, so YMMV