I’ve been struggling with this one for a while. I don’t think it’s a problem with the library because the display refresh seems solid: rPi4 hangs https://github.com/hzeller/rpi-rgb-led-matrix/issues/1177 - YouTube
However, my code randomly hangs and resumes and I’m pretty sure it’s not an issue with the code, but with the CPU throttling, although I couldn’t find anything obvious.
The code is single threaded, it generates a frame buffer, and then calls show() to copy it to this driver’s canvas:
void FastLED_RPIRGBPanel_GFX::show() {
Framebuffer_GFX::showfps();
for (uint16_t y = 0; y < _fbh; y++) {
for (uint16_t x = 0; x < _fbw; x++) {
CRGB pixel = _fb[y*matrixWidth + x];
uint8_t r = pixel.r;
uint8_t g = pixel.g;
uint8_t b = pixel.b;
_canvas->SetPixel(x, y, r, g, b);
}
}
}
If you look at this video: rPi4 hangs https://github.com/hzeller/rpi-rgb-led-matrix/issues/1177 - YouTube , there are interesting bits:
the refresh seems constant enough, but the animation hangs and things hang so badly around the 12s mark that you can see the function above copying the canvas in what looks like almost 0.5s. There is no way a raw copy of data in this loop could ever take that long in such a CPU. I’m trying to understand what gets triggered to create such an issue.
I’ve put a heat sink on the CPU and GPU, maybe it’s not good enough. I’m trying to find out if the cores are going into some massive throttling for reason unknown (0.5s to do the loop above is super super slow).
The same code works flawlessly on rPI3 with a smaller display (192x160).
I’ve spent some time on this, but have come up empty so far, and was wondering if anyone has any ideas of what I should consider. I am running raspbian which I know is not ideal but the hangs seem to happen to certain patterns and not others, so they seem to depend on what the code is computing and not some random time interval from an external cronjob or daemon.
same display, same everything is running on the right in this demo: Table Mark Estes 192x160& 384x256 using FastLED_RPIRGBPanel_GFX & ArduinoOnPc-FastLED-GFX-LEDMatrix - YouTube , so the hangs are hard to pin, they happen mostly in some demos and not others, but not consistently.