Repository navigation
Conversation
…tery read A DeathStalker V2 Pro (Wireless) showed its own saved lighting, green on every key, while the tray kept streaming a scene with a battery bar at 15 %. The editor's drawing had the right bar; a lock and unlock put the keyboard right, because a stream then starts with a whole frame. A wireless device only gets the rows that changed, without reading the replies, and the custom-frame effect only when a stream starts. A keyboard that was switched off and on comes up on its own lighting; rows alone change nothing it shows then, and nothing tells the tray. - When a wireless device whose scene shows its battery has just answered the battery read, its stream starts over there and then (start_stream, with replies, as after a lock). The device is awake, and the radio is in use for that read anyway. - A device that doesn't answer the read is left alone and counts no failure. Wireless scenes without a battery layer and wired devices are as they were. - Tests run Studio::tick on the simulated keyboard as a wireless one: the whole frame and the effect again on the battery's tick, nothing for a still scene, nothing for a keyboard that doesn't answer, and a refused row ends the refresh as a failed frame. On the keyboard: switched off for two minutes and on, it came up on its own lighting and had the whole frame back at the next battery read, in 47 ms. A first version sent the rows without waiting for replies; two of the six got lost and stayed dark.
This branch has not been deployed
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.
One more thing with the battery layer on my wireless keyboard: after the keyboard was switched off and on it shows its own lighting while the tray keeps streaming, and the bar is gone until the next lock. Text below and fix is by Fable 5.2 reviewed by GPT-6.2 Astra. Tested on my keyboard.
Problem
A DeathStalker V2 Pro (Wireless) with a scene of a static layer and a battery layer on the top row showed the whole top row green while it was at 15 % (
secbird info, and the tray's own low battery warning three minutes earlier). At 15 % the bar is two keys in red-orange.So the keyboard had gone back to its own saved lighting, green on every key in this profile, while the stream ran. One way to get there: switch the keyboard off for two minutes and on again, with the PC unlocked. It comes up on its own lighting.
Cause
A wireless device gets only the rows that changed, without reading the replies, and the custom-frame effect only from
show_framewhen a stream starts. Wired keyboards get the whole frame every 3 s (RESEND_EVERY, #45); wireless ones are left out so the traffic doesn't keep them awake. Once a wireless keyboard has left the effect, rows alone change nothing it shows, and nothing tells the tray.Fix
One change in
Studio::tick:start_stream, with replies, the same path as after a lock. The device is awake then, and the radio is in use for the read anyway.streamdoes. On the keyboard about two of the six rows got lost each time. That shows nothing while the keyboard's frame is complete, and as dark rows after it was switched off and on.New tests
All run
Studio::tickon the simulated keyboard, opened as a wireless one at 50 %:a_wireless_keyboard_gets_its_whole_frame_again: a static and a battery layer, the keyboard set back to its own effect. Nothing is sent on ticks 1801 and 1802; six rows, then the effect on 1803; nothing on 1804 to 1806.a_still_wireless_scene_is_left_alone: the same without a battery layer, nothing is sent.a_wireless_keyboard_that_does_not_answer_is_left_alone: no battery answer, so no frame is sent, the stream stays as it is and no failure is counted.a_refused_row_ends_the_refresh_as_a_failed_frame: the keyboard refuses a row; the start stops there, sends no effect and counts one failed frame. A start that doesn't read replies would run on.Tested
x86_64-pc-windows-gnu(rustc 1.100.0, mingw-w64). Onlysecbird-tray.exewas replaced.cargo clippy --release --target x86_64-pc-windows-gnu --all-targets -- -D warningsis clean. Unit tests: 132 (core) and 1 (CLI) pass on Linux, 12 (tray) pass on Windows.node --test crates/secbird-tray/tests/*.test.cjspasses.