Solved: The new MacOS Stim Native Client temporarily disables AWDL:
TL;DR: Download the Stim.io MacOS Application to fix this issue https://stim.io/downloads
What is AWDL?
Apple Wireless Direct Link (AWDL) is a non-WiFi protocol that is used for many Apple services and features, such as AirDrop, AirPlay, GameKit, Sidecar, and Handoff. Apple switches your Wifi Radio from AWDL to Wifi and back every few seconds while it scans for nearby Apple devices.
Essentially, Apple completely hijacks your entire Wi-Fi adapter every few seconds for milliseconds (disconnecting from your Wifi network + changing the wifi channel to 5Ghz channel 149) to quickly scan for other nearby Apple devices (Airdrop, etc). All Apple devices do this at set intervals to discover one another. When it occurs, it results in random, recurring microstutters every few seconds during each AWDL switch. While this "check for nearby Apple devices" lasts only milliseconds, that is long enough to create a horrific stutter when using stim due to jitter and out-of-order frames/packets. The issue worsens the closer other Apple devices are to your device, especially if they are in your Contacts.
These days, there is no reason for AWDL to exist, as Apple could simply abandon it and use the FCC-regulated and industry-standard Wi-Fi Aware, but Apple refuses to support it. So they force your entire wifi radio to switch constantly between standard Wifi and AWDL, then back every few seconds.
EU Mandate: Apple is being "encouraged" (hopefully soon forced) by the EU's Digital Markets Act (DMA) to transition from AWDL to the industry-standard Wi-Fi Aware (NAN) in future iOS versions, effectively phasing out AWDL. Until then, you will need to temporarily suppress AWDL while using Stim to have a decent streaming experience on Mac.
Sometimes, macOS will disable AWDL on its own when it detects a game running or an application with high data usage (because it figures you may be streaming or playing a game) or UDP packets such as Stim.io (even WebRTC uses UDP). This, however, is not foolproof, as AWDL will still randomly activate and run more frequently when it detects nearby devices that are also listed in your Apple Contacts.
To see for yourself what AWDL does to Stim, open Airdrop while connected to your Stim.io Cloud PC and watch Stim stutter like crazy as frames/packets begin to come in out of order with inconsistent delays.
AWDL causes no issues if you are already using 5Ghz wifi with a router coded to specifically use channel 149 (which is very common), as it has no need to change radio channels to scan for Apple Devices. In that case both your Wifi router and apple AWDL are on the same channel and frequency. This is why some people do not have this issue.
Some other Apple devices (including iPad and iPhone) use a dedicated radio for AWDL. But in Apple Silicon Macs AWDL runs on the same wifi interface as your internet connection.
If you continue to have this issue, I recommend opening Terminal on your Mac and running the command:
sudo ifconfig awdl0 down
This will fully disable Airdrop etc... until you reboot your Mac at which point it will all be enabled again.
Alternativly you can re enable awdl without a reboot by opening Airdrop, rebooting MacOS, or by entering sudo ifconfig awdl0 up in terminal.
How Can You Fix It?
- If you can, change Your Router to Channel 149 for 5Ghz. This will cause your device to not have to switch between channels to look for Apple Devices. It can remain on the same 5Ghz Wifi channel to both look for other Apple devices, and access the internet at the same time.
- If you can’t switch your Wifi routers channel, the only other option until Apple fixes this issue is to disable AWDL (temporarily) on your Apple Device. This can be done two different ways:
- Disabling all 3 services which use it (Location Services, Airdrop, and Handoff) in iOS or MacOS settings. Please Note: Apple is constantly adding new services which use AWDL.
- You can also disable AWDL by running the following command in a terminal if on MacOS:
- sudo ifconfig awdl0 down
- Note: You will need to do this each time you restart your device, or open Find My, Airdrop, etc...
- To enable AWDL again run: sudo ifconfig awdl0 up in terminal.
- sudo ifconfig awdl0 down
Currently the only solution we know of from our end is to have a native MacOS / iPad OS app but Stim is not able to do this as a website without a Native app.
We hope Apple will patch the issue for ultra-low latency Web Apps, or move to a more general standard instead of trying to create their own protocol (breaking 5Ghz Wifi for ultra-low-latency streaming in the process).
Sources:
https://discussions.apple.com/thread/254594055?sortBy=best
https://www.reddit.com/r/Stadia/comments/jqv6sy/apple_wireless_direct_link_causes_stutter_on_mac/
https://github.com/moonlight-stream/moonlight-ios/issues/607
https://github.com/moonlight-stream/moonlight-ios/issues/607