Wifi 5ghz OSMC branded USB dongle RPi3

Live streams, such as with the twitch.tv addon, showcase as buffering via Kodi around every 20 minutes, but I believe it is actually losing the tcp connection (verified by tcpdump/wireshark) and having to rebuild it due to a wifi issue.

This is a section of dmesg from the RPi3 in question. Part of the section below appears over and over, but when it includes the Indicate_Legacy_Packet part I believe the issue happens. This pi is unpingable from other devices on my local network during this event.

Dec 10 17:12:51 OSMC-KODI kernel: DeQueueRunning[0]= TRUE!
Dec 10 17:13:39 OSMC-KODI kernel: DeQueueRunning[0]= TRUE!
Dec 10 17:13:43 OSMC-KODI kernel: 80211> CFG80211_OpsScan ==>
Dec 10 17:13:43 OSMC-KODI kernel: 80211> Can not find any chan info!
Dec 10 17:13:43 OSMC-KODI kernel: 80211> Can not find any chan info!
Dec 10 17:13:44 OSMC-KODI kernel: 80211> cfg80211_scan_done
Dec 10 17:13:44 OSMC-KODI kernel: 80211> CFG80211_OpsSurveyGet ==>
Dec 10 17:13:44 OSMC-KODI kernel: 80211> busy time = 2132420656 -2135099984
Dec 10 17:13:44 OSMC-KODI kernel: Indicate_Legacy_Packet():flush reordering_timeout_mpdus! RxWI->Flags=128, pRxWI.TID=0, RxD->AMPDU=0!
Dec 10 17:13:44 OSMC-KODI kernel: 625, flush one!
Dec 10 17:13:45 OSMC-KODI kernel: 80211> No scan is running!
Dec 10 17:13:45 OSMC-KODI kernel: Indicate_Legacy_Packet():flush reordering_timeout_mpdus! RxWI->Flags=128, pRxWI.TID=0, RxD->AMPDU=0!
Dec 10 17:13:47 OSMC-KODI kernel: 80211> No scan is running!
Dec 10 17:13:49 OSMC-KODI kernel: 80211> No scan is running!
Dec 10 17:13:51 OSMC-KODI kernel: 80211> No scan is running!
Dec 10 17:13:51 OSMC-KODI kernel: 6b7, flush one!
Dec 10 17:13:56 OSMC-KODI kernel: DeQueueRunning[0]= TRUE!
Dec 10 17:13:56 OSMC-KODI kernel: DeQueueRunning[0]= TRUE!

Logs:
http://paste.osmc.io/uqefenowez

/etc/modprobe.d/raspi3-blacklist.conf
#wifi
blacklist brcmfmac
blacklist brcmutil
#bt
blacklist btbcm
blacklist hci_uart

I am using the OSMC branded 5ghz usb wifi in place of the disabled on-board.

The WiFi driver is a little noisy. In the next update I will make the driver quieter as those messages are safe.

Are you connected to 802.11ac or 802.11g?

The scanning is probably causing the problem. I think this is a problem with ConnMan. Please post cat /proc/net/wireless

It is connected via the 5ghz ac according to my router.

osmc@OSMC-KODI:/etc/modprobe.d$ cat /proc/net/wireless
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 22
wlan0: 0000 100. -54 -69 0 0 0 0 0 0

OK, I will work on some improvements

You are right the below command triggers the problem.

connmanctl scan wifi

Any idea how to disable auto scans?

The driver can block when a scan takes place, which is why you get the slight dropout.

ConnMan sets up automatic scanning with wpa_supplicant. If the signal drops below a certain threshold, wpa_supplicant will think you are roaming away from the base station. I believe this is what causes the scan to take place. But this value is too strict; and some drivers may not always report reliable figures under certain conditions.

It’s being investigated. I will keep you updated of any improvements and they will be made available automatically as an update.

You can disable background scanning by making the following change to /etc/connman.conf.

Add the following line under [General],

BackgroundScanning = false

I have made some improvements to when wpa_supplicant will scan. This will be available in the next monthly update, but I may adjust it.

Update: BackgroundScanning=false resolved the issue.

Sam’s solution for next patch is far more elegant and would completely resolve my issue without the need to disable the scan. I have never been worse than -59 in the last 2 days and in my reading anything better than -67 is considered “streaming quality signal”, so -65 seems like the perfect trigger number.

$20 donation on the way. Thanks!

Thank you kindly :slight_smile: