omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy.network widget triggers Wi-Fi scans while closed, causing packet loss on slow-scanning cards

Open xraid opened this issue 3 months ago • 8 comments

What happened

MacBook Air (13-inch, Mid 2012) (1.0)

The omarchy.network bar widget drives NetworkManager RequestScan calls while the network panel is closed. On hardware where a scan is slow this causes continuous, measurable packet loss. There are two severities:

  1. Normal operation — roughly one RequestScan every ~150s. Costs ~4.4% packet loss here.
  2. Stuck state — the widget gets stuck scanning every 10 seconds indefinitely. Costs ~19.7% packet loss. Seen after several hours of uptime; omarchy restart shell clears it, but it returned within a few hours.

Removing omarchy.network from the bar layout eliminates both: 0 scans and 0% loss over 750 pings / 150s. Re-adding it brings the loss back. That isolates the widget as the cause.

On a slow-scanning card this is destructive rather than cosmetic. This machine has a Broadcom BCM43224 on brcmsmac, where one full 37-channel scan takes ~11 seconds. A scan every 10s meant the radio was off its associated channel roughly half the time, so it missed inbound frames continuously:

Bar config Scans Packet loss to gateway
Widget present, stuck state ~4.5 / 90s 19.7% (900 pings)
Widget present, normal 1 / 90s 4.4% (450 pings)
Widget removed from bar 0 / 150s 0% (750 pings)

Signal was -46 dBm with zero beacon loss and only +2 tx retries per 100 pings throughout, so this was not RF, roaming, or the transmit path.

Evidence

RequestScan caller identified on the system bus, panel closed:

method call sender=:1.48 -> destination=org.freedesktop.NetworkManager
  path=/org/freedesktop/NetworkManager/Devices/2
  interface=org.freedesktop.NetworkManager.Device.Wireless; member=RequestScan

:1.48 resolved via GetConnectionUnixProcessID to:

PID  PPID USER  CMD
944  941  <user> quickshell -n -p /usr/share/omarchy/shell

Timestamps show a strict 10s cadence: ...639.07, ...650.17, ...660.17.

Correlating iw event -t with a ping run, the loss window falls exactly inside each scan:

1787485269.570971: scan started
1787485280.625887: scan finished: 2412 2417 ... 5805 5825   <- 11.05s, 37 channels

Over a 180s sample: 8 scans, durations [11.1, 11.1, 11.0, 11.1, 11.0, 10.9, 11.0, 10.8], totalling 88.0s of 180s = 49% off-channel.

Expected

With the network panel closed, the bar widget should not trigger Wi-Fi scans at all. A bar icon showing connection state and signal does not need a fresh AP list; that is only needed while the panel is open. Scanning is not free on every radio.

Reproduction

The baseline behaviour reproduces reliably: add omarchy.network to the bar and scans resume; remove it and they stop. The 10-second stuck state I could not reproduce on demand — it appeared after hours of uptime, and returned after an omarchy restart shell had cleared it. Toggling the panel open and closed (omarchy-shell shell toggle omarchy.network) correctly releases the scanner — 0 scans in the following 45s. The state appeared after several hours of uptime. omarchy restart shell clears it reliably.

setScannerEnabled in shell/plugins/panels/network/Panel.qml looks correct on the normal path (var nextDevice = opened ? wifiDevice : null, plus release in onOpenedChanged and Component.onDestruction). The suspect is therefore a path that leaves scannerEnabled true on the shared WifiDevice without an owning open panel — note the comment there that the property "has no reference counting, and a bar widget is instantiated once per monitor". A monitor hotplug / device replacement / suspend-resume ordering seems the likeliest cause.

Two things that might make this class of bug harmless regardless:

  • reference-count scannerEnabled on the shared WifiDevice, and/or
  • have the scanner auto-expire rather than scan forever while nothing is watching.

Ruled out

  • UFW — 0 ICMP blocks during a test that lost 18%. The [UFW BLOCK] TCP ACK lines in the log are a symptom (stalled connections' late ACKs falling outside conntrack), not a cause.
  • wpa_supplicant bgscan — simple:30:-70:86400; RSSI was -44, above the -70 threshold, so it was in its 24h mode.
  • Wi-Fi power saving — already off.

Environment

  • Omarchy 4.0.0-1
  • quickshell-git 0.3.0.r20.g28771c7-2
  • NetworkManager 1.58.0-1
  • Kernel 7.1.8-arch1-3
  • Broadcom BCM43224 / brcmsmac, MacBookAir5,2

Unrelated minor finding

omarchy debug --no-sudo --print fails with Unknown Omarchy command: omarchy debug, though omarchy --help advertises it and the omarchy-debug binary accepts those flags. The dispatcher route appears to be missing. Happy to split this into its own issue.

xraid avatar Aug 23 '26 14:08 xraid

Adding a second slow-radio data point confirming this, on a Marvell 88W8797 (mwifiex_usb, USB ID 1286:2044, single-radio) — Omarchy 4.0.1, kernel 7.1.9-arch1-2, firmware mwifiex 1.0 (14.68.29.p60).

Symptom: periodic multi-second Wi-Fi packet loss on a ~14s cadence.

Root cause (matches this issue / #8221): omarchy.network leaves WifiDevice.scannerEnabled on behind a closed panel, so NM RequestScan fires every ~10s. On this radio each scan is a full 39-channel active sweep taking 3–5s, during which the single radio is off its operating channel and drops all frames.

Evidence:

  • iw event -T scan durations, back-to-back: 5.0s, 3.9s, 3.0s, on a ~14s cadence.
  • Timestamped ICMP (from another host on the same L2) aligned to the scans: dropped-packet gaps land on the scan-start second, every time. Baseline RTT 4–20 ms spiking to 3265 ms inside a scan window; loss 8–20% depending on how many scan windows a run caught. A stronger-signal run measured worse, purely by catching more scans — signal is a red herring here.
  • dbus-monitor on org.freedesktop.NetworkManager.Device.Wireless RequestScan: caller resolves (via busctl status) to the quickshell omarchy shell, one call every ~10.5s.
  • The radio's firmware also logs mwifiex_usb ... CMD_RESP: cmd 0x23f error, result=0x2 at each association during the scan storm.

Proof it's the scanner, not the radio/AP/signal: kill -STOP on quickshell → 0% loss (35/35), max RTT 92 ms; kill -CONT → loss returns immediately. Both bands and multiple BSSIDs failed identically, so it isn't the AP or band.

Workaround on 4.0.1 (pending #8221): removing omarchy.network from ~/.config/omarchy/shell.json and omarchy-restart-shell → 0 RequestScan in 12s, 0 CMD_RESP in 70s, 1.7% loss (1/60).

kcollo-netizen avatar Aug 28 '26 14:08 kcollo-netizen

MacBookAir4,2 (Mid-2011), BCM43224 [14e4:4353] — different resolution

I ran into severe Wi-Fi instability after a fresh Omarchy install on a Mid-2011 13" MacBook Air. The interface associated normally, received a DHCP address and default route, and DNS worked, but traffic was nearly unusable. Pings to the local gateway showed roughly 20–75% packet loss with latency sometimes reaching several seconds.

Hardware:

  • MacBookAir4,2 (13-inch, Mid-2011)
  • Broadcom BCM43224 [14e4:4353]
  • Omarchy / Arch
  • Initially using brcmsmac

I tested disabling Wi-Fi power saving and also removed the omarchy.network widget as discussed in this issue. Neither resolved the problem on this machine.

The solution was switching from brcmsmac to Broadcom's wl driver using broadcom-wl-dkms.

Required packages:

  • linux-headers matching the currently running kernel
  • dkms
  • broadcom-wl-dkms
  • pahole (required by the current headers/DKMS build)

After building the module with DKMS and loading wl, gateway performance immediately changed from severe packet loss/multi-second latency to:

  • 0% packet loss
  • ~6 ms average latency to the gateway
  • normal Internet connectivity

To make the change persistent I blacklisted: b43, b43legacy, brcmsmac, bcma, ssb and configured wl to load at boot.

After reboot and a full pacman -Syu, wl remained loaded and Wi-Fi remained stable at 0% packet loss.

One important gotcha: broadcom-wl is kernel-version-specific. I initially ended up with a wl.ko built for a newer kernel and modprobe wl failed. broadcom-wl-dkms + the exact matching linux-headers for uname -r was the reliable solution.

deadrich avatar Aug 28 '26 23:08 deadrich

Independent data point: MacBookAir5,2 / BCM43224 — broadcom-wl-dkms resolves persistent brcmsmac loss

Hardware/software:

  • MacBookAir5,2
  • BCM43224 [14e4:4353], Apple subsystem [106b:00e9]
  • Omarchy 4.0.1-1
  • Kernel 7.1.9-arch1-2
  • NetworkManager 1.58.1-1

With brcmsmac, the card associated normally with excellent signal (-24 to -41 dBm), power saving off, valid firmware, DHCP and routing. However, RX remained at 6.5 Mbit/s / MCS 0 and traffic showed severe burst loss and multi-second latency.

Controlled results included:

  • Dedicated 2.4 GHz SSID: no meaningful improvement
  • Unloading unused b43: no repeatable improvement
  • Omarchy network widget removed and shell restarted:
    • 0 NetworkManager RequestScan calls over 150 seconds
    • Gateway: 540/750 received, 28% loss
    • Signal remained approximately -25 dBm
    • No association cycling

This confirms a separate brcmsmac problem on this machine in addition to the scanner issue.

After a full Omarchy update, I installed matching packages:

  • linux-headers 7.1.9.arch1-2
  • dkms 3.4.3-2
  • pahole 1:1.31-2
  • broadcom-wl-dkms 6.30.223.271-48

DKMS successfully built wl for 7.1.9-arch1-2.

Live wl test:

  • Gateway: 300/300, 0% loss, 13.6 ms average
  • Internet: 60/60, 0% loss, 25.8 ms average
  • HTTPS request through the internal interface completed normally

Post-reboot, with USB Wi-Fi removed and wl as the sole/default interface:

  • Gateway: 749/750, 0.13% loss over 150 seconds
  • Internet: 300/300, 0% loss over 150 seconds
  • 0 NetworkManager disconnects
  • 0 RequestScan calls during the sample
  • SSH remained stable

One caveat: wl emits a field-spanning-write warning during its initial scan:

memcpy: detected field-spanning write ... wl_cfg80211_hybrid.c:3139

A WLC_SCAN error (-22) also appeared during the live setup. Neither repeated during the post-reboot soak or affected connectivity, but the warning is worth recording.

Final binding:

Kernel driver in use: wl

alexg0 avatar Aug 30 '26 20:08 alexg0

BCM43224 / brcmsmac: disabling 802.11n resolved download stalls in a separate test

Adding results from September 15 on a MacBookAir5,2, relevant to the other BCM43224 reports in this thread.

Environment: BCM43224 [14e4:4353], Apple subsystem [106b:00e9]; brcmsmac; Omarchy 4.0.3-1; Linux 7.2.3-arch1-3; NetworkManager 1.58.1-1.

Association and DHCP succeeded, signal was approximately -34 dBm, and Wi-Fi power saving was already off. Small requests and short gateway ping samples worked, but larger HTTPS downloads repeatedly stalled. During those stalls, iw reported RX at 6.5 Mbit/s / MCS 0 while TX could reach 144.4 Mbit/s.

Downloads were explicitly bound to the internal Wi-Fi interface using curl --interface 'if!wlp2s0b1'; Ethernet remained connected and was tested separately against the same endpoint.

Configuration Download result
Ethernet control 2,000,000 bytes in 0.27 s
Original 5 GHz Wi-Fi Timed out at 20 s with only 223,312 bytes received
2.4 GHz Also stalled
Reduced MTU (live MTU 1280) Also stalled
Network widget removed from bar configuration, normal 802.11n Timed out at 20 s with only 238,366 bytes received
802.11n disabled, existing brcmsmac driver 2,000,000 bytes in 2.57 s
Repeat with 802.11n disabled 5,000,000 bytes in 5.51 s
Automatic workaround after reconnect, original widget restored 5,000,000 bytes in 5.07 s (~7.9 Mbps)

The temporary workaround was to set disable_ht=1 on the active wpa_supplicant network and reassociate:

sudo wpa_cli -i wlp2s0b1 list_networks
# Substitute the current network ID from the output:
sudo wpa_cli -i wlp2s0b1 set_network <network-id> disable_ht 1
sudo wpa_cli -i wlp2s0b1 reassociate

Afterward, iw confirmed legacy rates (36–54 Mbit/s), and a separate 20-ping gateway sample had zero loss. Normal MTU 1500 and the original 5 GHz profile setting were restored. A local NetworkManager dispatcher hook now reapplies the override after activation, scoped to this adapter/driver and connection; automatic application was verified after reconnecting.

Scope and limitations: This is a reduced-speed workaround associated with 802.11n operation, not a confirmed diagnosis of the underlying driver/AP defect. Reboot, suspend/resume, and long-term reliability have not been tested. The widget-removal test used the shell's config hot reload; we did not establish zero RequestScan calls over a long sample, so it does not rule out the scanner bug. These results may help distinguish overlapping failures on this chipset, but do not validate or replace #8221.

garymeyerca avatar Sep 15 '26 15:09 garymeyerca

Checked against quattro at b83d3df08: this is still open there. The scanner handling in shell/plugins/panels/network/Panel.qml (setScannerEnabled, the release in onOpenedChanged and Component.onDestruction) has not changed since 4.0.0, and nothing else in the shell writes scannerEnabled.

What the source supports: quickshell sends RequestScan only while WifiDevice.scannerEnabled is true, and re-arms every 10001ms for as long as it stays true (src/network/nm/wireless.cpp, onScanTimeout). So the 10-second stuck state you measured means the flag was left on behind a closed panel. Reading the panel code I did not find the path that leaves it on: opened is per instance, and each release path drops the device it claimed. Nobody has reproduced the stuck state on demand, including here, so the cause is explained rather than confirmed. Nothing was run on a worker for this issue.

The fix is already up as #8221, which reference-counts the scanner claims across bar instances and adds a 30s sweep that drops claims whose owner has closed or died. It is linked to this issue and will be reviewed as its own item. One thing for the maintainer: #14286 rewrites the same setScannerEnabled and Component.onDestruction lines to defer the release until the popup has unmapped, so the two collide and whichever lands second needs reworking.

The omarchy debug routing problem you mentioned at the end is tracked separately in #14014.

Reviewed by Claude Opus 5.5 alone: the second opinion (Codex Medium) answered a ping but refused this review because its daily review budget was spent, so nothing here has been checked by a second model. This waits on the maintainer's decision on #8221.

omarchybot avatar Oct 08 '26 13:10 omarchybot

I can confirm the finding on my system. Disabling the omarchy.network plugin has made my Wi-Fi connection stable; before that, I saw repeated scan errors (WLC_SCAN error (-22)) and brief disconnects.

Hardware: 2013 MacBook Pro, Broadcom BCM4331 (PCI ID 14e4:4331, Apple AirPort Extreme). Kernel: 7.2.15-1-omarchy. Wi-Fi driver: proprietary wl module from broadcom-wl-dkms 6.30.223.271; cfg80211 is also loaded.

axxxo1 avatar Nov 02 '26 21:11 axxxo1

System details

MacBook Air 5,2 (13-inch, Mid 2012), Broadcom BCM43224 [14e4:4353] subsystem [106b:00e9], Omarchy 4.5.0-3, kernel 7.2.15-1-omarchy, NetworkManager. The omarchy.network bar widget was left installed for both samples. This does not change the scanner bug in this issue. It is a driver comparison on the same machine class.

What's wrong, and what changed

brcmsmac associated and then lost packets on a quiet-looking link. Switching to broadcom-wl-dkms 6.30.223.271-50 removed that loss. DKMS built wl for 7.2.15-1-omarchy. A live unload left bcma busy, so the wl numbers are from after reboot, with wl bound to wlp2s0.

Both samples used the same saved 2.4 GHz network, channel 12, the same access point, and 802-11-wireless.band=bg. Measured 15 November 2026.

brcmsmac on wlp2s0b1 wl on wlp2s0
Signal −67 dBm −63 dBm
Client rate (iw) RX 57.8 Mbit/s MCS 11 SGI, TX 78.0 Mbit/s MCS 12 TX 58.5 Mbit/s. No RX rate and no station dump from iw
TX health 4957 retries and 418 failures on 5449 TX packets over 112 s 0 RX errors, 0 TX errors on the interface
Ping gateway, 50 packets at 0.2 s 20% loss, RTT min/avg/max 1.1/13.0/128 ms 0% loss, RTT min/avg/max 1.1/12.9/151 ms
Download 20 MB from speed.cloudflare.com 16.1 MB then timeout at 20 s, about 6.5 Mbit/s 20 MB in 5.6 s, about 28.5 Mbit/s

nmcli still shows 1170 Mbit/s for that access point. That is the AP's advertised rate, not the client link. BCM43224 is 2x2 802.11n.

I did not count RequestScan during these two samples, so this does not say the bar widget was idle. On brcmsmac, forcing this same network onto 5 GHz (channel 36) associated and then fell to MCS 0 with 27% loss. 5 GHz was not remeasured on wl.

The interface name changes from wlp2s0b1 to wlp2s0. A NetworkManager profile pinned to the old name does not reconnect until connection.interface-name is cleared. The kernel warns that wl is unmaintained and taints the kernel.

Installer change for this chip, with the corrected numbers: https://github.com/omacom/omarchy/pull/10910

andyholst avatar Nov 15 '26 20:11 andyholst

Rechecked quattro at c6be7abb9. The earlier comment overstated what the 10-second cadence proves: we have not observed scannerEnabled during a stuck episode. The current enable/close guards and --rescan no polling do not reveal the cause. #8221 would clear an unclaimed true flag while its reconciliation timer is running; that does not establish that the original stuck state was caused by such a flag.

The November reports describe different observations. Disabling the widget helped the BCM4331/wl system, but no scan counts were recorded. The November 15 BCM43224 driver comparison kept the widget enabled and did not count scans either, so its improvement does not establish that changing drivers fixes closed-panel scanning. #10910 is a separate driver-installation change.

If the stuck state recurs, please capture scannerEnabled and each network-panel instance's opened state alongside timestamped RequestScan calls attributed to Quickshell and packet-loss measurements. The missing distinction is whether scanning continues with the flag true and every panel closed, or with the flag false. This remains open for maintainer review of the already-linked #8221; no competing fix was opened.

Reviewed by GPT-6 High in Codex, Opus 5.5 High, and muse-wonder via pi with thinking high. Both additional reviewers agreed that the stuck path remains unestablished; independence is not guaranteed because they received the earlier triage and source-reading context. No worker tests or affected-hardware reproduction ran in this pass.

omarchybot avatar Nov 18 '26 02:11 omarchybot