14 ms·
AirPlay and Touch Bar = Network Disaster
- herpderperator 4y agoI ran into this the other day and did a video about it - not the best quality video but shows it happening in realtime with analysis and commentary: https://www.dropbox.com/s/hra2uxx66kf7z0j/PXL_20220609_214802355_stripped.mp4?dl=0 https://www.dropbox.com/s/hra2uxx66kf7z0j/PXL_20220609_21480... The cause in this case was AWDL (Apple Wireless Direct Link.) Holding the Option key while clicking the Wi-Fi icon and clicking "Enable Wi-Fi Logging" and then checking /var/log/wifi.log will show AWDL scans starting and ending randomly, and when the scan is active it causes latency spikes every 1s like clockwork. Unrelated to AWDL, but if a process is requesting a Wi-Fi network scan (different from an AWDL scan), /var/log/wifi.log will also tell you the name of the process, such as "locationd" when the Location Service needs your location. (Tangential, but the locationd process rarely causes these latency spikes for me - on a default macOS install it very rarely requests scans in my experience, backed by my analysis of the log.) AWDL has to be used for things like AirDrop, so it's expected to have this latency increase while you have the AirDrop window open scanning for nearby devices / sending files to other devices. There are other uses of AWDL (AirPlay, Auto Unlock, Universal Clipboard at the very least)[0], but I don't know what was triggering it so actively in my case... and why it wasn't happening on my M1 Air. It also wasn't always happening in the background like this, it just started that day. The "fix" was to disable the awdl0 interface, but that may also cause AirDrop/AirPlay and related services to not function (I did not test.) It's easy to re-enable it though. To disable: ifconfig awdl0 down To enable: ifconfig awdl0 up Upon disabling, the latency spikes go away permanently. [0] https://owlink.org/wiki/ https://owlink.org/wiki/
- saagarjha 4y agoThere’s a ton of things on macOS that just randomly start network scans and just destroy Wi-Fi performance. I helped Martin find on in the post, but personally I dealt with another one for several months on my own computer and eventually just gave up. I just went ahead and rewired my house with MoCA and now I get the speeds I was looking for, continuously and without the hassle, whenever I’m at my desk. I’d recommend everyone else to do the same, honestly. (Unless you’re at Apple. Then you should not do this and instead send in Radars when your network performance drops.)
- giantrobot 4y ago> (Unless you’re at Apple. Then you should not do this and instead send in Radars when your network performance drops.) Which unfortunately will get moved to NMOS/Future with a P6 priority and ignored forever. At best it'll get sent back to you "for more details". If you play the game an attach logs and investigation it'll get filed make into a black hole milestone or closed as a duplicate. There's a cabal that seems to only want new features and never tackle existing bugs in the OS.
- exikyut 4y ago> There's a cabal that seems to only want new features and never tackle existing bugs in the OS. Huh. That sounds strikingly similar to the culture breakdowns I've observed be associated with Google - the whole focus on newness and landing features in the name of solving hard problems, as opposed to maintaining stuff. Apparently the feedback/peer review/bonus system is completely broken. ...Maybe this sort of scaling problem is a "$T+ market cap" thing that we've just never had to figure out before?
- giantrobot 4y agoWith Apple there's a pathological need to release new devices and OSes on a yearly cadence. Landing a new feature rewards middle management and the top quintile of ICs with cash/stock bonuses and reflects on their end of year review. Fixing bugs does not get those rewards so there's little incentive to fix old bugs that 1) don't prevent a new feature's implementation or 2) aren't called out in a security release. > ...Maybe this sort of scaling problem is a "$T+ market cap" thing that we've just never had to figure out before? I don't know in all honesty. I'm sure part of it has something to do with the fact these companies have billions of customers. It's a mind numbing number of users. Even a single percentile change in the number of customers or revenue per customer makes for huge revenue differences. So given a finite amount of developer effort, a new feature which is likely to increase revenue is incentivized over a stupid AirPlay bug that isn't likely to increase revenue.
- throwawayFanta 4y ago
- aaaaaaaaaaab 4y agoOmg! This may very well solve my ping issues in webliero!
- aaaaaaaaaaab 4y agoUpdate: yes, after `ifconfig awdl0 down` my ping was no longer shooting up to ~200ms randomly, and I was able to play a 2-hour deathmatch with my wife without a single lag!
- InvaderFizz 4y agoApparently having location services enabled causes all manner of problems with Zoom calls over WiFi as well. Locations services invoke periodic WiFi scans like you get when you click the WiFi drop down.
- jeffbee 4y agoYeah, I recently disabled all location services on my M1 Mac mini after suffering over a year with constant wifi dropouts, not even poor latency but just no network for a few second every minute. Not sure who at Apple thinks this is an OK experience. Generally their network stack is a mess. Trying to bridge ethernet to wifi just fundamentally doesn't work. The forwarding is randomly reconfigured every time the machine wakes up. I think they aren't paying attention to system level functionality.
- pvtmert 4y agobridging uses physical layer afaik, which is why wifi + ethernet are not compatible with each other. especially when wifi is encrypted...
- aaronmdjones 4y agoBridging is a layer 2 operation, and both WiFi and wired ethernet are identical in that regard (and bluetooth ethernet encapsulation). It does work, on other operating systems.
- smoldesu 4y agoIt's funny, a lot of Apple's networking code is cribbed straight from the notoriously wonderful OpenBSD codebase. How did they manage to screw that up?
- wtallis 4y agoHas there ever been a time period where a BSD was known for having a notably better WiFi stack than Linux? I know the BSDs have a great reputation for their network stack overall and in particular the utilities for configuration (especially if you are willing to ignore the missing features), but I've never had the impression that there was any advantage specifically with regards to wireless. I seem to recall the BSDs historically having much narrower driver support and being years behind on features like 802.11ac.
- makecheck 4y agoThis is also one of the many cases of Apple not following their own guidelines. They suggested that Touch Bar items should act statically like keyboard keys and not be used to display status, etc. (In reality, plenty were abused for that, I guess the allure of a dynamic colorful display was too great.) So in this case, all they had to do was make it key-like and it wouldn’t have had any of the features that could trigger this problem.
- FunnyBadger 4y agoApple no longer has the hunger to get things right. It's sad as I've enjoyed the ride since 1995 but without Steve and Jony, and without having a "early acceptance stage" leaders like, but instead having a "late acceptance stage" leader (Tim the accountant), this is par for the corporate lifecycle - nothing lasts forever and Apple is now just as bureaucratic as IBM, Sperry, DEC, etc. The key thing about bureaucracies that reach this point is they become more interested in preserve bureaucratic power and privilege than focusing on customer mission. It's been repeated so many times you'd think someone would finally figure out and implement the formula to prevent it, but not ever Apple has.
- CharlesW 4y agoApple: Completely resets bar for computing efficiency, has PC industry scrambling. HN: "Apple no longer has the hunger to get things right."
- deleted 4y ago[deleted]
- randyrand 4y agoThat's pretty embarrassing. Perf teams at apple play second fiddle to any "Manager" with "A vision". This is the result.
- esaym 4y agoSimilar issue on linux: https://blogs.gnome.org/dcbw/2016/05/16/networkmanager-and-wifi-scans/ https://blogs.gnome.org/dcbw/2016/05/16/networkmanager-and-w... Just ran into it using a fresh Debian install on a Lenovo T14. My old laptop used an intel wifi card. Normally that is all I ever use, but figured I'd leave the stock one (Qualcomm 6855 (NFA765)) in and try it out. Worked fine except random lags every minute with a correlated increase in pings times. Fix was to lock Network Manager to a single AP so it won't background scan (something that apparently intel cards are better at doing). Googling shows this to be an issue going back 15+ years.
- justsomehnguy 4y agoSearch for "intel 7260 drops" says 162k+ results on Google. No matter the drivers (though for me the stock Windows ones worked best), AP, whatever. It just drops the connection once in a while.
- samtheprogram 4y agoOn a tangential note, I’m a fan of the support cycle of macOS. I consistently stay a major version or so behind to avoid the various issues of the major upgrades while getting security updates, but I’m also happy they are able to put out major upgrades yearly (which I also get each year — just a year behind). I don’t know if this will be consistent, but I was also able to do this with iOS, staying on iOS 14 for a long time while receiving security updates. Hadn’t noticed that ability in previous major versions of iOS and I’m not sure if it was due to device support of iOS 15. I hope that continues.
- deleted 4y ago[deleted]
- assttoasstmgr 4y ago> I’m a fan of the support cycle of macOS. Their what? They have no support cycle. Their cycle is "we support it until we don't". It's 2022 and it's an absolute joke. Windows, Linux, BSD -- basically everyone -- has published support dates aligned with all OS releases. For example from official documentation you would know that Windows 10 LTSC 2021 is supported until 1/12/2027[1] and FreeBSD 13 is supported until 1/31/2026. Apple is the only one that refuses to publish any dates. The mystique bit is getting old. The Jobs-era magic is gone. macOS will continue to be a toy until they take support seriously and that includes not breaking anything and everything with reckless abandon in every new OS release. No one who does IT with even a modicum of professionalism is okay with looking at Apple's latest critical security updates and suddenly finding out that N OS version was no longer included in the patch set. But that would take the mystery aspect out of it! [1] https://docs.microsoft.com/en-us/lifecycle/products/windows-10-enterprise-ltsc-2021 https://docs.microsoft.com/en-us/lifecycle/products/windows-...
- Hackbraten 4y ago> Apple is the only one that refuses to publish any dates. I don’t mean to defend Apple here, but one reason Apple may do that is because they essentially consider themselves a hardware company, and so the things they support are device models, not software versions. For me, a good-enough approximation has been that you can consider a macOS version [major dot minor] to be supported until the day [major dot (minor+1)] comes out, or the day [(major+3) dot 1] comes out, whichever happens earlier [1]. (Full disclosure: I’m the author of that merge request.) [1]: https://github.com/CISOfy/lynis/pull/1006 https://github.com/CISOfy/lynis/pull/1006
- DisjointedHunt 4y agoThis is wild! Duet Display, an app built by ex-Apple engineers has a curious toggle in the settings menu to turn off Airdrop, Handoff etc as well since it apparently screws up the remote desktop experience. Apple also has introduced a beta feature called "Universal control" which allows you to use your keyboard and other peripherals across all devices nearby (ipads, other macs etc) I wonder how much of a performance tax these other features levy and if Apple tests the regression explicitly.
- FunnyBadger 4y agoYet another reason why the Touch Bar is 100% Epic Fail!
- hoosieree 4y agoI hit a touch bar function accidentally at least once or twice a day. It looks cool, but the functionality is garbage.
- bene_legionary 4y agoI couldn't get used to it at all. Every few minutes I kept increasing the volume or decreasing the screen brightness, and at first I never realised why until I looked at how I rested my hands on the keyboard. A few days after I got the laptop I just got rid of it by taking out all of the touchbar buttons in the system preferences. I would have prefered the function keys a lot more.
- bigdict 4y ago> After having desperately achieved seemingly nothing over far too many hours of troubleshooting and feeling out of reasonable options, I decided to […] just randomly start killing […]
- HideousKojima 4y ago"I was always willing to be reasonable until I had to be unreasonable. Sometimes reasonable men must do unreasonable things." - Marvin Heemeyer, shortly before making an armor plated bulldozer and going on a rampage
- rubatuga 4y agoYou would be mistaken if you thought switching to ethernet would fix everything in macOS. There are three options for USB Ethernet chipsets that are supported in macOS without drivers: RTL8153, AX88178, AX88172A (not B or C). When using a RTL8153, I've experienced extremely high CPU usage (it's a shitty user-mode driver), and I've had the adapter drop out after transferring >20GB of files over it. I ended up buying the AX88178 and AX88172A adapters which are supported by the kernel. Based on my limited testing, only the AX88172A chipset is stable enough for 24/7/365 connectivity. Unfortunately the AX88172A is only 100Mbit, so consider it if you value stability > throughput The thread that sparked this rabbit hole: https://discussions.apple.com/thread/252387604 https://discussions.apple.com/thread/252387604 TLDR: 2022 and we are still stuck with 100Mbit adapters on macOS
- jolux 4y agoI use the Belkin one that Apple sells and have never had much issue with it. What chipset is that?
- legalcorrection 4y agoYeah, despite all the hype, MacOS is one of the least technically sophisticated operating systems in common use. Their main advantage over other systems is power management, and a large part of that is attributable at least as much to control over the hardware as to technical excellence. The fanboyism and reality distortion field is very strong. I remember when they came out with timer coalescing and were hyping it as a major accomplishment and selling point. Of course, Windows supported timer coalescing for years before MacOS, but that didn’t stop Jobs from convincing a bunch of developers that this was a novel breakthrough.
- pazimzadeh 4y agoMaybe let's wait until Windows allows scrolling of a non-active window before saying this. Or moving/changing the name of a file while it's open. Or having a slash in a file name.
- 4y ago
- codedokode 4y agoI don't understand though how a "network scan" (I assume sending a broadcast packet and receiving a response) can raise ping time from 3 to 150 ms.
- saltcured 4y agoIf you understand how TV used to be (before streaming), a network scan is more like you are trying to watch a program but your annoying brother has the remote and periodically cycles through all the channels to see if there is something more interesting to watch. He often does it during a commercial break but sometimes does not get back before the break ends and sometimes he just does it in the middle of a part of your program that he doesn't understand or thinks is boring.
- Nextgrid 4y agoA Wi-Fi network scan involves listening for beacons on all Wi-Fi channels which involves a frequency change. Thus during the operation the Wi-Fi card essentially leaves your current frequency (and stops being able to transmit/receive packets) and scans all the other ones.
- NavinF 4y agoAs weird as it sounds, $3000 machines still only come with one radio so it can only tune to one frequency at a time. Similar latency spikes happen when roaming between access points. WiFi is a mess and will be for the foreseeable future. Personally I just use a 10G ethernet card and some cheap optics.
- stefan_ 4y agoApple is really big into custom proprietary WiFi protocols (see also: AirDrop). So while AirPlay was originally limited to the local network, it now also apparently works over WiFi direct - and presumably that requires some sort of WiFi scan, in turn requiring the radio to switch channels which causes latency to tank.
- bscphil 4y agoThis is a good question but I don't think any of the other four replies have understood it. Judging by the original article, this problem appears when AirPlay devices are on the same network and the same subnet as you. All that should be required to scan for devices on your network is sending a broadcast packet, as you have indicated. What others are claiming effectively amounts to saying that the Macbook needs to disconnect from your network, scan for access points, and then reconnect to the network. Which would certainly cause latency issues, that much is true, but that's surely not the kind of scanning that is actually being done here? Why would a scan for access points be necessary?
- antux 4y agoThis goes to show why Activity Monitor is such a great tool for troubleshooting and killing suspicious processes that hog resources.
- kilroy123 4y agoIt's especially useful on the new M* macs. You can narrow down and see what apps or processes are using Rosetta.
- sharno 4y agoI have a non-Apple TV that supports AirPlay and sometimes when I try to get my iPhone to play something on it while the TV is disconnected (completely off) it causes my ASUS router to drop the WiFi signal completely for a few seconds. I have a feeling that the iPhone keeps searching the network and my router cannot keep up with the requests or something? Not sure but that's a theory I didn't get a chance to investigate
- miked85 4y agoTouch Bar was an absolute failure on every level, thankfully Apple backtracked on it.
- gamache 4y agoThey did, and then they didn't. https://www.apple.com/shop/buy-mac/macbook-pro/13-inch https://www.apple.com/shop/buy-mac/macbook-pro/13-inch
- jen729w 4y agoI think they’re just selling out that hardware because they made a quantity of the cases and Tim insists on running them out. I’d be stunned if any new Touch Bars had been manufactured in the last 18 months.
- leoff 4y agoI actually found it nice when using the debugger in VScode. Having the buttons for play/pause, skip line, etc make life easier.
- CharlesW 4y agoI always thought it was quite nice to have what's effectively an Elgato Stream Deck (https://news.ycombinator.com/item?id=31528895 https://news.ycombinator.com/item?id=31528895) built into my keyboard. It was certainly much better than fixed icons, which are in turn far more discoverable than numbered mystery keys. Apple's only real mistake was not keeping ESC a fixed hard key.
- andrewnicolalde 4y ago> Apple's only real mistake was not keeping ESC a fixed hard key. They’ve added that back for a few years now, but I agree. I used to own one of the 2016 MBPs with a Touch Bar and the lack of a physical escape key drove me insane. Even though I sold that laptop, I had actual while-asleep nightmares about the horrifically bad keyboard for a while too.
- 4y ago
- jorl17 4y agoI wonder if this is related... When I upgraded to Monterey (well, a beta, actually), I was met with a horrible bug that made me want to trash my laptop: my AirPods would randomly "cut out" for a couple of seconds for seemingly no reason. Sometimes it would take 5 minutes, sometimes 2 h. It was infuriating. I spent dozens of hours trying to figure it out. Disabling apps, enabling other apps, tracing logs, killing random applications, seeing if it was load-related, trying reboots. At one point I was half-convinced it only happened after coming back from hibernating (not suspending). I tried desperately to "fix" the bluetooth module, disable and re-enable handoff, delete internal settings, copy old bluetooth modules from older versions, working mostly tethered... Nothing seemed to fix it, until I found a message deep in the logs that led me to try to disable "AirPlay Receiver". Voilá! It was instantly fixed. I documented my workaround here: https://www.reddit.com/r/MacOSBeta/comments/qjgqjx/i_think_ive_found_a_fix_for_the_bluetooth/ https://www.reddit.com/r/MacOSBeta/comments/qjgqjx/i_think_i... and it seems it's spread a bit like wildfire through the internet. I should have put up a donation link :D What that journey taught me was that AirPlay, Wifi, Bluetooth and the like are serious messy beasts on macOS. I work with BLE sometimes while developing and I'm aware of how messy it is, but it seems that macOS has so many features that it makes it far worse. In any case, my workaround is still working and I occasionally still get people thanking me for finding it. I doubt they really know how much time I spent, and how insane I nearly went, just to find that (un)ticking a little box would solve all of my problems.
- janeerie 4y agoWhen I upgraded to Monterey, my AirPods started giving me robot voice on any call. It appears to be a conflict with my Logitech keyboard and mouse. I’ve switched to USB connection for those, but it’s not an ideal solution.
- pixiemaster 4y agoit’s interference between then USB 2.0 dongle of the devices and the USB 3 port. use a usb 3 cable to put them a distance away from the hub/ports. https://www.reddit.com/r/technology/comments/136g7y/usb_30_has_been_found_to_cause_interference_that/?utm_source=share&utm_medium=ios_app&utm_name=iossmf https://www.reddit.com/r/technology/comments/136g7y/usb_30_h...
- aasasd 4y agoIs there any sort of lower-level logging and monitoring in MacOS that would help with diagnosing such issues? I'm spending some time on a wonky wifi network, and so far it seems that it's high time to finally read about networking internals starting with ip and wifi protos, before I can even theorize about where to look and what to fiddle. In related news, behavior of bluetooth headphones likewise seems mysterious and impenetrable, especially with Android.
- shon 4y agoI suspect there are many edge cases that cause this. It’s not just the WiFi scanning or Airplay / Touchbar. I noticed this delayed ping pattern as far back as 2016. I spent some troubleshooting time and suspected it was something in MacOS but gave up.