Repository navigation
Conversation
…ollision, and 30Hz serial overrun
spf13
force-pushed
the
fix/minihub-lighting-flicker
branch
from
October 22, 2026 18:43
81dc1fa to
bfdca3d
Compare
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
Fixes LED flickering, wrong/shifted RGB colors (pink/tie-dyed fans), and missed device topology updates on the iBUYPOWER MiniHub (
VID_3402&PID_0900, firmware1.0.1.1).Root Causes (Proven via Firmware 1.0.1.1
minihub.binDisassembly & Live Hardware Verification)CDC_Receive_FSat0x0801AC50..0x0801B1E8):Buf[0..*Len-1]into its 64-byterx_buf(0x20000258) without clearingrx_buf[*Len..63], and its continuation loop copies all 64 bytes ofrx_buf[0..63]intoportN_bufregardless of*Lenor150/300-byte buffer bounds.157 = 64 + 64 + 29bytes), Packet 3 (*Len = 29) leftrx_buf[29..63]populated with Packet 2's LED bytes and overflowed33stale bytes (shifted by(95 - 7) % 3 = 1GRB component -> Pink#C80032for Blue#0032C8) intoport(N+1)_buf[0..32].307 = 64*4 + 51bytes), Packet 5 (*Len = 51) overflowedrx_buf[51..63](13bytes) pastport4_buf[299](0x20000643) directly intopwm_buf[0..6](0x20000644..0x20000650), corrupting the 60-halfword WS28120Vreset preamble (whichbuild_pwmat0x0800CC48never clears after power-on).MiniHubHub.WritePacketizednow sends lighting stream frames in explicit 64-byte zero-padded chunks with high-resolutionStopwatch.GetTimestamp()pacing (5 msinter-chunk,25 mspost-latch after Channel 4), andScrubLightingSramIfSerialzeroesport3_buf,port4_buf, andpwm_buf[0..59]when enteringRgbModeSoftware.0xFFHeader Collision:rx_buf[0] == 0xFF && rx_buf[1] == 0xEE && rx_buf[2] == 0x03at packet boundaries; clamping LED channel bytes to0xFE(MaxLedChannelByte) inMiniHubProtocol.BuildLightingStreamprevents LED payload bytes at 64-byte packet boundaries from matching0xFFcommand headers.led_update_flag = 1(0x20000090) on Channel 4 (FF EE 03 04) and re-latches all 4 ports together inmain().MiniHubLightingFrameWriternow stages and writes all 4 channels as an atomic cycle underMiniHubHub.IoLock, deduplicates unchanged static frames (with 1 confirmation cycle), and caps continuous animation streaming at100 ms(10 Hz).MiniHubHeartbeatWorkernow notifiesMiniHubLightingDeviceProvider.OnHubStateUpdated()on connect/disconnect (matchingNp50HeartbeatWorker), andSetZoneLedCountinvokesDevicesChangedsoLightingEngineimmediately updates itsDeviceFrameset.Verification
dotnet test(77/77 MiniHub & HubWorker tests passing).iBUYPOWER MiniHub(COM3, FW1.0.1.1) across Front 3, Rear, Top, and CPU fans.