Closed eurosting closed 3 years ago
additional info. The rpi-rgb-led-matrix sample/demo
runs well as prozess on core 3 and uses 75% of the core.
I used this line:
pi@pi-rgb:~/rpi-rgb-led-matrix/examples-api-use $ sudo ./demo -D0 --led-gpio-mapping=adafruit-hat-pwm --led-slowdown-gpio 2 --led-cols=192 --led-rows=64 --led-brightness=30 --led-daemon
I am neither sure I understand what this parameter is supposed to do or what you expect it to do...
First of all, you should not need to do anything besides setting isolcpus=3
to get the refresh process onto its own core. Let me explain what happens when you start cpu-stats-gl:
The refresh process is what has to run with exact timing to avoid flickering and it is designed to always only run the last core on the system (on a four core Pi, it is core 3 as we start counting with core 0). This is hard coded and cannot be changed by a parameter: https://github.com/hzeller/rpi-rgb-led-matrix/blob/9f5ffd8a93614dbf3b6262103aefea2e3ba268bd/lib/led-matrix.cc#L473
If you set isolcpus=3
you only tell your OS (or its thread scheduler) to not send any process to this CPU, so the refresh process can be on its own.
Now for the --led-daemon
parameter:
A daemon is not much different from a "normal" process. As far as I understand it, this just means that the process detaches from the user session (i.e. it keep running when you log out) and does not expect any user interaction. However, as this is a parameter for the rgb-panel library I do not see how it could affect the render process. So, I would only expect that this means that the refresh process detaches from the render process (and thus from the user session), which would not do anything in this case. I have to admit that I do not know what the use case is, but it is not required for the LED cube as you would simply launch the cpu-stats-gl program in a launch script and would not care whether it detaches from anything.
Am I missing the point of your question or the use case for this parameter? If not, I would close this issue as I do not think that this parameter applies here...
Hello Sebastian, thank you very much for the explanation.
I'm using MobaXterm software to open SSH connection to Pi3. At the moment I start led animation manually like a normal prozess by using this command pi@pi-rgb:~/led $ sudo ./cpu
. The animation works, but in this case I can't do anything more (the terminal is in use by the animation).
Could you please tell me how to start LED cube prozess in the "background"? Sorry, I'm a windows user.
On this page I found the parameter --led-daemon
, which works fine for matric examples, but not for the LED cube.
https://github.com/hzeller/rpi-rgb-led-matrix
P.S. cpu
is the name of your LED cube animation
it seems I found how to start the led cube as prozess prozess.
I just add & after the command.
pi@pi-rgb:~/led $ sudo ./cpu &
Well, issue solved 👍
Jepp, exactly :) An &
at the end usually does the trick.
If you add the command to an init script (I just launch it in /etc/rc.local
, but Linux has maaaany alternatives here), don't forget to add the &
there as well as most scripts do not like it if they never return.
I'm still on testing of LED cube. In case I run the led script like this, the animation works with 170Hz:
If I start the led script as prozess, then there no animation:
pi@pi-rgb:~/led $ sudo ./cpu --led-daemon
The core 3 is isolated by using
isolcpus=3
option in/boot/cmdline.txt
. According to htop the led prozess runs on core 3 with 100%.My goal to reduce the FPS from 170Hz to 60-120Hz and reduce the load of cpu. And I would also like to run the animation on isolated core, to be able to use PI3 also for other purposes.
Please any advice?