Performance with 2048 LEDs on V2/V3

The dynamic map has been very useful!! which enabled a new problem… too many LEDs.

With a V3 Standard 2048 WS2812B LEDs (8 panels of x(16x16) the FPS is between 11 and 12 using the Animation and time sample as a benchmark - Set to NO LEDs its showing between 28 and 30 FPS. I’ve not tried this with a PB2 yet but might do that or have found a project for the expander…

The mapping code did not really seem to cost anything significant. Tried removing the rotate since it was not being used BUT seemed the same not having a map.

Either way Given the “no pixels” setting was only showing about 28 or 30 FPS , suggests this is a limit with 2048 pixels, and the options are to remove panels or add the Expander board.

unless someone has other suggestions??? guessing i found a project for the expander. :slight_smile:

Post your code, perhaps it’s possible to optimize it. That seems really slow with No Pixels.

Also, what’s the speed with less pixels. Does it scale? With half the pixels? A quarter?

Ya it scales, no LED setting @ 2048 pixels is about 30FPS, with 512 set its much higher 60 70 something like that and as more panels are added it slows down. Seems pretty linear from some observations.

The patterm CODE is the EXAMPLE CODE the time and animation sample that comes with every unit.

The map is this but did not seem to be dependent on the map.

//sainsmart reverse xy loop.

function (pixelCount) {
  //enable zigzag if every other LED row travels in reverse
  //if they are all straight across, disable it
  zigzag = true
  
  //roate a point (x, y), along a center (cx, cy), by an angle in degrees
  function rotate(cx, cy, x, y, angle) {
    var radians = (Math.PI / 180) * angle,
        cos = Math.cos(radians),
        sin = Math.sin(radians),
        nx = (cos * (x - cx)) + (sin * (y - cy)) + cx,
        ny = (cos * (y - cy)) - (sin * (x - cx)) + cy;
    return [nx, ny];
  }

  //create a set of coordinates for a matrix panel
  // sized (w, h), rotated by an angle, and offset by (sx, sy)
  function panel(w, h, sx, sy, angle) {
    var x, y2, y, p, map = []
      for (x = 0; x < w; x++) {
	      for (y = 0; y < h; y++) {

        //for zigzag, flip direction every other row
        if (zigzag && x % 2 == 1)
          y2 = h - 1 - y
        else
          y2 = y
        p = rotate((w-1)/2, (h-1)/2, x, y2, angle);
        p[0] += sx
        p[1] += sy
        map.push(p)
      }
    }
    return map;
  }

  //assemble one or more panels
  var map = [];

	
  map = map.concat(panel(16, 16,   0,   0,  0))
  map = map.concat(panel(16, 16,   0,  16,  0))
  map = map.concat(panel(16, 16,  16,   0,  0))
  map = map.concat(panel(16, 16,  16,  16,  0))
  map = map.concat(panel(16, 16,  32,   0,  0))
  map = map.concat(panel(16, 16,  32,  16,  0))
  map = map.concat(panel(16, 16,  48,   0,  0))
  map = map.concat(panel(16, 16,  48,  16,  0))

  return map
}

Ws2812 has a fixed data rate, so you won’t be able to push tons of pixels with high frame rate on a single data line. 800Kbps, at 24 bits per pixel. 33k pixels a sec max. That’s like 16 FPS theoretical max if rendering was instantaneous. Next is the implementation of the LED driver. Ws2812 is very picky about timing, so the engine waits for sending to complete before rendering again (avoids glitches).

Other led types like apa102 can be asynchronous, as is the output expander so rendering can happen concurrently and FPS are higher even taking data rates into account.

The expander handles up to 66k pixels a second, and sends data out in parallel. It could easily help improve fps just by splitting you pixels on 3-4 channels.

You can experiment with FPS by changing the led type to output expander, add a board, and configure some channels. From PB’s perspective it doesn’t know you don’t have an expander attached and your FPS should improve.

1 Like

Thanks - i do find the APA are much nicer, but these are cheap and the color leaves something to be desired, probably why they are so cheap. $20.00

I do think something either the map or just the pixel count is causing problems.
I locked up the PB3 letting it run overnight. Its not dead but app does not load.

I just tried it with a PB2.25. It worked for a short period then hung on either Shimmering Crossfade or going to Wandering fireball. I was seeing about 3.91 FPS with almost no variation.
It actually looked better than what i recall seeing last night with the PB3 running at 5 or 6FPS.
Albit slowish in both but the PB2 seemed smoother.

But now the PB2 wont boot. it seems like its starting up and rebooting. Not connected to anything other than the USB port. Never saw more than about 1.8 amps when running.
I cant get it into setup mode.
Power up, Blue Light, Amber light, Bright Amber light, reboot, Blue light, Amber Light, Bright Amber-light , reboot. etc.

I know crossing threads now from FPS to stuck boards. i have two that are stuck in a similar but different way after trying it. maybe it is the pixel count, maybe it is the map, maybe its power issue. dono but going to have to order more boards to finish my experiment at this rate…

If you run with No LEDs set, that is the max frame rate possible. You can get closer to that using the expander (though there is still some overhead and bandwidth limits). The map, pixel count, and pattern would impact the FPS in No LEDs mode too, its doing all the same rendering work.

For the V2, It is possible the total LED count, map, and pattern combination has exceeded what the V2 can do. Unfortunately if a V2 gets in to a bad state and crashes during startup, there is little that can be done short of reflashing it (or at least erasing the filesystem). I can help you recover it, you’ll need ideally one of the PB Arduino programmers or an ESP programmer, or at minimum a 3.3v USB serial adapter. Alternatively I can repair it for you if you mail it to me.

V3 added a fail-safe for crashing during startup, and will progressively disable things on startup if it detects a series of resets. That same protection system can kick in during brown-outs, when voltage gets too low, causing what appears to be amnesia. Maybe it’s what started your problems on your V3?

For your V3, perhaps you have a bad flash block somewhere, or the filesystem has some kind of corruption. I can get you a replacement, and could repair your V2 as well.

1 Like

I did see briefly on a v2 it was doing about 29 FPS using the 8ch expander and 2048 leds on 2 channels, which is encouraging. I 'm anticipating using the remaining 6 channels would scale that up to the same as 1 16x16 panel connected directly.

A post was merged into an existing topic: V3 stuck at loading again