128x128 on ESP32 with PSRAM?

@Louis, for your board you were thinking about, I’ve been looking at newer ESP32s with a nice amount of flash (usable for FatFS and therefore removing the need for sdcard), and PSRAM:

PSRAM can’t do DMA, but we can store any other framebuffer that doesn’t need DMA.
Does it look like by changing the few mallocs that don’t need dma to psram_malloc (not the real name, I don’t remember it right now), it would leave enough system RAM to allow enough DMA memory to do 128x128 on ESP32?
Without having had any time to look at it (and I don’t have the chip yet), my gut feeling is that it would work.

This probably won’t support my next 192x128 pipedream that I’ll probably still have to build on rPi, but it would be cool to hit 128x128.

What do you think?

I think it’s possible, but there will be some compromises required, and maybe some time consuming firmware optimization, so it may be a (long?) while before I update the library to try to make it work.

I just re-ran some calculations I had previously made checking timing, and it looks like I can refresh 128x128 at ~150fps, but the max brightness will be limited to something like 50% (there will be a lot of time spent shifting out the long chains of pixels, where the panel has to be turned off)

So, maybe someday? I wouldn’t make your project depend on it, maybe move to RPi and come back if there’s 128x128 support in the future.

Yeah, fair enough. My next project will definitely not depend on it as it needs 192x128 anyway.
SmartMatrix does currently support 128x128 on teensy with ABCDE panels, which I guess is actually a plus since you aren’t pushing the pixels as far into a row compared to ABCD
Current 128x64 panels are already ABCDE and are supported by SmartMatrix on both ESP32 and teensy 3.6, 128x128 is just a matter of having enough RAM on ESP32 to hold it I believe (teensy 3.6 has enough RAM but it’s too slow on refresh and gives visible flashing)

Anyway, my main thought was how ESP32 PSRAM would help SmartMatrix. It sounds like actually the answer is “not too much” though.

Anyway, my main thought was how ESP32 PSRAM would help SmartMatrix. It sounds like actually the answer is “not too much” though.

I think it does help. I’m not sure there’s enough RAM on the standard ESP32 to refresh a 128x128 panel and hold the background buffers for 128x128.

you are absolutely correct, there is not enough RAM (128x64 barely fits), which is why I was thinking about PSRAM to hold the buffers that didn’t have to be DMA.
What portion of the RAM allocated by SmartMatrix on ESP32, needs to be DMA (i.e. not PSRAM)?

I’m not sure, hopefully you can find out from the code and from the printfs (that you helped clean up). I only request DMA RAM if it’s needed.