Constant Buffering Even At Low Bandwidth

Server Version#: Version 1.20.3.3421
Player Version#: Version 4.44.1
Tuner Make/Model: HDHomeRun CONNECT QUATRO
Guide/Lineup name: All
Using XMLTV?: No

My Plex TV remote viewing functionality is essentially unusable at speeds over 2 Mbps: any show, whether live or recorded, plays intermittently and either buffers every few minutes or cuts out entirely at even 4 Mbps.

My server has good internet (avg 400 Mbps down and 20 Mbps up) and is on a capable Ubuntu machine (see bottom of post for inxi -F results). My player location has bad internet (avg 6 Mbps down and 1 Mbps up). The issue is Player agnostic, as it occurs on all of the following: FireTV, Samsung TV, Xbox, Android, and Chrome browser. Also, it has occurred across upgrades of the Plex server over the past 6 months.

For the last six months, I thought the constant buffering/cutting out was because my Player’s remote access location had slow internet. But I just tried it with a better network (avg of 20 Mbps down) and encountered the same problems at any speed over 2 Mbps – and sometimes even then.

I have fiddled with the transcoding settings, but at either end of the spectrum I get the exact same results. I keep hoping that I just have some setting wrong, but that hope is fading

I am happy to attach logs, as this is easy to reproduce; it happens every time I try to view remotely. Please help; I purchased the lifetime subscription, so I am essentially committed to Plex.

System:    Host: hp-plex-ubuntu Kernel: 5.3.0-64-generic x86_64 bits: 64 
           Desktop: Gnome 3.34.3 Distro: Ubuntu 19.10 (Eoan Ermine) 
Machine:   Type: Desktop System: Hewlett-Packard product: HP ProDesk 600 G1 SFF v: N/A 
           serial: <root required> 
           Mobo: Hewlett-Packard model: 18E7 serial: <root required> UEFI: Hewlett-Packard 
           v: L01 v02.21 date: 12/17/2013 
CPU:       Topology: Quad Core model: Intel Core i5-4570 bits: 64 type: MCP 
           L2 cache: 6144 KiB 
           Speed: 898 MHz min/max: 800/3600 MHz Core speeds (MHz): 1: 898 2: 898 3: 898 
           4: 899 
Graphics:  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics 
           driver: i915 v: kernel 
           Display: server: X.Org 1.20.9 driver: i915 resolution: 1920x1080~60Hz 
           OpenGL: renderer: llvmpipe (LLVM 9.0 256 bits) v: 3.3 Mesa 19.2.8 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio 
           driver: snd_hda_intel 
           Device-2: Intel 8 Series/C220 Series High Definition Audio 
           driver: snd_hda_intel 
           Sound Server: ALSA v: k5.3.0-64-generic 
Network:   Device-1: Intel Ethernet I217-LM driver: e1000e 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: a0:48:1c:a1:5c:a4 
           Device-2: Edimax EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] 
           type: USB driver: rtl8192cu 
           IF: wlx801f02f51af0 state: down mac: 80:1f:02:f5:1a:f0 
Drives:    Local Storage: total: 1.48 TiB used: 131.54 GiB (8.7%) 
           ID-1: /dev/sda vendor: SanDisk model: SD6SB1M-128G-1006 size: 119.24 GiB 
           ID-2: /dev/sdb vendor: Western Digital model: WD15EADS-00P8B0 size: 1.36 TiB 
Partition: ID-1: / size: 116.22 GiB used: 12.60 GiB (10.8%) fs: ext4 dev: /dev/sda3 
           ID-2: /boot size: 453.9 MiB used: 294.8 MiB (65.0%) fs: ext4 dev: /dev/sda2 
Sensors:   System Temperatures: cpu: 36.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 180 Uptime: 20h 20m Memory: 7.69 GiB used: 960.6 MiB (12.2%) 
           Shell: bash inxi: 3.0.36

Here is a picture of the bandwidth usage and the CPU usage. It appears to show a roller-coaster of bandwidth going up and down. Maybe that is part of the issue? CPU looks good.

Do you have any computational capability at that remote location?

If so, there is a definitive test of the point-to-point available bandwidth.

  1. your machine installs and runs iperf3 -s (server mode)
  2. The remote machine installs iperf3 and runs iperf3 -c ip.addr.of.host followed by iperf3 -c ip.addr.of.host -R. This checks both directions.

The most important thing you’re checking here are all the points between the two.
If any one is bad, it will show here.

As prime example, One of the Plex Ninjas has 1G down/40m up. I have 40M down/ 2M up. You would expect I can get near 20 Mbps from him. I can’t. The absolute best I can sustain is 6 Mbps due to all the peering points between us and the inherent latency added by every hop.

Installing now. But…dare I ask… what is a Plex Ninja? I have a feeling this is a rabbit hole.

Ninjas are the other moderators you see here in the forum.
It’s Plex’s term for those who have a greater understanding of how the internals work and volunteer their time to help others.

The “rabbit hole” is when one believes that ample upload/download on both ends is a 100% guarantee of connectivity speed between the two endpoints.

It sounds great on paper but almost NEVER happens.

Here are the results while running a VPN on the client (so max is around 20 Mbps down). It seems I should be able to watch Plex at 4 Mbps, or is that incorrect?

Starting Test: protocol: TCP, 1 streams, 131072 byte blocks, omitting 0 seconds, 10 second test, tos 0
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   511 KBytes  4.19 Mbits/sec    0    139 KBytes       
[  5]   1.00-2.00   sec  1.91 MBytes  16.0 Mbits/sec   57    407 KBytes       
[  5]   2.00-3.00   sec   819 KBytes  6.70 Mbits/sec   28    384 KBytes       
[  5]   3.00-4.00   sec  1.23 MBytes  10.3 Mbits/sec    0    434 KBytes       
[  5]   4.00-5.00   sec  1.11 MBytes  9.29 Mbits/sec   13    314 KBytes       
[  5]   5.00-6.00   sec  1.23 MBytes  10.3 Mbits/sec    0    341 KBytes       
[  5]   6.00-7.00   sec  1.23 MBytes  10.3 Mbits/sec    0    359 KBytes       
[  5]   7.00-8.00   sec   630 KBytes  5.16 Mbits/sec    0    368 KBytes       
[  5]   8.00-9.00   sec  1.23 MBytes  10.3 Mbits/sec    0    370 KBytes       
[  5]   9.00-10.00  sec  1.23 MBytes  10.3 Mbits/sec    0    370 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
Test Complete. Summary Results:
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  11.1 MBytes  9.29 Mbits/sec   98             sender
[  5]   0.00-10.48  sec  10.2 MBytes  8.13 Mbits/sec                  receiver
CPU Utilization: local/sender 4.1% (1.3%u/2.8%s), remote/receiver 4.0% (0.7%u/3.3%s)
snd_tcp_congestion cubic
rcv_tcp_congestion cubic

Thank you.

Network base looks good,

Would you mind doing the following?

  1. Verify DEBUG logging is enabled and VERBOSE logging is disabled.
  2. Recreate the playback buffering (only one minute worth)
  3. Stop playback
  4. Wait 20 seconds for the logs to flush to disk
  5. Download the logs ZIP file
  6. Attach it here.

Thanks @ChuckPa. Here are the logs. Plex Media Server Logs_2020-10-12_18-52-37.zip (3.3 MB)

@Mr_Roark

  1. I see the bandwidth limit for the streaming set to 8 Mbps by client.
  2. The needed amount is 8669 (includes audio, plex protocol, and TCP/IP overhead)
  3. It sends, Transcoder goes to sleep waiting to be woken up, then wakes up again until stopped.
  4. The perf you show above shows that 8 Mbps is pushing the available a bit. It’s not 4 Mbps as you thought.
  5. You also have a fair number of retries meaning the link is not 100% stable but should be OK at the lower 4Mbps as you suggested.
Oct 12, 2020 16:07:50.043 [0x7feadaffd700] DEBUG - [Transcode] Streaming Resource: Calculated bandwidth of 8669kbps exceeds bandwidth limit. Changing decision parameters provided by client to fit bandwidth limit of 8000kbps
Oct 12, 2020 16:07:50.043 [0x7feadaffd700] DEBUG - [Transcode] Streaming Resource: Determining preferred transcode encoders through transcode only decis

I’ve also spotted something, not super important, you can do to help your config.
It will make startup cleaner

Oct 12, 2020 16:07:50.038 [0x7feadaffd700] DEBUG - [Transcode] Codecs: testing h264 (decoder) with hwdevice vaapi
Oct 12, 2020 16:07:50.038 [0x7feadaffd700] DEBUG - [Transcode] Codecs: hardware transcoding: testing API vaapi
Oct 12, 2020 16:07:50.039 [0x7feadaffd700] ERROR - [Transcode] [FFMPEG] - libva: /usr/lib/plexmediaserver/lib/dri/iHD_drv_video.so init failed
Oct 12, 2020 16:07:50.039 [0x7feadaffd700] DEBUG - [Transcode] [FFMPEG] - Format 0x32315659 -> yuv420p.
Oct 12, 2020 16:07:50.039 [0x7feadaffd700] DEBUG - [Transcode] [FFMPEG] - Format 0x30323449 -> yuv420p.

To implement,

  1. Stop Plex
  2. Add VaapiDriver="i965" to Preferences.xml right before the closing />
  3. Start Plex

Your CPU (-4xxx) doesn’t have iHD capability so there’s no reason to probe for it every time.

@ChuckPa – thank you so much for looking closely at this. I really appreciate it. And really appreciate the Vaapi suggestion. Will implement that asap.

Regarding the streaming bandwidth limit, can you see a reason why I can’t get even 4 Mbps at the remote (client) location? Or if I should change a setting to do so?

Regarding the vaapi addition to Preferences.xml, I stopped Plex using systemctl, then edited the file, then restarted, but it deletes the addition each time. Is there a different way I should be doing it?

Where did you add it?

It should look like this: (with PMS already stopped)

SomeOtherPref="value" VaapiDriver="i965" />

Should you be able to stream? Yes.
Look at the retries in that 10 second test window. 98 retries?

Every retry means PMS will have to resend the whole block.
If that repeat doesn’t get there in time, without error, it’s going to buffer.

When there’s this much packet loss, there is a physical connectivity issue.
I almost only see this when WiFi is involved or when a cable / connector is about to fall apart.

Given how many use WiFi, even for their servers , I’m more apt to think WiFi congestion is the cause. (Remember, only 1 device can transmit at a time on WiFi)

Cable internet has the same problem. It’s also RF (Radio Frequency) and subject to anyone else on your loop hogging it / collisions if you both try to transmit at the same time.

Any of this plausible / possible ?

1 Like

I’m not using WiFi for the server, but I am for the client. That said, the server is cable internet, so that may be a problem.

I was able to get it to stick, but now I can’t access Plex via a client (I can still access the machine using SSH, and it reports that plexmediaserver is running). I tried rebooting, to no avail.

plexmediaserver.service - Plex Media Server
   Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2020-10-13 12:06:52 PDT; 11min ago
  Process: 1405 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PL
 Main PID: 1414 (Plex Media Serv)
    Tasks: 66 (limit: 4915)
   Memory: 237.7M
   CGroup: /system.slice/plexmediaserver.service
           ├─1414 /usr/lib/plexmediaserver/Plex Media Server
           ├─1513 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-54b6523bd/Framework.bundle/Con
           ├─1589 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexme
           ├─1619 Plex Plug-in [com.plexapp.plugins.WebTools] /usr/lib/plexmediaserver/Resources/Plug-ins-54b6523bd/Framework.
           └─1660 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-54b6523bd/Framework.bundl

Oct 13 12:06:52 hp-plex-ubuntu systemd[1]: Starting Plex Media Server...
Oct 13 12:06:52 hp-plex-ubuntu systemd[1]: Started Plex Media Server.

Here is how the Preferences.xml file looks now:
<Preferences .... MetricsEpoch="1" VaapiDriver="i965" />

You can test the server locally.
Make sure it’s good locally first then diagnose the client.

I’m testing it via SSH and systemctl to confirm it is running. I can’t test it any other way locally because I am remote to the server, and I am having issues getting a browser to open using X11. Any idea why it would stop working after editing the Preferences.xml file – despite plexmediaserver.service running? Is there a way via the CLi to reset the preferences?

You can’t test anything via SSH . You need the GUI to initiate playback.
Without the GUI / browser, you would have to completely emulate Plex/web . That’s a very complete task given it’s all JSON.

Are your X11 issues with Wayland or Xorg?

Xorg. Firefox, Chromium, and Brave don’t like my SSH setup. I have it starting in Vivaldi. Will report back.

It looks like it is going through the entire setup again. Aaargh.

show me.

It will walk through the Wizard if too much is missing from Preferences.xml

ALL the media and sections will still be there, so skip over that part and through to the dashboard.