georgefst / monpad

A fully-customisable web-based gamepad, designed to be used from smartphones.
BSD 3-Clause "New" or "Revised" License
39 stars 5 forks source link

evdev race condition #2

Open georgefst opened 4 years ago

georgefst commented 4 years ago

Sometimes when a device is created on the server, the device never creates axis events, only buttons/keys. LowLevel.writeEvent returns 0 but nothing happens. As far as I've seen, it only happens when the gamepad is interacted with within a second or so of loading. Refreshing and waiting briefly usually fixes it.

Could be a libevdev bug. Hard to diagnose further without more testing in different environments.

georgefst commented 4 years ago

As far as I've seen, it only happens when the gamepad is interacted with within a second or so of loading.

I'm increasingly sure this is what makes the difference. So it seems that there is some kind of race condition at startup. We need to wait for the device to be fully initialised, whatever that means.

It's possible this only requires changes in the evdev library, and not in monpad itself.