Disable WLAN AutoConfig during streaming to eliminate Wi-Fi jitter #132
No reviewers
Labels
No labels
bug
dependencies
duplicate
enhancement
hacktoberfest-accepted
invalid
question
submodules
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-moonlight-stream/moonlight-common-c!132
Loading…
Reference in a new issue
No description provided.
Delete branch "psykokwak-com/disable-wlan-autoconfig-during-streaming"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
wlan_intf_opcode_autoconf_enabled) during streaming to prevent Windows from performing periodic background Wi-Fi scans that cause 50-400ms latency spikes every ~30 secondsexitLowLatencyMode()before closing the WLAN handle, ensuring network discovery is fully restored after streamingWlanSetInterfacecallProblem
On Windows, the WLAN AutoConfig service performs cyclic background scans at ~30-second intervals, even when already connected to a network. These scans cause periodic latency spikes of 50-400ms that are
clearly visible as jitter during game streaming over Wi-Fi.
The existing
wlan_intf_opcode_media_streaming_modeoptimization does not prevent these scans on all drivers (e.g., Intel AX211 returnsERROR_NOT_SUPPORTED(50) for media streaming mode).Running
netsh wlan set autoconfig enabled=no interface="Wi-Fi"before streaming completely eliminates the jitter. This PR implements the programmatic equivalent usingWlanSetInterfacewithwlan_intf_opcode_autoconf_enabled.Testing
Tested on a laptop with Intel AX211 Wi-Fi adapter streaming at 2560x1600@165Hz over Wi-Fi 6:
Frames dropped due to network jitter: 0.00%, average network latency 2msLog output confirms the fix is active:
WLAN interface 0 failed to enter low latency mode (error 50)
WLAN interface 0 cyclic background scan disabled
[...]
WLAN interface 0 cyclic background scan re-enabled
Notes
WlanSetInterfaceAPI and dynamic loading pattern already in place for media streaming modewlan_intf_opcode_autoconf_enabledis part of the samewlanapi.dllAPIView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.