Skip to content

DotClockFramebuffer(bounce_rows=): cap the bounce buffers' size - #42

Merged
bdbarnett merged 2 commits into
mainfrom
dcfb-bounce-rows
Sep 25, 2026
Merged

bdbarnett merged 2 commits into
mainfrom
dcfb-bounce-rows

Conversation

@bdbarnett

@bdbarnett bdbarnett commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Both RGB bounce buffers come out of internal DMA RAM, which Wi-Fi, TLS (hardware AES) and a USB host need too. At the default 20 rows an 800-wide panel takes 64 KB of it.

On a Waveshare ESP32-S3-Touch-LCD-7 running Wi-Fi, a USB audio host and a Spotify Connect speaker beside the panel, the DMA-capable region sat at 24 bytes free. Then esp-aes: Failed to allocate memory and Wi-Fi dropped. With bounce_rows=10 (32 KB) the same load keeps ~58-65 KB of DMA RAM free (the speaker's debug endpoint, free_dma/min_dma).

  • bounce_rows (keyword, 4..20, default 20) is the upper bound the probe steps down from. Boards that don't pass it are unchanged.
  • The "RAM is tight" notice and the error messages name that bound.
  • docs/ports/esp32.md documents it.

Tested on the LCD-7 over several hours of playback plus UI navigation at 10 rows: the rest of the system stopped starving. The panel image itself has not been checked by eye yet. The companion board-config change is PyDevices/pydevices (branch lcd7-bounce-rows). Its TypeError fallback keeps older displayif builds working.

Both bounce buffers come from internal DMA RAM, which Wi-Fi, TLS (hardware
AES) and a USB host also need. At the default 20 rows an 800-wide panel
takes 64 KB of it; on a Waveshare ESP32-S3-Touch-LCD-7 running Wi-Fi, a USB
audio host and a Spotify Connect speaker beside the panel, the DMA-capable
region sat at 24 bytes free, then esp-aes failed to allocate and Wi-Fi fell
over. With bounce_rows=10 (32 KB) the same load keeps ~65 KB of DMA RAM free.

bounce_rows is the upper bound the probe steps down from (default and
maximum 20, minimum 4, as before); the "RAM is tight" notice and the error
messages now name that bound. Boards that do not pass it are unchanged.
@bdbarnett
bdbarnett merged commit f841529 into main Sep 25, 2026
2 checks passed
@bdbarnett
bdbarnett deleted the dcfb-bounce-rows branch September 25, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant