-
Notifications
You must be signed in to change notification settings - Fork 204
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
libpigpiod consumes too much CPU #380
Comments
I saw this early on and looked it up. According to the author joan2937 this is only on one of the 4 CPUs so actually 2% overall. |
The -m option reduces the idle CPU to zero BUT stops the Timed GPIO port option in the driver from working. I assume the sampling is needed by the watchdog timer. This driver function is primarily for triggering DSLR bulb exposures. So we could default to -m and advise DSLR users to remove the switch in the service. This should only affect those DSLR users not using libgphoto. It would also affect users using the timer function for other purposes like flashing LEDs |
Thanks, but even this small CPU percentage was causing the GUI to be a bit unresponsive in Raspberry PI. I suppose it's not possible to programatically trigger this on/off after starting the server somehow? INDI uses FIFO for this purpose for example. |
No, it cannot be switched programatically. I'll look around for an alternative timing mechanism. I just used the built-in pigpiod hardware timer because it was convenient. But if I can find an alternativethat should work just as well and allow the -m switch to be used. Worst case I might need to restrict the timing function to just one pin. |
Recently @pawel-soja added timers to INDI, but not sure if they're suitable for this kind of work? |
That's right, but I wrote timers based on those already existing in INDI Core. The class provides an easy-to-use interface.
https://github.com/indilib/indi/blob/master/libs/indibase/timer/inditimer.h #include "inditimer.h"
// ... //
INDI::Timer timer;
timer.callOnTimeout([](){
// Hello!
});
timer.setSingleShot(false); // periodic timer - constant frequency of events
timer.start(10); // 10 ms I will offer RPi support (optimization) as soon as I deal with the libASICamera2Boost - Currently, I can help, but I need the exact spot of the problem. |
Thanks @pawel-soja I think I can manage on my own using inditimer |
@knro do I need to do anything to add libpigpiod to the nightlies? indi-asi-power and indi-rpi-gpio have a dependency on it. |
Just noticed that this pigpiod takes about 7% to 10% on raspberry pi CPU while not used. @ken-self Can you please check what's going on? Since this causes the performance of the PI to degrade substantially.
The text was updated successfully, but these errors were encountered: