Frequent WiFi stalling

I’m setting up my new Vero5, which involves a lot of accessing the device via SSH. I’m seeing frequent ‘stalls’, where terminal echo stops for a few seconds while I’m typing.

Looking in journalctl I see this:

Dec 06 11:52:39 osmc2 kernel: RTW: cfg80211_rtw_scan(wlan0)
Dec 06 11:52:39 osmc2 kernel: RTW: [HW_VAR_CHECK_TXBUF] Empty in 0 ms
Dec 06 11:52:39 osmc2 kernel: RTW: wlan0 sleep m0=0x00000003, ori reg_0x4d4=0x00000000
Dec 06 11:52:43 osmc2 kernel: RTW: LeaveAllPowerSaveModeDirect.....
Dec 06 11:52:43 osmc2 kernel: RTW: LeaveAllPowerSaveModeDirect: Driver Already Leave LPS
Dec 06 11:52:43 osmc2 kernel: RTW: rtw_hal_set_macaddr_port wlan0- hw port(0) mac_addr =70:68:71:3>
Dec 06 11:52:43 osmc2 kernel: RTW: wlan0- hw port(0) mac_addr =70:68:71:3c:b8:ac
Dec 06 11:52:43 osmc2 kernel: RTW: wlan0 wakeup m0=0x00000003, ori reg_0x4d4=0x00000003
Dec 06 11:52:43 osmc2 kernel: RTW: survey done event(27) band:0 for wlan0
Dec 06 11:52:43 osmc2 kernel: ========== ACS (VER-3) ==========
Dec 06 11:52:43 osmc2 kernel: Best 24G Channel:13
Dec 06 11:52:43 osmc2 kernel: Best 5G Channel:64
Dec 06 11:52:43 osmc2 kernel: RTW: rtw_indicate_scan_done(wlan0)

These entries appear at roughly 5-minute intervals, and during the period between the ‘sleep’ and ‘wakeup’ lines the Vero is unresponsive to SSH.

I haven’t tried the Vero as a media player yet so don’t know whether this behaviour would affect it.

The WiFi channel is set by the router so there is no point in scanning for a quiet channel. Is there any way it can be stopped?

Hi

Hard to speculate without a full log but does disabling band steering on the router change things?

Can’t reproduce here with a UniFi AC Lite but perhaps with some more information I can get this solved

Sam

Logs are at paste.osmc.tv/wutusataso

My router is a FRITZ!Box 7530 which has both 2.4GHz and 5GHz wifi; I see the same behaviour on both bands. I can’t see any mention of band steering in the router UI.

I also have a Vero 4 which doesn’t exhibit this problem.

Reading around the topic (always dangerous!) I came across the ‘roaming’ support in wpa_supplicant. If the wifi signal falls below a configured threshold, wpa_supplicant will start a search for a better source at configured intervals. The settings seem to be 300 seconds (which matches my issue) and -65dBm. Unfortunately I can’t see any way of finding out the signal strength at the Vero 5.

iwlist / iw might be of assistance.

I vaguely recall adjusting that before and from memory the patch was made to ConnMan as it invokes wpa-supplicant.

It can definitely be investigated.

Try

sudo apt install wireless-tools
iwconfig

OK thanks.

$ iwconfig
wlan0 IEEE 802.11AC ESSID:"redacted" Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency:5.26 GHz Access Point: DC:39:6F:F7:67:52
Bit Rate:867 Mb/s Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=87/100 Signal level=-53 dBm Noise level=0 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

The signal level is well above the trigger value for a rescan so that’s likely ruled out.

I tried streaming TV through the Vero and at the time that a scan is due I see this:

Dec 08 12:13:41 osmc2 kernel: RTW: cfg80211_rtw_scan(wlan0)
Dec 08 12:13:41 osmc2 kernel: RTW: WARN cfg80211_rtw_scan (wlan0) : scan abort!! BusyTraffic

which reduces the issue to merely ‘Irksome’ I suppose.

I misunderstood the scan settings. The current setting

bgscan = "simple:30:-65:300"
means that a scan will take place every 30 seconds if the signal level is less than -65dBm and every 300 seconds otherwise, which does match the behaviour I’m seeing.

Yes, I don’t see that as a real problem either. As soon as the kernel detects even the slightest still open data transfer over Wi-Fi, the scan isn’t even performed. With a continuous ping (ICMP datagrams), the maximum single delay during a scan is only 3.5 seconds … that’s manageable in a terminal session. Most people will hardly notice it while typing or monitoring something in a PuTTY window.