Enhanced Video Player on Apple TV 4K creating buffering issues

After stumbling upon this buffering issue myself on an iPhone after a recent in-place upgrade from Server 2016 to 2019, I did some digging. Looking at a packet capture in Wireshark of a buffering stream, I noticed frequent TCP Retransmissions during that time and the RTO was 20ms.
After some research, I came across the Get-NetTCPSetting PowerShell command and found a very familiar number there. (Hint: It’s 20)

PS C:\WINDOWS\system32> Get-NetTCPSetting | ft -AutoSize

SettingName      CongestionProvider MinRto(ms) InitialRto(ms) CwndRestart DelayedAckTimeout DelayedAckFrequency AutoTuningLevelEffective
-----------      ------------------ ---------- -------------- ----------- ----------------- ------------------- ------------------------
Automatic
InternetCustom   CUBIC                     300           3000 False                      40                   2 Local
DatacenterCustom CUBIC                      20           3000 False                      10                   2 Local
Compat           NewReno                   300           3000 False                     200                   2 Local
Datacenter       CUBIC                      20           3000 False                      10                   2 Local
Internet         CUBIC                     300           3000 False                      40                   2 Local

From what I understand, by default, Windows classifies TCP connections automatically based on the initial RTT of the TCP handshake. You can read more about this at https://techcommunity.microsoft.com/t5/networking-blog/tcp-templates-for-windows-server-2019-8211-how-to-tune-your/ba-p/339795. For an iPhone and server on the same LAN, connections will typically follow the Datacenter setting. You can see this with the below command, substituting your Plex server port and client IP:

PS C:\WINDOWS\system32> Get-NetTCPConnection -LocalPort 32400 -RemoteAddress 192.168.0.150

LocalAddress                        LocalPort RemoteAddress                       RemotePort State       AppliedSetting OwningProcess
------------                        --------- -------------                       ---------- -----       -------------- -------------
192.168.0.149                       32400     192.168.0.150                       59518      Established Datacenter     6140
192.168.0.149                       32400     192.168.0.150                       50007      Established Datacenter     6140
192.168.0.149                       32400     192.168.0.150                       49926      Established Datacenter     6140

Now that familiar number of 20 appears under the Datacenter config as MinRto which is the minimum Retransmission timeout. So I tried increasing it to the max value of 300 using:

PS C:\WINDOWS\system32> Set-NetTCPSetting -SettingName "DatacenterCustom" -MinRtoMs 300
PS C:\WINDOWS\system32> Set-NetTCPSetting -SettingName "Datacenter" -MinRtoMs 300

After making this change and restarting my Plex client app on the iPhone, I no longer came across buffering nor TCP retransmissions after a few minutes of playback. Perhaps there are other parameters that can be tweaked, but this seems like a simple fix. Let me know how it goes for you.

PS, if you want to fully reset your TCP settings, you can run netsh int tcp reset.

9 Likes