Disable WLAN AutoConfig during streaming to eliminate Wi-Fi jitter - #132
Open
psykokwak-com wants to merge 1 commit into
Open
Conversation
Windows WLAN AutoConfig performs periodic background scans (~30s intervals) that cause 50-400ms latency spikes during game streaming over Wi-Fi. The existing media streaming mode (wlan_intf_opcode_media_streaming_mode) does not prevent these scans on all drivers. This disables WLAN AutoConfig (wlan_intf_opcode_autoconf_enabled) when entering low latency mode, which is the programmatic equivalent of: netsh wlan set autoconfig enabled=no interface="Wi-Fi" AutoConfig is explicitly re-enabled in exitLowLatencyMode() before closing the WLAN handle to ensure network discovery is restored. Also adds error logging for the existing media streaming mode call.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.dllAPI