Skip to content

Stick input unreliable and uses excessive CPU #21

@tmackay

Description

@tmackay

I've been giving this a good test run in WoW and I've found the stick input to be quite flaky (bound to keys).

Looking into it, I've made some efficiency improvements. Firstly, I removed the expensive coordinate transform which was being performed every sample - instead pre-transforming the zone instead. However I have not implemented the centre or bounds calibration yet - it only applies to stickzones and TBH, I don't see the value when the bounds could simply be tweaked beforehand and don't require high resolution anyway.

This actually increased CPU usage (from around 3% to 7%) as now individual samples are processed faster and we simply read more of them - so I also added a 10ms delay in the main loop. This should not introduce latency, but limits the maximum sample frequency when the stick is rapidly moving to an unnoticeable 100Hz. This drastically reduced CPU utilization (to <1%) and seems much more responsive/reliable now.

It also seems to have eliminated (or reduced the frequency of) a USB async cancel timeout warning I was receiving occasionally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions