Open KingKaom opened 4 months ago
As a workaround, running netsh wlan set autoconfig enabled=no interface="Wi-Fi"
from elevated privileges PowerShell will fix this lag.
Undo it by running netsh wlan set autoconfig enabled=yes interface="Wi-Fi"
after streaming.
Hmm, we do request low latency mode which is supposed to suppress unnecessary background scanning. I wonder why it doesn't work in your case.
I was aware of wlan_intf_opcode_background_scan_enabled
but was hesistant to use it because I am worried it could prevent optimal roaming on mesh networks. We could suppress scanning if we see multiple BSSIDs in range for the current SSID, but that would probably prevent cross-frequency roaming between 2.4 and 5 GHz on the same AP 🤔
I actually returned the Qualcomm laptop and now have one with a Mediatek WiFi 7 adapter and am having the same issue. Running netsh wlan set autoconfig enabled=no interface="Wi-Fi"
fixes it on this one as well.
Would it be possible to have a toggle in the settings for people like me that still get lag spikes even with the pfnWlanSetInterface
method you referenced? Maybe the toggle could use wlan_intf_opcode_background_scan_enabled
but warn users of mesh networks that it would affect their ability to pick up a new access point if they move while running Moonlight. I don't really know many people who play games while running around their house but I suppose it could happen lol.
PROBLEM Ping spikes are observed every 5-10 minutes as shown here when the client is on WiFi. Their solution/workaround does not apply to non Intel WiFi adapters (Qualcomm FastConnect 7800 found in the Surface Laptop 7 for example).
SOLUTION The workaround to this issue from the FAQ reads as follows: "If you're streaming to a Windows PC with an Intel WiFi adapter, try setting "Global BG scan blocking" to "On Good RSSI" in the Device Manager Properties for the WiFi adapter. If "On Good RSSI" does not show up, try using "Always" instead."
This workaround only applies to Intel WiFi adapters. A more generic approach (using the Windows WIFi API) would mean this fix would apply to anyone on Windows and it could be enabled only while Moonlight is active. WlanSetInterface even has an option to enable streaming mode on the WiFi adapter, further improving latency and preventing power saving functions from interfering with streaming.
https://learn.microsoft.com/en-us/windows/win32/api/wlanapi/nf-wlanapi-wlansetinterface
ALTERNATIVES In order to prevent the occasional ping spikes I've tried: