Stadia lags on a Macbook. Debug and search for the cause

Posted by Pavel on Saturday, May 23, 2020

Introduction

Only recently, I signed up for Stadia as finally, I didn’t need to buy a joystick and Chromecast, which I don’t need, since I wanted to play on a Macbook with a mouse. Starting to play on my Macbook Pro 2019, I began to notice that sometimes the game slows down and latency is high although my Internet speed is high. So, I decided to find the reason.

Find a problem

Since latencies were not always there, but met at some time intervals, I decided that it works like a cache or bad servers of Google Stadia, so I wrote a program that monitors the server response time from Stadia and from my router, expecting to see that Stadia will slow down

How surprised I was when I saw a high response time from my router precisely every 5 minutes.

every-5-min-high-latency

I decided that the problem was in my router, went into the settings of the router, tried different channels, turned off and on 5GHz, monitored the load of the router, and did not see anything bad. Then I started to think, maybe there is a problem in my laptop?

I tried to run my program from another laptop (again Macbook Pro 2019) and got a perfectly smooth graph… What would that mean?

I decided to diagnose my Wi-Fi, for this I need to click on the Wi-Fi icon holding the Options button and select Enable Wi-Fi Logging:

enable-wi-fi-logging

After that you should run in your terminal:

tail -f /var/log/wifi.log

Opening the logs, I saw many messages from airportd about scanning Wi-Fi every 5 minutes. And this scan coincided in time with the peaks in my graph!

How to fix it?

To determine the location of the Macbook uses a Wi-Fi network scan, knowing which networks around you, he knows your location. To do this, the Macbook once in 5 minutes scans all networks around you, including networks with a different channel, which causes temporary Wi-Fi switching to this channel and then a long response time. Therefore, features like Find my Mac or other programs using location affect your ping in Stadia.

To fix this, go to System Preferences -> Security & Privacy -> Privacy tab -> Location Services

disable-location-services-masos

And turn off services completely

After that, I once again launched my program and got a perfectly smooth graph without any peaks!

router-ping-good

(the maximum ping on this chart was 30, although before that the maximum was about 170)

I relaunched Google Stadia and played for a long time, and during all this time, I did not have a single lag So, the problem was solved!

How to run my program to debug your Wi-Fi and Google Stadia

First, you need to download my application:

https://github.com/pcherednichenko/pingg/releases/tag/1.0

(Or you can run it from source code)

Then write in your command line (with your router IP)

./pingg -routerIP=192.168.0.1

Then press ctrl + c and a graph with your ping will open in your browser


comments powered by Disqus