merexis
Posts: 4
Joined: Sun Jun 16, 2019 11:01 am

Rpi 3B+ WiFi Intermittent Slowdown/Stall

Sun Jun 16, 2019 11:46 am

I have recently starting playing around with my new raspberry pi 3B+, trying to set it up as a media streaming box.

I'm having an issue with the built in wifi appearing to stall every minute or two, causing the currently streaming video or download to stop/stutter for a few seconds before recovering.

This issue only happens with the RPi, I have half a dozen other devices on the same wifi network that will transfer data completely fine.

I've been googling around and have not been able to find a solution to this.
I have tried disabling the 5G wifi on my router to see if it was just that frequency after reading that it may be an issue with DFS, but this showed no difference.
I've tried disabling power management to the wifi, although I've since read that power management is disabled by default and it may just be a bug that causes iwconfig to show it as enabled.

Unfortunately an ethernet connection isn't practical for me to test right now, so I don't know for sure that this isn't a more general issue with the RPi.

I'm fairly new to raspberry pi and Linux in general so any advice into how to debug this would be greatly appreciated


Current setup is:
Raspberry Pi 3B+ running latest Raspbian installed from NOOBs that came with the starter kit.
HDMI running to tv.
Bluetooth xbox one s controller connected. (required disabling ertm)
Installed xpadneo to have controller work and running QJoyPad to allow controller to emulate mouse input.
No major changes to OS behaviour other than a .desktop script to launch steamlink and a python script that checks if steamlink is running and disables QJoyPad if it is (polls every 10 seconds).

epoch1970
Posts: 3091
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Rpi 3B+ WiFi Intermittent Slowdown/Stall

Sun Jun 16, 2019 12:16 pm

If it is not wifi it could be
- the file/streaming protocol you're using to transfer data
- CPU activity spikes due to some application
- IO activity limit reached due to the transfer and/or other applications (a class 10 SD or better -U-3?- is recommended)

To confirm this is a pure networking issue, install iperf on the Pi and a host, simulate traffic to and from both, sending data read from RAM (not the SD. Do not involve the SD in the test). Try UDP and TCP. If you see a problem in this case, then it is a networking issue.

Simpler than that, have a look at the system activity on the host during a transfer.
- If the CPU/IO loads seem normal and transfer stops, focus on the transfer protocol. SMB might need tweaking according to some posts.
- If the CPU/IO loads are high, disable applications one by one to find the culprit.

Also, if wifi reception is poor and you transfer via TCP, there will be packet retransmissions. Make sure wifi reception quality is good to very good.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

merexis
Posts: 4
Joined: Sun Jun 16, 2019 11:01 am

Re: Rpi 3B+ WiFi Intermittent Slowdown/Stall

Thu Jun 20, 2019 6:44 am

Hi epoch1970, thanks for the advice.

I installed iperf on a couple of different machines and ran both TCP and UDP tests between them as you suggested.
All 3 devices are running on the same wifi network.

The two non-Pi devices have no issues or network drops when tested with each other.
However the Pi shows the same behaviour when tested with both of them as both client and host. i.e. network traffic will drop off for a couple of seconds every minute or so.

I watched the task manager on the Pi and didn't notice any CPU spikes when the drops occurred. I actually noticed the CPU load drop from around 35% to 27% as a result of it having to process less network traffic.

I don't believe network quality is the issue as the Pi is located closer to the router than either of the other machines.


Are there any known issues or 'gotchas' with the Pi's inbuilt wifi?

Andyroo
Posts: 3378
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Rpi 3B+ WiFi Intermittent Slowdown/Stall

Thu Jun 20, 2019 12:31 pm

The power supply is critical - I had issues with WiFi drop outs till I used the official supply.

Also I've found issues with IPv6 and one Zero W via a mains extender - been lots better since I disabled IPv6 - see viewtopic.php?f=91&t=243080
Need Pi spray - these things are breeding in my house...

User avatar
DougieLawson
Posts: 35381
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Rpi 3B+ WiFi Intermittent Slowdown/Stall

Thu Jun 20, 2019 1:01 pm

Andyroo wrote:
Thu Jun 20, 2019 12:31 pm
The power supply is critical - I had issues with WiFi drop outs till I used the official supply.

Also I've found issues with IPv6 and one Zero W via a mains extender - been lots better since I disabled IPv6 - see viewtopic.php?f=91&t=243080
Your experience is circumstantial and probably not the general solution to the problem.

The IP layer is one step above the hardware layer. I can't see what disabling IPv6 does for you (apart from losing a twenty year old tried and tested protocol).

Both of my 3A+ and one of my 3B+ get intermittent disconnects. That seems to have stopped on the machine I've upgraded to Buster. So I'm experimenting with upgrading another to Buster right now.
Note: Having anything remotely humorous in your signature is completely banned on this forum.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

merexis
Posts: 4
Joined: Sun Jun 16, 2019 11:01 am

Re: Rpi 3B+ WiFi Intermittent Slowdown/Stall

Sat Jun 22, 2019 6:11 am

Andyroo wrote:
Thu Jun 20, 2019 12:31 pm
The power supply is critical - I had issues with WiFi drop outs till I used the official supply.

Also I've found issues with IPv6 and one Zero W via a mains extender - been lots better since I disabled IPv6 - see https://www.raspberrypi.org/forums/view ... 1&t=243080
I'm using the power supply that came with the starter kit. Not sure if it's an official supply as it doesn't have any branding that I can make out but from what I can tell it should be the same output (5.1V, 2.5A)

For lack of any other suggestions I tried disabling IPv6 but that didn't appear to make any difference.


I've had a little time to test some things today and I've found that the slowdowns actually appear to come in almost exactly every minute.
On a whim I also tried loading up OSMC and did a quick test running the steamlink app with the network performance overlay and found that the slowdown doesn't appear to happen at all.

It looks like this might be something specific to the version of Raspbian I'm running or due to some process running in the background causing the stall.

As I originally mentioned, I thought my install was fairly vanilla with only a couple of extra programs installed to allow me to run steamlink and provide support for the xbox one s controller running over bluetooth. (note that the slowdown issue happens with or without bluetooth devices being connected)

I'm going to try reinstalling Raspbian to see if that helps but I'm not going to hold out too much hope of that working.

merexis
Posts: 4
Joined: Sun Jun 16, 2019 11:01 am

Re: Rpi 3B+ WiFi Intermittent Slowdown/Stall

Sun Jun 30, 2019 12:16 pm

In a last ditch effort I completely reinstalled a fresh version of Raspbian Stretch from the SD cards containing NOOBs that came with my Pi.

Updated the OS and installed only iperf and bmon.
Same issue as prior to the reinstall causing the wifi to hitch every minute on the minute.

As a final test I set the pi up next to my wifi router to make sure signal strength is definitely not a factor. Issue persists.
While I has the pi that close to the router I tried an wired connection and as expected the network was fine.

There must some kind of issue with the Raspbian wifi drivers which is causing the issue or they don't work correctly with my router (FRITZ!Box 7490).

Unless someone can suggest solutions I might just have to give up on using the Pi for the time being, which is disappointing but I've been trying to get it working in my spare time for over a month now :cry: .

Return to “Troubleshooting”