This is very similar to an issue I battled for months on MacBook Pro (one of the later Intel versions, like 2018-ish), although there problem was not in the HW itself but the current version of MacOS at that time (this is no longer an issue).
I noticed that my WiFi had similar repeating lags .. about every 8-10s pings would go to a few hundred ms and then return to single/low double digits.
Long story short, the problem was with several MacOS components (and maybe some 3rd party software) requesting Location services to determine Mac’s position. To do that, among other things, Mac scans WiFi around you (probably for the names/SSID?) and to do that, the current WIFI connection is temporarily put on a back burner, resulting in a brief delay in traffic. The solution was to minimize location services.
This is a great example of good ideas destroying themselves. "Software should occasionally be able to find out where the computer it is on physically is" is a cool idea, but once it's there every single piece of crapware out there does it constantly.
I think they should (permission allowing) be able to ask for location, as often as they like.
I pin the system disruption from this query squarely on the OS. It should make such determinations in the background and return whatever value it has, without starting up a new scan just for this query.
You install an application you are giving it permission to do practically anything it wants to do with your system, including find the location as often as it wants to.
Browsers have to ask you permission to show desktop notifications, or get your location, or anything else.
Even when you have granular permissions, though, it just means the negative UX of having to click "no" every three minutes because some jackass at Adobe is convinced you really want to be told RIGHT NOW about every single product they make (or whatever).
The authorisation prompt doesn't show up once you denied. Which makes sense to avoid user fatigue, but is annoying when users denied it the first time (aka "go away stupid modal dialog") and now complain about things working (or not) as designed. At some point operating systems and browsers will have to run a simulation to provide realistic fake responses from denied subsystems if application developers get even more brazen violating user interests and maybe even *locally* analyse API call patterns for abuse with the option of sending a trace to make a claim against the developer with the application distribution channel. Oh you added a bunch of criminal spyware libraries praying on your paying users? Guess that's a push notification to your whole install base offering them a refund and a ban on further sales until you've paid up. Except no existing player wields that much power and can be trusted to use it wisely. sigh
> To do that, among other things, Mac scans WiFi around you (probably for the names/SSID?) and to do that, the current WIFI connection is temporarily put on a back burner, resulting in a brief delay in traffic.
Scanning for nearby WiFi access points with excessive frequency might be a dumb idea for other reasons (e.g. power consumption) but it should *not* interrupt the functionality of the current network connection.
If it does, that's a massive failure of the network card's firmware and/or OS drivers for it.
My guess would be that the card is changing frequencies/bands to scan other channels, and is slow to switch back to the channel of the currently-associated AP, or doesn't properly buffer network packets while doing so.
Under Linux, I don't think I've ever seen a case where WiFi scans appreciably affected a normal infrastructure-mode WiFi connection (whether from NetworkManager or triggered manually via `iw` etc).
So much for Apple's vaunted hardware/software integration
I've seen a lot of people experience lag spikes in Linux when software scans for SSIDs. It's a pretty common issue overall regardless of the OS, it's more of a device and driver quality question.
> It's a pretty common issue overall regardless of the OS, it's more of a device and driver quality question.
Right. I suppose I've been both lucky, as well as intentional in seeking out hardware with high-quality drivers when it was very important.
I'm just surprised that *Macs* have this issue, given that one of the alleged selling points for Mac is that it runs on a very limited set of hardware which is supposed to enable careful OS/hardware integration and testing.
> Scanning for nearby WiFi access points with excessive frequency might be a dumb idea for other reasons (e.g. power consumption) but it should not interrupt the functionality of the current network connection.
Scanning works by tuning the radio to listen for a beacon sent by the AP every ~100ms on every channel (there are 11 2.4 GHz and ~22 5 GHz channels in the US). Since you're not transmitting, it should be low-power, but you have to tune the radio to each channel, so you can't communicate with your AP.
> Scanning works by tuning the radio to listen for a beacon sent by the AP every ~100ms on every channel (there are 11 2.4 GHz and ~22 5 GHz channels in the US).
> Since you're not transmitting, it should be low-power,
Depending on the hardware/firmware quality, tuning to each channel can use a lot of energy. As for "not transmitting," this is true for passive scanning (generally preferable) but not for active scanning.
> but you have to tune the radio to each channel, so you can't communicate with your AP.
Right, but _if the OS and drivers are written properly_ (on both the client device as well as the AP ) they'll buffer unsent packets… the high latency during the channel changes is unavoidable, but the dropped packets and broken TCP streams are NOT.
> From your quote:
>
> With a good driver scanning takes only a few seconds
You omitted the immediately following text: "*and the driver breaks the scan into chunks*, returning to the associated access point’s channel periodically to handle pending traffic."
A good driver will return to the AP's channel _during the scan_ so that there is never more than (say) 100 ms of latency even while the scan is ongoing.
Fast switching on a background schedule while packets continue to flow but at slightly reduced rate should be possible. Might be very export controlled though given obvious application.
You mean the RF circuitry has to continue working in the frequency of the current network and switch frequencies to scan for other networks in all bands simultabeously? I don't think consumer hardware is capable of that. It usually will send probes or listen passively for some time in a band before moving to the next one sequentially. It's an expensive operation.
It is more insidious to scan all the SSIDs within the RF sightline of a device than it is to install a GNSS receiver in the laptop. It means that not only do they get all the SSIDs but that they have also triangulated some of those SSIDs. You are also giving up the location privacy of everything you can see.
Oh there is an obviously correct way to do it: have two radios able to switch channels with without impacting traffic, but that costs more money as well as space and power. No lets just retrofit this crap into existing drivers and hope nobody expects their computer to work reliably.
That's not the only way if you are the one designing the hardware. Even if you can't make a radio that can listen on multiple bands, you can add a second radio.
This plagued a lot of remote workers when the trend started due to ping latency causing terrible VC quality like delayed speech , dropped frames, out-of-order frames . Very frustrating.
In recent times, I found 2 troublesome issues: one was network-side and another was client-side.
1. Google/Nest WiFi mesh APs being "too close" to each other (30 ft / 10 m), causing a periodic backhaul mesh collapse. There was no user-visible indication of this, it was completely locked away and only noticed by support. I ditched Google's junk and moved to Ubiquiti.
2. On macOS, ObjectiveSee's LuLu has nondeterministic packet loss that causes SSH connection resets and a whole host of other weird problems. It's totally untrustworthy and shouldn't be used by anyone until it's proven reliable.
Usually, you can see a few comments mentioning those offers when you check the reviews. Amazon lets you go see just the 1-star reviews; this is a good use for that feature.
If you are ever a recipient of such an offer (free item, cashback, any benefit) and it is conditioned on writing a positive review (ie giving 1/5 won’t get you the free gift), this is as of recently not allowed and considered fraud.
Fakespot is not infallible but a useful addition to any Amazon research process.
They try to hide it from the front page (a bit of a dark pattern) but you don't need to download the plugin to use it, just visit https://www.fakespot.com/analyzer
Yeah, I was really annoyed when it to me quite a while to find that URL after they changed the layout of the site. I only shop on Amazon when I absolutely have to, and have an extension just sitting there being regularly updated with who knows what code really didn't appeal.
It's interesting how it's actually really easy to notice this happening as a random consumer (I've seen it a few times, in fact) but somehow impossible for Amazon to do anything about, and presumably when they do they don't bother putting in much effort to properly punish sellers for it. It's almost like Amazon does not give a shit.
Part of my falling out with AMZN was when I saw a product listing that where somewhere between fraud and word salad, complained, and was told that AMZN doesn't care what I think about a product listing unless I bought the product.
Problem is if I try to buy something on AMZN I need to sift through large numbers of junk product listings, a problem I don't have with best buy, petsmart, adorama, or other reputable online retailers. Even the marketplaces like Ebay, Etsy and Temu seem less offensive to me. Result = I canceled my Prime subscription and now AMZN is the last place I will go to buy something and not the first.
I wrote another comment in the thread about it, but fyi as of now mid-2024 giving out incentives (free items / discounts / cashback etc) conditioned on a positive review, is considered fraud and can be reported as such on https://reportfraud.ftc.gov/ .
Next time I see such an offer in an item I order I will definitely report it. Maybe it will improve the online shopping landscape by an epsilon if we all do it.
Yeah, I should probably update my Hugo theme to include the date (not that I ever write anything on there anyways TBH). Also, the I changed domains not too long ago, so that probably added some more confusion.
I encourage techies to dig into their wifi hardware & software end-to-end. Install smokeping on a raspberry pi (even a $10 zero works). Ping all of your home devices , your gateway, DNS & first hops of your IP.
You will discover all sorts of disruptions affecting your network quality, including interference.
For your primary devices like desktops & laptops, use mtr (my-traceroute) in a terminal window to watch your pings over time.
Your connectivity issues , particularly with VC, terminal emulation & gaming, are due to ping latency , not bandwidth issues.
You will find software issues like this one, the location services bug on MacOS, and others; as well as hardware issues due to transmission interference, noise, physical interference.
Good advice, but I'll add that there are many bad things smokeping won't detect.
My favorites are APs/range extenders/meshes that don't do multicast properly (mDNS in particular, breaking lots of LAN-based apps), and also ones that seem to semi-randomly isolate devices (i.e., prevent devices connected to the AP from reaching devices that are not connected to it, except the gateway).
There are a huge number of these devices (I'm looking at you, Netgear). Sometimes ICMP will work, but not TCP. It's nightmarish to debug, because it often seems to be some table-size issue in the AP, so devices will work for a while, and then some new device connects and the old ones break.
This is such a pain to do though, because so much of it is seeing braindead behaviors and not being able to do anything about it.
Putting as much as you can on wired ethernet helps a lot. Still have just as much bogus traffic, but on 1g (or even 100m), there's a lot more room for it.
Everyonce in a while, I look at the broadcast traffic on my wifi and cry.
For some it's not possible, but in my personal experience a lot of people who "can't" wire really just don't want to wire.
Even if you can't do a full "professional grade" install there are almost always viable options unless you live in an apartment built like a prison.
I have in the past:
* Poked tiny easily-patched holes in the wall just large enough to pass a bare cable through to an adjacent room
* Tuck cables under baseboard molding
* Run cables through vents
* Followed existing television/telco wiring
* (last resort) Just stapled the cable to the wall/ceiling, optionally covering with stick-on covers.
Most of those options can be hidden from view and all are trivially removable/repairable so there's no issue in a rental situation.
Almost everyone can do most if not all of those things if they want to, they just usually don't want to because they've been trained to not like wires, that wireless is better.
I have actually had a person complain about lag on their game console, which was in the shelves under their TV connected via WiFi to their cable modem which was in the same shelves, and they didn't want me to plug in a simple six foot cable between the two because they didn't want more wires. That's just pure stupid.
If it doesn't move, it should be wired unless there is absolutely no practical way to wire it. Desktop computers, game consoles, TVs, etc. Even laptops, if you're working from home and sitting at a desk, have a cable there. Modern laptops with USB-C docking stations make it easier than it's ever been, the same cord that provides power also provides reliable high speed networking.
For whatever it’s worth, running cables through your vents in the US is an NEC violation (see 300.22). If you’re renting it might be your only feasible option but probably not a great long term solution.
Otherwise, I strongly agree with everything said above, wired networking is worth the investment.
AFAIK low voltage wiring generally doesn't matter from a code perspective, but yea I would only see that as a temporary solution for renters and of course only use plenum-rated cable for it.
I've only done that particular trick in an apartment that had through-wall vents above the bedroom doors so it was literally four inches the cable was inside the vent.
Check the code, low volt is usually not a problem but in the case of air vents, it’s specifically called out. The only wires you can have inside metallic ducting are those needed to control HVAC systems.
fair enough. You're right it is possible. To me it's not worth the unsightly cabling and damaging penetration. I'm currently measuring about 1.5 ms / 0.5 ms SD pings on wifi. I could save 1.0ms on that by running cat5 around my house. But it would be unsightly , and add more penetration through my walls.
It's all about tradeoffs. My efforts spent on running great wifi have paid off.
Best case, yeah WiFi isn't substantially worse than wired, especially if all you care about is getting to the internet. Worst case, it's a fuckton worse. A wired network will never drop out for seconds at a time because something ran a scan (as noted in multiple places in this thread). A wired network doesn't give a shit about your microwave. A wired network doesn't have meaningful interference issues.
The more active users you have on your network, the worse WiFi is going to be, where a wired network can take more users than you can fit in a residential environment.
Perhaps I'm misunderstanding, but if you're claiming you are seeing 1-2ms pings consistently over a 30 day period on a WiFi network you're either doing something wrong with your measurement or you have a very unusual network with no other devices active, no meaningful interference, and extremely high signal strength.
It's not technically impossible, but it's so unlikely as to be the sort of thing the marketers who like to use terms like "AC3200" would be embarrassed to claim.
While obviously I don't have the amount of data that you have over a long period of time, I set up smokeping on my own home file server after seeing your graph and what I have so far should emphasize the point. My worst-case 20 ping average over this time is measured in microseconds with absolutely zero loss, testing to my gateway.
every solution is about tradeoffs. Of course you will be getting 500ns pings very low sd with wired ethernet. What matters is about the application and does the solution meet the needs of the application.
What I've been trying to communicate is that with adequate attention to the wifi hardware and configuration you can achieve excellent results that are adequate for VC & gaming .
that's it. Wifi will never reach wired ethernet performance on the junk bands that it is forced to operate on.
Your chart is showing an average of 20 pings every five minutes, I'm talking about absolute results from a constant ping.
Your data also shows multiple consecutive samples where at least one of those 20 pings were entirely lost. On a wired LAN at home scale any sort of packet loss would be indicative of something being very wrong.
But why does querying the registry cause the WiFi to drop?
It smells like there is a AP search occurring, which I think usually causes the antenna to frequency hop for the duration search, which results in latency on the established connection since it can't transmit at the same time.
But does enumerating registry keys do that? I didn't think the registry had dynamic behavior like that.
If I understand correctly, it's triggering an actual wifi AP scan, and the AP enumeration in the registry is a side effect of finding the interface to go ask it to rescan.
Around 2017 I moved into a new house and my MacBook Pro started getting latency spikes every few minutes. Not as bad, but still noticeable. This irked me quite a bit, because I spent several weeks wiring my house with the best POE-powered WiFi access points available at that time.
So I spent some time debugging the issue, and it turned out that the culprit was in the location services! For some reason, the weather widget tried to check the location every few minutes, and that involved scanning for the WiFi access points. Which in turn meant that latency spike, I posted about it on StackOverflow ( https://superuser.com/questions/1142798/experiencing-high-la... ).
This isn't even particularly close, but I had a gremlin that I would notice at night time where I'd hear my CPU fan idly spin up and the computer slow down... come to find out I was basically getting port scanned and _blasted_ with RDP requests, and since RDP is a nightmare protocol with no rate limiting to speak of, it was obvious that some botnet had found the port I had changed RDP to and was hammering it to try to gain access to my computer. This manifested with svchost.exe maxing out CPU, and digging deeper revealed it was coming from a botnet in... well, who knows where.
Obviously that was all the incentive I needed to finally heed my devops friend's warning and disable port forwarding and instead use Tailscale for remote access, but yeesh. Wild to watch happen first-hand.
"If scanning for wifi has that much negative impact on my connection, the OS should by default pop up a toast notification when it happens without a user request to do so."
If MS can put slop like news and weather and ads for apps like Candy Crush into the Windows GUI, they can also give me useful info like that.
At last, I know what probably was causing my Realtek WiFi problems during that era (circa 2020). It is so strange that a Ring 3 application can wreck a havoc on the networking subsystem for the whole OS. Also it is weird that Qt, being a UI library, takes a role of advanced network guardian by monitoring the activity of network interfaces. What a mess.
I have a similar issue with two M3 MBPro machines. There's a high volume of lost packets when I'm connected to my home 5GHz wifi. The 2.4 connection works just fine.
> Later, (for unrelated reasons) I built an entirely new desktop computer, not using anything from the old one, except the new wifi adapter. This included a fresh install of Windows 10… A few weeks later, and the issue suddenly began happening on the new computer also
This pretty clearly points to some weird software you’ve got installed. It’s not hardware, and it’s not a wonky Windows installation. What else could it be?
It doesn't look like that polling code was used under Linux. The fix was to only poll on Windows XP, since apparently this wasn't even needed on newer Windows versions. The bug was also fixed in 2018, so you would only be affected if your distriubtion ships a severely outdated Qt5 version.
I have a completely unrelated issue: since switching to a new iPhone, only my iPhone occasionally can't access anything on Wi-Fi.
All my other devices, including a MacBook and iPad connected to the same network work fine. My previous iPhone also worked just fine, it's just the new phone.
I know how annoying these can become, and glad to hear that you could pinpoint it down.
This is very similar to an issue I had while playing games on a wired Windows desktop. I haven’t run into it in a long time now that I think about it. I wonder what might have changed.
On a related topic. I have a really weird problem in my house where I'm about 20 feet from my TV trying to use my PS5 DualSense connected to a Google TV device connected behind the TV. It uses Bluetooth, which is also 2.4GHz, and the issue I'm having is that the dongle behind the TV is really impacting my controller connection and making playing games over PS Remote Play completely impossible. I even have the GTV device hard wired with an Ethernet adapter, as is my PS5. This can't really be a range limitation can it?
(Obligatory HN pedantry: arguably unrelated, but now I'll try to help anyway because this is quite common.)
Bluetooth is pretty low power, but without the TV in the way, that range should be no problem at all. Problem is that a lot can block it physically and drown it out in RF noise.
Most TV's probably have a thin, but solid aluminum plate in them for structure that could indeed block BLE and be causing the issue. Ironically, this is one RF case where metal studs would actually be helpful.
For comparison, I fly a paramotor and use Sena Bluetooth mesh for comms, and just our heads at any distance are enough to block it if we're on the wrong side of each other. Motorcyclists on the other hand don't often have this issue since there's other vehicles and stuff to bounce their signals around.
What might help if that's the issue is something reflective like foil mounted somewhere that can see both the controller and the GTV device. I'd also try to make the reflector slightly/roughly parabolic-ish (kinda shallow as to not make aiming difficult) pointed at the GTV device. You can hide the reflector behind and/or point it through anything RF transparent like wood or plastic.
Another possibility is other 2.4ghz noise— You could try turning down 2.4ghz transmit power on your AP as a possible quick fix. Of course if you haven't, make sure anything that can be on 5ghz, is.
Edit: Note that a reflector will also reflect noise sources at the GTV device.
I've also had issues with poorly shielded HDMI interfering with 2.4ghz in close proximity, so even just jostling things around behind the TV a little or using your best shielded HDMI cables there could help some.
Debugging RF can be tricky and frustrating, but I hope one of these tips helps either you or maybe a passer-by one day. :)
My favorite stupid wifi thing I ever had, for some value of favorite, was a previous incarnation of my home router, which apparently had a known issue where certain Intel wifi cards connecting to the AP would cause it to start having firmware crashes randomly, which I discovered when I brought home a new laptop and my wireless on every device started being unreliable...
Nothing to be done about it other than "don't do that" or "replace AP" since the firmware is a black box. It was...maddening.
I had this exact same experience with a brand new Dell XPS 15 I purchased around 2018 I believe. It came with a killer branded Wi-Fi card and I noticed shortly after purchasing that it would literally bring down my entire home network at the time. I don’t remember what router I was running or the rest of my home network set up at the time, but it was definitely a really bizarre thing to witness, I ended upreplacing the Wi-Fi card.
I have a love/hate relationship with qt. It is powerful, generally well-maintained, and I’ve compiled the same app to windows, linux, Mac, and arm, and a specific use case needing JNI on android.
It all just worked.
Their licensing got really goofy for a while, and yocto (which unfortunately I became a “SME” of at work) made cloning and using anything after 5.15.2 very obnoxious. They needed to figure out how to pull a RedHat and get paid support, but this was right around the time electron (at least for a while) rendered native apps as second-class citizens.
The bindings to other languages are neat, and the signal/slot idea is also neat. The whole moc part isn’t great, but I understand why, and it has very rarely caused me any real issues.
I think some are missing the actual point here:
Why does a software/hardware/driver concerned with drawing need to know what wifi-networks are available?
That is tantamount to surveillance.
An absolute no-go.
Agreed, the process is often a joy to read, but IMHO this article was like one of those joyless vids or AI-generated articles in which one must bulk scroll or fast forward to finally get to the goods.
I'll concede on the joylessness front. However, I assure you that all the posts on my personal blog are 100% artisanal human-made joyless posts! No AI needed.
No, it was very interesting to learn about his process and the tools used to diagnose. (I had a similar problem with Acronis True Image killing KiKad performace on Windows!)
As I replied elsewhere, the process is often a joy to read. In this case, perhaps a title like "Debugging QT5-related WiFi Dropouts in Windows" would have been better.
I noticed that my WiFi had similar repeating lags .. about every 8-10s pings would go to a few hundred ms and then return to single/low double digits.
Long story short, the problem was with several MacOS components (and maybe some 3rd party software) requesting Location services to determine Mac’s position. To do that, among other things, Mac scans WiFi around you (probably for the names/SSID?) and to do that, the current WIFI connection is temporarily put on a back burner, resulting in a brief delay in traffic. The solution was to minimize location services.