basil00 / WinDivert

WinDivert: Windows Packet Divert
https://reqrypt.org/windivert.html
Other
2.56k stars 512 forks source link

DPC latency spike and audio stutter with high bittorrent traffic while windivert filter is opened #346

Open AlawamiAZ opened 1 year ago

AlawamiAZ commented 1 year ago

I noticed frequent audio stuttering glitching if windivert filter is opened and inbound bandwidth reach around 700mbps even if the filter is just "false". it takes few second of consistent >700mbps bittorrent traffic to induce the spikes. speedtest.net traffic rarely causes DPC latency spikes but qbittorrent traffic reliabely indeuces the spikes.

Note: While qbittorrent alone may cause spikes, they are benign and rarely exceed 16ms, while if windivert filter is opened it can jump up to 60ms thus causing audio stutters.

The latency spikes getgets attributed to ndis.sys and tcpip.sys according to latencymon: b9cd2ea6-db1e-46be-b384-52146083e99f

Latency example: A whopping 30ms in interrupt to process causing audio stutter: e07305fa-c519-437d-a81e-8dcceb42fb71

Steps to reproduce: PC: Windows 11 build 22621.24.28, Ryzen 3700x, Intel wifi AX210 driver 22.250.

  1. run passthru "false" Or any other filter the can reach very high bandwidth on modest CPU.
  2. run latencymon to observe spikes.
  3. run a torrent (with tcp mode only) that can reach near 1gbps. 3a. Optional: play any audio (prefereably pure tone https://www.szynalski.com/tone-generator/) if you want to check for audio stutters that result from the driver latency spike.

What does not induce the spikes:

  1. Iperf3 upload/download to lan at 900mbss doesn't trigger the issue.
  2. iperf from and to localhost.
  3. windivert filters that can't reach high speed due to cpu bottleneck like "true" filter.
  4. speedtest.net rarely causes the DPC spike.