Page 1 of 1

pigpiod processor usage

Posted: Mon Sep 16, 2019 4:58 pm
by erg
Hello there,

I've been looking at the top output and noticed that pigpio consumes significant amount of processor power. It hovers from around 4.6% to 7% but spikes at around 15%.

I'm running it on raspberry pi 3B+ with 64bit kernel. Gentoo.

Is that normal? Could someone take a peak so that I could compare? I have no 32 bit system to check it or Raspbian, I'm curious.

Cheers

Re: pigpiod processor usage

Posted: Mon Sep 16, 2019 5:43 pm
by joan
That sounds right.

I haven't done measurements for years (since the early Pis).

http://abyz.me.uk/rpi/pigpio/cif.html#gpioCfgClock

I think the time is mainly spent in checking for GPIO level changes.

Re: pigpiod processor usage

Posted: Tue Sep 17, 2019 5:58 pm
by erg
Thanks.

I was preoccupied there may be something wrong with my setup.

Re: pigpiod processor usage

Posted: Tue Sep 17, 2019 6:26 pm
by joan
You can disable alerts processing. Use the -m option. http://abyz.me.uk/rpi/pigpio/pigpiod.html

I would suggest you do NOT do that except in extremis.

Re: pigpiod processor usage

Posted: Thu Jul 09, 2020 11:32 am
by ryce358
Am I right in thinking that if I am using pigpio solely for an output (hardware PWM to be specific) then the -m flag is a reasonable thing to use in order to keep cpu usage down? Or is there the potential for exceptions or something else?

Re: pigpiod processor usage

Posted: Thu Jul 09, 2020 11:35 am
by joan
If all you are doing is hardware PWM pigpio is a bit over the top. If you are not changing settings often you could start the daemon, set hardware PWM, then stop the daemon. The hardware PWM will continue without the daemon running.

Or just use wiringPi's gpio command.

Re: pigpiod processor usage

Posted: Thu Jul 09, 2020 12:30 pm
by ryce358
I'm having issues with wiringpi. -m flag seems to be stable at the moment so I will keep that and look to work out my wiringpi issues later. Thanks joan.