'STAT' input event for device 'Mouse:/Mouse' is outdated
Very seldom I get the issue that the mouse events are not triggered anymore. When I enable event diagnostics in the Input Debugger the console log is spammed with the following errors:
'STAT' input event for device 'Mouse:/Mouse' is outdated (event time: -4294739.47191704, device time: -1140.46916687573) UnityEngine.Experimental.Input.LowLevel.<>c__DisplayClass6_0:<set_onUpdate>b__0(NativeInputUpdateType, NativeInputEventBuffer*) UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr) (at C:/buildslave/unity/build/Modules/Input/Private/Input.cs:112)
The issue happened on several different PCs (roughly one case per week). The device time stays constant on that value while event time increases.
Button interactions continue to work normally (mouse over, clicking on them), so it is really only related to events set up with ActionMaps.
Disconnecting and reconnecting the mouse didn't help. Only option to fix the issue is to restart the PC.
We encountered the issue again. This time our QA had the issue in a build and a restart did not fix it initially. It was fixed after we had opened it in unity and did a restart afterwards.
I've checked the InputManager.cs code and there is a break in the OnUpdate when this issue happens (around line 2537). What would be the expected outcome if the break would be removed? Would this difference in event times lead to other issues? I just did a very quick testrun and didn't spot any differences, but I guess the code is there for a reason.
Indeed, seeing the same. Not sure yet whether it's a native change or a managed change that is causing this. Looking into it.
@berMip is there any chance you provide a minimal repro project? Thanks!
I'm afraid not. It happens so randomly that I have absolutely no idea how to reproduce it. One thing we have observed is that the restart only seems to fix the issue if unity got opened. When our QA had the issue with a build we provided, the issue remained even after restarts. Afterwards we opened unity to verify if it actually is that issue. After a restart afterwards the issue was gone on that pc as well.
Yesterday we removed the early out int the InputManager for that case. That "fixes" the issue. We are now monitoring the situation what side effects that might have.
This happened with me twice. And I have no idea why, besides launching games which potentially can interfere with input memory, but other days worked perfectly fine, not causing any issues.
Also, my mouse produce errors if buttons pressed:
Cannot find device for input event: id=157278 type=STAT device=6 size=33 time=381,458800945363
Yet InputActions reliant on this presses works fine. Seems it's just my concrete mouse, somehow managed to be a multiple devices at once. One of which is unknown for Input Systems. Same happens with headphones' USB thingy.
So this probably not even related with outdated events issue, but if there any tiny chance it may help...
Any news on this issue? Just happened with me in the 0.2.10 preview
The issue with events seemingly going back in time ('STAT' input event for device 'Mouse:/Mouse' is outdated) I'm still looking into.
The error where it cannot find the device (Cannot find device for input event) is bogus. Currently the code doesn't check whether the event is meant for a device that the backend reported (e.g. some random HID like the headphone USB thing @elhimp mentions) but we never turned into an actual device. Our backends don't consistently implement support for disabling devices yet and thus may end up sending input from devices that the input system chose to ignore. But the diagnostics code blindly gets triggered nonetheless. I'll fix that. Other than annoying spam in the console and some useless noise and overhead in the event stream, should not have any negative impact.