This is a big issue. As it is currently structured, each event from the encoder (esp. rotations) takes X ms to process. This X ms is longer than the Y ms it takes to create them when rotating the encoder quickly. This causes the encoder events to queue up.
When the events are queued up, none are skipped. If the user spins the encoder quickly, the system is essentially locked up until it processes every event, causing additional user input to be further delayed.
A few questions to answer:
Who does the queuing? The evdev library, or how Linux handles device inputs?
What is the bottleneck? Is it how fast we are dealing with each event in the for loop? Or is it evdev's read loop? Or, worst case, is it the device overlay for the Raspberry PI?
If our code speed is the bottleneck, how do we lower resource consumption with all these infinite loops?
If evdev is the bottleneck, can we batch read? Can we throw away some events to get back to real time?
If the device overlay is the bottleneck, what library can adequately substitute the functionality?
This is a big issue. As it is currently structured, each event from the encoder (esp. rotations) takes X ms to process. This X ms is longer than the Y ms it takes to create them when rotating the encoder quickly. This causes the encoder events to queue up. When the events are queued up, none are skipped. If the user spins the encoder quickly, the system is essentially locked up until it processes every event, causing additional user input to be further delayed.
A few questions to answer: Who does the queuing? The evdev library, or how Linux handles device inputs? What is the bottleneck? Is it how fast we are dealing with each event in the for loop? Or is it evdev's read loop? Or, worst case, is it the device overlay for the Raspberry PI? If our code speed is the bottleneck, how do we lower resource consumption with all these infinite loops? If evdev is the bottleneck, can we batch read? Can we throw away some events to get back to real time? If the device overlay is the bottleneck, what library can adequately substitute the functionality?