Skip to content

fix: compress uploads for streaming-decompression-only configs; rename ZIPXL#114

Merged
g4bri3lDev merged 2 commits into
mainfrom
fix/zipxl-only-compression
Jul 5, 2026
Merged

fix: compress uploads for streaming-decompression-only configs; rename ZIPXL#114
g4bri3lDev merged 2 commits into
mainfrom
fix/zipxl-only-compression

Conversation

@g4bri3lDev

Copy link
Copy Markdown
Member

Summary

transmission_modes bit 0x01 has been repurposed over time (RAW → ZIPXL → streaming decompression), and post-2.0 device configs may set only that bit, without TRANSMISSION_MODE_ZIP (0x02). The compression gate only checked supports_zip, so such devices silently uploaded every frame uncompressed — found live on a Seeed EN05 (transmission_modes=0x09): 48 KB raw per frame instead of ~400 bytes.

  • upload_image/_dispatch_upload now compress when either bit is set
  • API renamed to the current semantics, with back-compat aliases kept:
    • DisplayConfig.supports_streaming_decompression (primary) — supports_zipxl/supports_raw remain as deprecated aliases
    • FIRMWARE_ZLIB_WINDOW_BITS (primary; it is the firmware inflate limit, applying to all compressed uploads since fix: always compress image uploads with a 9-bit zlib window (C3) #96) — ZIPXL_ZLIB_WINDOW_BITS remains as alias
    • CLI transmission label ZIPXLSTREAMING
  • Docstrings document both config conventions (pre-2.0 devices: ZIP-only; post-2.0: streaming-only) and the 50 KB cap rationale (whole-blob buffer of the old buffered decompressor; not applied for streaming)

Hardware verification (EN05 OD5A2F4C, 800×480 MONO, panel 0x0027, via BLE DFU downgrades)

config \ firmware 1.70 (buffered uzlib) 1.73 (streaming @15-bit) 2.0 (streaming @9-bit)
ZIP-only (pre-2.0 convention) ✅ compressed accepted ✅ compressed accepted ✅ compressed accepted
streaming-only (post-2.0 convention) ⚠️ START NACKed → uncompressed fallback works ⚠️ START NACKed → uncompressed fallback works ✅ compressed accepted

The NACKs on old firmware come from its ZIP-bit gate at compressed START (removed in fw 1.83, 62f03db), not from the 9-bit zlib window — every firmware generation accepts the 9-bit stream, answering the pre-2.0 compatibility question about #96.

Test plan

🤖 Generated with Claude Code

…e ZIPXL

transmission_modes bit 0x01 (historically RAW, then ZIPXL) means
streaming decompression, and post-2.0 device configs may set only that
bit without TRANSMISSION_MODE_ZIP (0x02). The compression gate only
checked supports_zip, so such devices — e.g. a Seeed EN05 with
transmission_modes=0x09 — silently uploaded every frame uncompressed
(48 KB raw instead of ~400 bytes for a mostly-white MONO frame).

Gate on either bit, and rename the API to match the repurposed
semantics: DisplayConfig.supports_streaming_decompression (primary,
supports_zipxl/supports_raw stay as deprecated aliases),
FIRMWARE_ZLIB_WINDOW_BITS (primary, ZIPXL_ZLIB_WINDOW_BITS stays as
alias), CLI transmission label ZIPXL -> STREAMING.

Hardware-verified on an EN05 (800x480 MONO, panel 0x0027) across the
config x firmware matrix: fw 2.0 accepts compressed uploads for both
bit conventions; fw <= 1.81 additionally requires the ZIP bit at START
and NACKs otherwise, which the existing fallback turns into a working
uncompressed upload.
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…sion too

The 0x76 partial stream compression decision also checked only
supports_zip; a streaming-only device sent its partial stream
uncompressed (measured on hardware: 96,000 bytes wire for a full-frame
partial that compresses to well under 1 KB).
@g4bri3lDev

Copy link
Copy Markdown
Member Author

Added a second gate fix found during hardware testing: the partial stream (0x76) compression decision also checked only supports_zip, so streaming-only devices sent partial streams uncompressed — measured 96,000 bytes on the wire for a full-frame partial that compresses to well under 1 KB. Same one-line fix as the upload gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant