Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed usb transmitting being unreliable #47

Draft
wants to merge 1 commit into
base: sn32_master
Choose a base branch
from

Conversation

susch19
Copy link

@susch19 susch19 commented May 14, 2022

  • by always handling the ack and nak flags, even when other flags are present

I know that this version is different from the original implementation of the driver by sonix, but at least for me, it seems to be the most stable one. During stress testing send and receive I got 500 packages for each direction and a total loss of 0.00019% packages from a total of 7,232,000. 14mio if you count both directions. And this loss is either rec or send, as I just checked if I got an answer for each package, not if it arrived at the keyboard and if I got an answer.
Also, with this version via worked as it should (Creating macros, changing keys, reconnecting after restarting keyboard). With all other version via would break the UI update, as soon as I create a new macro.

So in the end, I don't know why it fixes it (maybe because ack and nak need to be always handeled?) and why the original sonix driver did different things, but atleast i'm happy, as it seems to be working now as it should.

* by always handling the ack and nak flags, even when other flags are present
@susch19
Copy link
Author

susch19 commented May 14, 2022

Currently running another stress test for the OpenRGB side, but it goes pretty well and afaik openrgb doesn't even send 500 packages per second, even on 60fps. Even when sending an every info per key, it would only be 4bit per key * 110 (Something like that) will only be 440 bytes. 440 / 60 (4 byte header just in case) = 8 Packages. 8x60 = 420 packages, so even with the via response per package and an unoptimized protocol (which openrgb doesn't have) it still has some headroom.
But i will still let it run for some time and will make it ready to review, as soon as the tests are finished

@susch19 susch19 marked this pull request as ready for review May 16, 2022 19:03
@susch19
Copy link
Author

susch19 commented May 16, 2022

So after 2 full days of use and testing openrgb (continuously) and via (occasionally) this seems to be stable.
I detected no weird behavior or missed key strokes or anything like that, so I would be comfortable to declare it as "stable for now"

@Jpe230
Copy link
Collaborator

Jpe230 commented May 16, 2022

After nuking and restoring my dev. environment, it comes to my attention that neither does OPENRGB and VIA works using your branch. I had to to revert the code deleted in #45 inside the "handleNAK" function for it to work.

Im using Intel CPUs with WSL, MSYS and MacOS to compile and test.

@susch19 susch19 marked this pull request as draft May 16, 2022 20:50
@dexter93
Copy link

Hi guys. I think I found it
ChibiOS#371

tested on ChibiOS/ChibiOS-Contrib, seems to fix transmission issues

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.

3 participants