fix: compress uploads for streaming-decompression-only configs; rename ZIPXL#114
Merged
Conversation
…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 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).
Member
Author
|
Added a second gate fix found during hardware testing: the partial stream (0x76) compression decision also checked only |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
transmission_modesbit 0x01 has been repurposed over time (RAW → ZIPXL → streaming decompression), and post-2.0 device configs may set only that bit, withoutTRANSMISSION_MODE_ZIP(0x02). The compression gate only checkedsupports_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_uploadnow compress when either bit is setDisplayConfig.supports_streaming_decompression(primary) —supports_zipxl/supports_rawremain as deprecated aliasesFIRMWARE_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_BITSremains as aliasZIPXL→STREAMINGHardware verification (EN05
OD5A2F4C, 800×480 MONO, panel 0x0027, via BLE DFU downgrades)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
transmission_modes=0x09device uses the compressed protocolpytest -q→ 494 passed;ruff,mypycleanwrite_configand fix: preserve real config data through JSON export/import (M7) #104 JSON round-trip also exercised live during the config swaps🤖 Generated with Claude Code