Let's share and compare Windows' ETW MousePacketLatency results

Everything about latency. Tips, testing methods, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
User avatar
F1zus
Posts: 132
Joined: 07 Nov 2022, 17:59

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by F1zus » 15 Nov 2022, 14:09

TooManyPixels wrote:
13 Nov 2022, 18:59
F1zus wrote:
08 Nov 2022, 19:01
Thanks for the program, it really shows real mouse latency. I took small measurements in the evening (when the mouse feels heavy, about 50% input lag) and measured at night (when the mouse glides like on ice, 10% input lag).
Does your computer have an Intel XHCI (USB 3) Controller?
No. My computer is running an amd 5600X processor and an asus b550 tuf gaming plus motherboard.
The processor is overclocked to a frequency of 4.6 GHz at a voltage of 1.26V. It is absolutely stable and cold in all stress tests.
RAM overclocked to 3800cl14. RAM timings are set according to formulas.
AMD Vega56 video card. It does not affect mouse movement in any way.
In the daytime, I observe a lethargic slow mouse.
At night, the mouse becomes very sharp (input lag disappears).

User avatar
F1zus
Posts: 132
Joined: 07 Nov 2022, 17:59

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by F1zus » 15 Nov 2022, 14:14

InputLagger wrote:
14 Nov 2022, 06:16
F1zus wrote:
08 Nov 2022, 19:01
Thanks for the program, it really shows real mouse latency. I took small measurements in the evening (when the mouse feels heavy, about 50% input lag) and measured at night (when the mouse glides like on ice, 10% input lag).
That's what I did:
The first one stopped in the evening at 20.31, the mouse felt heavy, I estimate the input lag at 50% of the possible.
The program shows a mouse delay of 160ms.
средний инпут-20-30 время.png

The second froze in the dead of night at 02.18. Usually at this time, the input lag almost disappears. The mouse is very sharp, I estimate the input lag at 15%
низкий инпут-02-18время.png

The third froze in the dead of night at 02.32. The mouse feels very sharp, as if sliding on ice. I estimate the input lag at 10%.
очень низкий инпут-02-28 время.png

These are all input lag measurements for today. I plan to take more measurements in the future. The program really displays the real delay of the mouse.
You just look at the difference between evening and night. In the evening my mouse is heavy and it is difficult for me to play, the delay is 160ms, and at night the mouse slides on ice, the delay is 1.5ms.
It's all due to bad electricity. I don't do anything with the computer, but it's impossible to play during the day and in the evening.
Try to ask for hrlp from Microsoft developer / tech / overclockers forums. Maybe users can take more info from these latency logs
What for? The problem with the mouse in my case is related to electricity.
During the day, the mouse feels sluggish (slow, heavy). At night, the mouse becomes sharp, fast.
This is due to dirty electricity.
During the day, there is a lot of electrical noise (harmonic distortion) in the outlet.
At night, many people turn off their electrical appliances. Electricity is cleared.
Watch this video for a dirty form of electricity.
https://www.youtube.com/watch?v=cSkjEGNNtuQ

andrelip
Posts: 160
Joined: 21 Mar 2014, 17:50

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by andrelip » 16 Nov 2022, 10:44

F1zus wrote:
15 Nov 2022, 14:14
This is due to dirty electricity.
Any data to support this statement?

Anonymous768119

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by Anonymous768119 » 16 Nov 2022, 11:07

andrelip wrote:
16 Nov 2022, 10:44
F1zus wrote:
15 Nov 2022, 14:14
This is due to dirty electricity.
Any data to support this statement?
More than 90% can't prove that have any issues and you want data?

TN_fun
Posts: 138
Joined: 26 Jun 2019, 11:09

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by TN_fun » 16 Nov 2022, 14:52

TooManyPixels wrote:
02 Nov 2022, 18:51
Apparently Windows' `Microsoft.Windows.Win32kBase.Input` has an ETW trace provider that somehow knows about Windows' end-to-end mouse-pointer latency as measured by Windows' Raw Input Manager ("RIM"), and records them under events like `MouseLatency`, `MousePacketLatency`, `MouseLatencyRandomPick`. and`MouseLatencySummary`.

I note there are also other ETW providers that can help with other events too, such as the event provider for the DWM, which can tell you exactly when it invoked the GPU's driver's `DxgkDdiSetPointerPosition` function, as well as even the (modern-equivalent-of) vblank point - neat (so there's no need to shell-out for a fancy 1000fps video camera now...) .

I know some users here do run and post ETW traces to investigate these input flag issues, but I don't think anyone's yet used the `Microsoft.Windows.Win32kBase.Input` provider yet, so given the amount of placebo cures and vague, poorly-defined symptoms people claim to be experiencing, methinks if people recorded and posted data like this we'd be in a much better position overall.

----------

Instructions:
  1. Be running Windows 10 1903 or later.
  2. Download the 3 files in this repo's subdirectory https://github.com/microsoft/busiotools ... sb/tracing (commit permalink: https://github.com/microsoft/busiotools ... sb/tracing )
  3. Open an elevated cmd.exe and run either (or both) `BusesTrace.cmd` and/or `usbtrace.cmd` - and in the menus choose USB+HID logging. Note that this will not log/trace DWM events.
  4. If you're able to, start another trace separately for DWM events, you should be able to do this from `wprui.exe` with the right profile selected.
  5. Move your mouse such that you can reproduce whatever behaviour-it-is-that-you-don't-like
  6. Stop the traces
  7. Start `wpa.exe` and load your now-saved ETL traces (and don't forget to load Symbols!) and look for events under `Microsoft.Windows.Win32kBase.Input`.
  8. Post a reply to this thread with a screeenshot from WPA and/or relevant data in some copypastable format (i.e. plaintext tabular data (TSV/CSV?) in a preformatted block, I guess?). Important: Do not upload the raw *.etl files because they will very likely contain PII (personally-identifiable-information) about you in them
----------

I'll start with my own:

This is what my trace results look like when my mouse is having a "bad" day (but I've had worse):

198855703-d50e707d-71a7-465f-910e-20607d1ed310.png

198855697-195cd177-b495-478c-980c-aea33c1fdf28.png

I have other traces taken on days when my mouse is feeling better (but still has issues); specifically, on good/"better days" the `CursorRenderLatency` values are significantly better than in that screenshot above.

I still don't have a clue as to the actua underlying cause, and I've been having this problem since late 2019 when this problem started without any obvious cause on a completely different machine - though all my machines have certain common hardware (e.g. Intel Core i7 chips made since 2016, all have ASUS motherboards (but different models) with stock Intel NICs on-board - which are also commonly reported by other people experiencing the same issue.

I'm also wanting to find out if it might be an issue or misconfiguration with USB or HID buffer sizes.

I also shelled-out for a very expensive USB 2.0 protocol analyzer which allowed me to figure out that part of the problem is the host PC waits unnecessarily before issuing USB IN poll requests to the mouse whenever the mouse slows down too much, and that unnecessary wait adds latency - but also that the length of the delay seems to be proportional to the mouse's speed right before it slowed down... or I could be misunderstanding things. Fun.
I do not understand. Need video instructions.

User avatar
F1zus
Posts: 132
Joined: 07 Nov 2022, 17:59

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by F1zus » 16 Nov 2022, 19:12

andrelip wrote:
16 Nov 2022, 10:44
F1zus wrote:
15 Nov 2022, 14:14
This is due to dirty electricity.
Any data to support this statement?
Of course have. One guy measured the noise level in the electrical network and found out that he had 600mV noise at home. At the same time, input lag was observed. Then he took his laptop and went to another house. In another house, the noise level was 60mV. There was no more input lag.
Abf5612c3a5314ef489e6949f6beed5d8i.jpg
Abf5612c3a5314ef489e6949f6beed5d8i.jpg (156.49 KiB) Viewed 1936 times

User avatar
F1zus
Posts: 132
Joined: 07 Nov 2022, 17:59

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by F1zus » 16 Nov 2022, 19:21

andrelip wrote:
16 Nov 2022, 10:44
F1zus wrote:
15 Nov 2022, 14:14
This is due to dirty electricity.
Any data to support this statement?
So far, we do not know which parameter of the electric current affects the input lag.
But there are suggestions:
1) harmonic distortion (modified sine wave)
2) DC component in AC circuits
3) low-frequency and high-frequency noise.
I don't have an oscilloscope, so I can't tell you for sure.
But we (me and other guys) are already testing different ways to deal with dirty electricity.

Why is the problem electrical?
Because depending on the load on the electrical network, the behavior of the mouse changes.
During the day, the mouse is always slow.
At night, when the electrical substation is not loaded, the mouse is sharp, gliding as if on ice.
We also found out that when powerful electrical appliances are connected to the mouse (hair dryer, oven, vacuum cleaner), the behavior of the mouse also changes, the mouse becomes very fast.
Why is this happening? Because electrical appliances absorb electrical noise and prevent it from entering the computer's power supply.

User avatar
F1zus
Posts: 132
Joined: 07 Nov 2022, 17:59

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by F1zus » 16 Nov 2022, 19:27

andrelip wrote:
16 Nov 2022, 10:44
F1zus wrote:
15 Nov 2022, 14:14
This is due to dirty electricity.
Any data to support this statement?
Why don't online UPS fix the input lag problem?
Because at the output they give out not a pure sine wave, but with steps (teeth).
0dbc973c3387bb45fe95fe9032ccface1e3a481d.jpeg
0dbc973c3387bb45fe95fe9032ccface1e3a481d.jpeg (418.1 KiB) Viewed 1931 times
When viewed normally, the sine wave appears to be perfect, but when magnified, we see steps.
a4ed981caaeddcd55fa5f9b35071c4890ba3500e.jpeg
a4ed981caaeddcd55fa5f9b35071c4890ba3500e.jpeg (425.32 KiB) Viewed 1931 times
Computer switching power supplies are very fond of modified sinosoids.
One solution to the problem is to use a toroidal balanced transformer. It smoothes the steps in the sine wave and eliminates electrical noise.

lavar
Posts: 23
Joined: 05 Nov 2022, 05:34

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by lavar » 20 Nov 2022, 22:52

F1zus wrote:
16 Nov 2022, 19:27
andrelip wrote:
16 Nov 2022, 10:44
F1zus wrote:
15 Nov 2022, 14:14
This is due to dirty electricity.
Any data to support this statement?
Why don't online UPS fix the input lag problem?
Because at the output they give out not a pure sine wave, but with steps (teeth).
0dbc973c3387bb45fe95fe9032ccface1e3a481d.jpeg
When viewed normally, the sine wave appears to be perfect, but when magnified, we see steps.
a4ed981caaeddcd55fa5f9b35071c4890ba3500e.jpeg
Computer switching power supplies are very fond of modified sinosoids.
One solution to the problem is to use a toroidal balanced transformer. It smoothes the steps in the sine wave and eliminates electrical noise.

It it was harmonic distortion then a regular UPS disconnected from outlet would solve the problem, but it doesn’t.

User avatar
F1zus
Posts: 132
Joined: 07 Nov 2022, 17:59

Re: Let's share and compare Windows' ETW MousePacketLatency results

Post by F1zus » 21 Nov 2022, 11:46

lavar wrote:
20 Nov 2022, 22:52
F1zus wrote:
16 Nov 2022, 19:27
andrelip wrote:
16 Nov 2022, 10:44
F1zus wrote:
15 Nov 2022, 14:14
This is due to dirty electricity.
Any data to support this statement?
Why don't online UPS fix the input lag problem?
Because at the output they give out not a pure sine wave, but with steps (teeth).
0dbc973c3387bb45fe95fe9032ccface1e3a481d.jpeg
When viewed normally, the sine wave appears to be perfect, but when magnified, we see steps.
a4ed981caaeddcd55fa5f9b35071c4890ba3500e.jpeg
Computer switching power supplies are very fond of modified sinosoids.
One solution to the problem is to use a toroidal balanced transformer. It smoothes the steps in the sine wave and eliminates electrical noise.

It it was harmonic distortion then a regular UPS disconnected from outlet would solve the problem, but it doesn’t.
No, it's not. When the UPS is running on battery power, the sine wave is greatly distorted, it becomes similar to a meander. This is because the battery is slowly discharging electrical current.
The UPS works best when plugged into an outlet. You can go to any audio forum and see for yourself. People specifically remove batteries so that the sinusoid is not distorted.
In addition, we found that the input lag is caused not only by the distortion of the sinusoid, but also by other factors.
Electrical noise (sine wave distortion) is 50% input lag.
A little later, we will test our theory and say what the reason really is.

Post Reply