I found the cause of the lag.
I am using the node-hid
code branch and getting an ioctl
protocol error (which is just a warning)
ioctl (SFEATURE): Protocol error
in BlinkStick.prototype.setFeatureReport
Its retryTransfer
function fires several times and slows execution.
The data always gets successfully sent, but sometimes iotcl
throws the above warning causing the intermittent lag.
I simply removed the retryTransfer
function. These warnings are still occurring, but no lag.
The lag was just much more pronounced on slower low power USB connections.
The intermittent stall (frame skip) is still occurring (averages about 10 times per minute) on the slower low power USB connections (black and blue) with this actual error being thrown:
ioctl (SFEATURE): Cannot send after transport endpoint shutdown
The high power red USB3.0 connection performs flawlessly, so I will just observe this as a minimum requirement.
For my purposes, this is an acceptable solution, and it avoids plunging into the depths of ioctl
.
None of this is a problem on Windows.