berarma / ffbtools

Set of tools for FFB testing and debugging on GNU/Linux
GNU General Public License v3.0
56 stars 10 forks source link

Add workaround for full cmd queue issues #19

Closed berarma closed 3 years ago

berarma commented 3 years ago

I've added a throttling option to try to fix an issue that can happen with the Logitech in-kernel drivers when effect commands are sent faster than the wheel can process.

I've decided to implement this after PR #17 by @mcoffin. This approach is more generic and it's based on the way I solved the issue in https://github.com/berarma/new-lg4ff.

The time period for command flushing is set to 3ms.

I would need someone to test that it actually solves the issue.

mcoffin commented 3 years ago

So, I can confirm that this does fix the ACC issue as well. I went ahead and opened #20 against this branch, which...

  1. Cleans up the fragile buffer size as mentioned above
  2. Allows the user to configure the throttling interval at runtime instead of compile-time
  3. Ensures that ffb events still go through the debug logging code path even when FFBTOOLS_THROTTLING is enabled.
  4. Handles a previously-uncaught error case (timer_settime failing).
  5. Disables throttling for effect IDs that are out of range, to avoid a potential buffer overflow.
berarma commented 3 years ago

Thanks for testing.