Synology/OpenWRT keeps buffering on 1gbps/30mbps connection

Server Version#: 1.17.0.1709
Player Version#: Chromecast WANPlex Media Server.2.log (10.0 MB)

Hello everyone!

I am a first-time poster and hoping I don’t make too many mistakes in my attempt to get help.

Recently, I have attempted to get my library to stream from an external address but the end result is always a video of constantly buffering no matter what quality I select. The upload server-side is 32 Mbps - 40 Mbps depending on the day and the client-side has an 80 Mbps to 94 Mbps download, depending on the day. The router on the server-side is running SQM Cake/Piece of Cake set to 90% my total bandwidth.

I have UPnP enabled on my OpenWRT router just to be sure plex is not being blocked. “Canyouseeme” illustrates all ports Plex usually use to be open and the same is true for Synology Router configuration tool, all ports are marked as open. Plex server shows a green checkmark next to remote access as well.

Other troubleshooting steps taken were to attempt to run Plex Server on my desktop (7700k Win10 Pro) and again all remote attempts result in endless buffering. When streaming locally, DS918+ easily handles many hardware transcoding streams and direct streams. The issue only arises when attempting to stream remotely.

If anyone has any clue what can be going on or can offer the right direction in where to look, I’d greatly appreciate it. Thank you all for your time.

Server Logs were included and remote streams start at line 27,474

Bandwidth calculations must account for the overhead of TCP/IP and PMS itself in your total upload rate.

If your upload is 100 Mbps, take that 100 and divide by 1.20 (the overhead of TCP/IP + Plex)
This leaves you with 83.3 Mbps of payload (Audio + Video) bitrate usable.

Provided your payload does not exceed that 83.3 Mbps upload, there will be no buffering beyond the initial transcoding(if any) and buffer loading and there is low latency between the server and remote client.

Thank you for your reply!

If I’m understanding you correctly, it looks as if my connection isn’t good enough to stream? I’ve attempted to try 20mbps and 8 Mbps but it does the same endless buffering.

When I download a file from my nas over wan from the location I’m attempting to stream to it downloads at 4.2 MB/s.

The back-and-forth communication of streaming is a strange animal. Each block of data has to be requested (a “transaction”). Each transaction is a Request message (with TCP/IP ACK packet being sent) and then the reply (which also send back an ACK packet to the server. The latency between the two endpoints is what gets us.

Downloading behaves differently. HTTPS downloading allows for, and is designed to, allow ACK packets from your computer to arrive well after extra packets have been sent. This is asynchronous (full duplex) operation where both running free from the other.

Plex’s video streaming sends a block and then waits for the client to acknowledge that block before sending the next. This induces a bit of latency.

Now, the biggest latency issue: ISP -> ISP latency.

One Moderator here has 1Gb down, 40 Mbps up. I have 45 Mpbs down, 2.5 up.
I cannot download a file from him at more than about 7 Mbps due to ISP-ISP communication over the backbone.

The best next step for you is to conduct a relatively simple test.

  1. Get the program iperf3.
  2. Load it on a system on each end (yours and the remote)
  3. Start one as the server (better if you do that since you are usually in the Server role)
  4. Let the remote test the pure bandwidth between you two.

To show you what you should see, please consider what I get when testing between workstation and NAS (5 Gbps link)

[chuck@lizum shared.96]$ iperf3 -c 192.168.0.21
Connecting to host 192.168.0.21, port 5201
[  5] local 192.168.0.12 port 51850 connected to 192.168.0.21 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   326 MBytes  2.73 Gbits/sec    0   3.87 MBytes       
[  5]   1.00-2.00   sec   336 MBytes  2.82 Gbits/sec    0   3.87 MBytes       
[  5]   2.00-3.00   sec   329 MBytes  2.76 Gbits/sec    0   3.87 MBytes       
[  5]   3.00-4.00   sec   320 MBytes  2.68 Gbits/sec    0   3.87 MBytes       
[  5]   4.00-5.00   sec   339 MBytes  2.84 Gbits/sec    0   3.87 MBytes       
[  5]   5.00-6.00   sec   342 MBytes  2.87 Gbits/sec    0   3.87 MBytes       
[  5]   6.00-7.00   sec   339 MBytes  2.84 Gbits/sec    0   3.87 MBytes       
[  5]   7.00-8.00   sec   342 MBytes  2.87 Gbits/sec    0   3.87 MBytes       
[  5]   8.00-9.00   sec   334 MBytes  2.80 Gbits/sec    0   3.87 MBytes       
[  5]   9.00-10.00  sec   339 MBytes  2.84 Gbits/sec    0   3.87 MBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  3.27 GBytes  2.81 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  3.27 GBytes  2.81 Gbits/sec                  receiver

iperf Done.
[chuck@lizum shared.97]$ iperf3 -c 192.168.0.21 -R
Connecting to host 192.168.0.21, port 5201
Reverse mode, remote host 192.168.0.21 is sending
[  5] local 192.168.0.12 port 51854 connected to 192.168.0.21 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   271 MBytes  2.27 Gbits/sec                  
[  5]   1.00-2.00   sec   278 MBytes  2.33 Gbits/sec                  
[  5]   2.00-3.00   sec   299 MBytes  2.50 Gbits/sec                  
[  5]   3.00-4.00   sec   289 MBytes  2.42 Gbits/sec                  
[  5]   4.00-5.00   sec   282 MBytes  2.36 Gbits/sec                  
[  5]   5.00-6.00   sec   267 MBytes  2.24 Gbits/sec                  
[  5]   6.00-7.00   sec   298 MBytes  2.50 Gbits/sec                  
[  5]   7.00-8.00   sec   304 MBytes  2.55 Gbits/sec                  
[  5]   8.00-9.00   sec   308 MBytes  2.59 Gbits/sec                  
[  5]   9.00-10.00  sec   285 MBytes  2.39 Gbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  2.82 GBytes  2.43 Gbits/sec  13380             sender
[  5]   0.00-10.00  sec  2.81 GBytes  2.42 Gbits/sec                  receiver

iperf Done.
[chuck@lizum shared.98]$ 

OK! Will do! Just bare with me a second while I get something that can run it from the remote location. My girlfriend isn’t tech savvy (the place I want to stream to) and my buddy is out of state for a couple days.

Please bare with me.

Here is the test you asked me to run. We both have the same ISP. Thanks in advance!

There you have it. Tested with and without -R, the results should be the same.

If they are, then you’re good for 20 Mbps (combined audio + video) because :

(Audio + Video) x 1.20 (tcp/IP and Plex overhead) is 24.2 Mbps which is a nice mean value given your ranges displayed.

This means you can send at most 24 Mbps upstream whether that be 1 or more players on the other end.

At 20:32:40 we can see Newuser request a 720p at the remote location taking shape:
At 20:32:44 we can see Failed to stream media, Connection reset by peer
Then the transcoder session stops, then starts, then another peer reset.
The cycle repeats till they give up. So I guess it’s the player?

A 720p video requires less than 6 Mbps.
The user has 25 Mbps of bandwidth.

Below we see the details.
Sep 22, 2019 20:32:40.194 [0x7fa1fa797700] DEBUG - Auth: authenticated user 21243433 as NewUser
Sep 22, 2019 20:32:40.194 [0x7fa1f8cea700] DEBUG - Request: [172.117.132.49:48166 (WAN)] GET /video/:/transcode/universal/decision?audioBoost=100&autoAdjustQuality=1&directPlay=0&directStream=1&directStreamAudio=1&fastSeek=1&hasMDE=1&location=wan&maxVideoBitrate=1500&mediaBufferSize=74944&mediaIndex=0&partIndex=0&path=%2Flibrary%2Fmetadata%2F4168&protocol=*&session=770d38f6d2274b03-com-plexapp-android&subtitleSize=100&videoBitrate=1500&videoQuality=60&videoResolution=3840x2160 (16 live) TLS GZIP Signed-in Token (NewUser)
Sep 22, 2019 20:32:40.195 [0x7fa1f8cea700] DEBUG - Found session GUID of 770d38f6d2274b03-com-plexapp-android in session start.

Sep 22, 2019 20:32:40.216 [0x7fa1f8cea700] DEBUG - Streaming Resource: Reducing playback quality for 1428kbps stream bitrate: video resolution to 720x406, audio channels to 2, quality to 20, disable video DS as 30925kbps is > the 1290kbps available, disable audio DS as 639kbps is > the 128kbps available
Looks good so far. Chooses hwaccel vaapi
Sep 22, 2019 20:32:40.217 [0x7fa1f8cea700] DEBUG - MDE: Selected protocol hls; container: mpegts

Sep 22, 2019 20:32:40.218 [0x7fa1f8cea700] DEBUG - Streaming Resource: Reached Decision id=4168 codes=(General=1001,Direct play not available; Conversion OK. Direct Play=3000,App cannot direct play this item. Direct play is disabled. Transcode=1001,Direct play not available; Conversion OK.) media=(id=10380 part=(id=10380 decision=transcode container=mpegts protocol=hls streams=(Video=(id=23077 decision=transcode bitrate=1290 encoder=h264_vaapi width=720 height=406) Audio=(id=23078 decision=transcode bitrate=128 encoder=aac channels=2 rate=48000))))

Sep 22, 2019 20:32:41.875 [0x7fa16d6fb700] DEBUG - TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
Sep 22, 2019 20:32:41.875 [0x7fa16d6fb700] DEBUG - Job running: EAE_ROOT='/volume2/Plex/tmp_transcoding/pms-b7695d29-abc3-4084-944c-e769a3fb8673/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/volume2/Plex/Library/Application\ Support/Plex\ Media\ Server/Codecs/ba1b905-2538-linux-x86_64/' XDG_CACHE_HOME='/volume2/Plex/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/volume2/@appstore/Plex Media Server/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/volume2/@appstore/Plex Media Server/Plex Transcoder' '-codec:0' 'h264' '-hwaccel:0' 'vaapi' '-hwaccel_fallback_threshold:0' '10' '-hwaccel_output_format:0' 'vaapi' '-codec:1' 'ac3' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/volume1/SHR Volume/Media/TV/Veep.S01E01.Fundraiser.1080p.BluRay.DD5.1.x264-SA89/pN4GMeS0h3WAhcgMhPGoN.mkv' '-filter_complex' '[0:0]hwupload[0];[0]scale_vaapi=w=720:h=406:format=nv12[1];[1]hwupload[2]' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':osr=48000[3]' '-map' '[2]' '-codec:0' 'h264_vaapi' '-b:0' '967k' '-maxrate:0' '1290k' '-bufsize:0' '2580k' '-r:0' '23.975999999999999' '-force_key_frames:0' 'expr:gte(t,0+n_forced*3)' '-map' '[3]' '-metadata:s:1' 'language=eng' '-codec:1' 'aac' '-b:1' '128k' '-segment_format' 'mpegts' '-f' 'ssegment' '-individual_header_trailer' '0' '-segment_time' '3' '-segment_start_number' '0' '-segment_copyts' '1' '-segment_time_delta' '0.0625' '-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/770d38f6d2274b03-com-plexapp-android/a6a14e33-b7d5-452b-a5d5-644301452820/seglist' '-segment_list_type' 'csv' '-segment_list_size' '2147483647' '-segment_list_separate_stream_times' '1' '-segment_list_unfinished' '1' '-max_delay' '5000000' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'media-%05d.ts' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-y' '-init_hw_device' 'vaapi=vaapi:/dev/dri/renderD128' '-hwaccel_device' 'vaapi' '-filter_hw_device' 'vaapi' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/770d38f6d2274b03-com-plexapp-android/a6a14e33-b7d5-452b-a5d5-644301452820/progress'
Here the first segment of the transcoded stream is requested
Sep 22, 2019 20:32:43.334 [0x7fa16d9e9700] DEBUG - Request: [172.117.132.49:48178 (WAN)] GET /video/:/transcode/universal/session/770d38f6d2274b03-com-plexapp-android/base/00000.ts (25 live) TLS Signed-in
Sep 22, 2019 20:32:43.334 [0x7fa16d9e9700] DEBUG - Asked for segment 0 from session.
Sep 22, 2019 20:32:43.334 [0x7fa16d9e9700] DEBUG - Returning segment 0 from session
Sep 22, 2019 20:32:43.334 [0x7fa16d9e9700] DEBUG - Content-Length of /volume2/Plex/Library/Application Support/Plex Media Server/Cache/Transcode/Sessions/plex-transcode-770d38f6d2274b03-com-plexapp-android-a6a14e33-b7d5-452b-a5d5-644301452820/media-00000.ts is 379948 (of total: 379948).

But then it dies with Failed To Stream Media
Sep 22, 2019 20:32:44.218 [0x7fa1d3d11700] DEBUG - Streaming Resource: Estimated bandwidth for 770d38f6d2274b03-com-plexapp-android to be 3343kbps over 0.88s
Sep 22, 2019 20:32:44.380 [0x7fa1fa797700] DEBUG - Failed to stream media, client probably disconnected after 98304 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:32:44.380 [0x7fa1fa797700] DEBUG - Completed after connection close: [172.117.132.49:48178] 200 GET /video/:/transcode/universal/session/770d38f6d2274b03-com-plexapp-android/base/00000.ts (25 live) TLS 1045ms 98304 bytes (pipelined: 1)
Sep 22, 2019 20:32:44.380 [0x7fa1fa797700] DEBUG - Removed transcode data consumer, active count 2 => 1
Sep 22, 2019 20:32:44.387 [0x7fa1fa4a9700] DEBUG - Failed to stream media, client probably disconnected after 98304 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:32:44.387 [0x7fa1fa4a9700] DEBUG - Completed after connection close: [172.117.132.49:48184] 200 GET /video/:/transcode/universal/session/770d38f6d2274b03-com-plexapp-android/base/00001.ts (24 live) TLS 426ms 98304 bytes (pipelined: 1)
Sep 22, 2019 20:32:44.388 [0x7fa1fa4a9700] DEBUG - Removed transcode data consumer, active count 1 => 0

And this is a list of all those reset by peer messages:
Sep 22, 2019 20:32:44.380 [0x7fa1fa797700] DEBUG - Failed to stream media, client probably disconnected after 98304 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:32:44.387 [0x7fa1fa4a9700] DEBUG - Failed to stream media, client probably disconnected after 98304 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:33:17.396 [0x7fa1fa797700] DEBUG - Failed to stream media, client probably disconnected after 675448 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:33:17.411 [0x7fa1fa797700] DEBUG - Failed to stream media, client probably disconnected after 122768 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:43:52.395 [0x7fa1fa4a9700] DEBUG - Failed to stream media, client probably disconnected after 150070 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:44:06.490 [0x7fa1fa797700] DEBUG - Failed to stream media, client probably disconnected after 81920 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:44:06.500 [0x7fa1fa4a9700] DEBUG - Failed to stream media, client probably disconnected after 81920 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:45:20.375 [0x7fa1fa4a9700] DEBUG - Failed to stream media, client probably disconnected after 61384 bytes: 104 - Connection reset by peer
Sep 22, 2019 20:55:12.154 [0x7fa1fa4a9700] DEBUG - Failed to stream media, client probably disconnected after 10881720 bytes: 104 - Connection reset by peer

Possible solutions to connection reset by peer:

Could you get us the player log in debug mode? At least we can add it to the evidence.
Can the remote user download the video like a desktop app or mobil can?

1 Like

I’m not very versatile technically, but just a note to my linked topic here:
My problem only occurs when direct playing locally (WiFi).
Transcoding to whatever makes the videos play smooth.

The log texts, assuming no other errors in between those two datapoints,

At 20:32:40 we can see Newuser request a 720p at the remote location taking shape:
At 20:32:44 we can see Failed to stream media, Connection reset by peer

Tells me that the client app closed the connection. The connection, as seen from the server’s perspective, was closed by it’s peer (the client). This is how TCP works. When either side closes a connection, the other side (it’s peer) receives a notification. Plex is reporting this in the logs. Nothing to do with the router.

Is there anything else I can produce while to give more light to the issue? I know it was suggested I provide the logs from the Chromecast but I don’t know exactly how to do that.

To all, thank you so much for all your help. I’m starting to feel guilty taking so much of your time. Maybe streaming just won’t work for me lol oh well

It’s always a pleasure.

So ChuckPA gave us the good news that you’re seeing normal network
behavior in your logs. Though it might have been covered, please describe
in detail the remote network and player chain, down to model numbers
of your hardware.

The website article on Chromecast streaming refers to limitations.
I went looking for a way to get log files but didn’t find one.

Awesome! Ok, starting from the server side to client.

Server: Synology DS918+ running Plex server 1.17.

Router: OpenWRT running latest stable build on 8th Gen core i5, 8gb of RAM. 80gb SSD.

Switch: Asus RT-AC87R in bridge mode. All routing services are off and running Merlin firmware.

ISP server: spectrum 1Gbps down and 30 Mbps up

ISP client: spectrum 100 Mbps down and 20 Mbps up. ISP provided modem/router.

Client: Chromecast running Plex Media Player in a 5ghz band.

It’s the remote end that we have yet to explore fully.

What Chromecast model?

Where is Plex Media Player on the remote end? As I understand it, PMP is an standalone app for a desktop or laptop. If you first use PMP to cast to the Chromecast from a lap/desktop, let us know. If you use an Android phone to cast to the Chromecast, tell that or explain what I’m missing. I’m just trying to understand.

You tested with iperf3 your link from server to client, but you didn’t specify the client side hardware on which you installed iperf3. I doubt it was the chromecast. So was it on a laptop that was also using that WiFi?

The goal is to isolate the bottleneck. WiFi is the most susceptible when combined with certain Chromecast. Let us know more details if you like.

OK, I understand now.

Chromecast is a second generation model (NC2-6A5) It is connected via WiFi at 325 Mbps Tx Rate and 433 Rx Rate.

There is a Chromecast App on phone that casts to TV Screen. Looking at network activity, it looks as if the Chrome cast connects directly to server and phone is just used to make selections (Network Activity via Andriod OS). I can’t verify this but it would make sense as the phone get’s extremely warm when casting what is on screen to TV and battery depletes extremely fast.

The iPerf3 test was done via my own laptop via WiFi in the same room the TV is in. I did not capture the link rate though…

Ok that’s good news. You might need a Chromecast Ultra though, based on the limitations mentioned by plex versus https://developers.google.com/cast/docs/media versus what you’re trying to send it. Because you’re not using an Ultra, there’s room for improvement to isolate the variables at your leisure.

Not that the link isn’t fast or that you can’t adjust the media to fit your v2.
Just thinking aloud.

If I may make a suggestion / offer a consideration?

  1. ISP modem/routers are configured for a very fixed and limited purpose.
  2. You have a much more capable modem/router capability in your DD-WRT computer (this is the same as having pfSense except you’re not running pfSense)
  3. You have the good tool in bridge mode and the weak tool doing the work.

Suggestion: (UNLESS required for VoIP / other services)

  1. ISP equipment as MODEM-only (it can do that easily)
  2. Transfer the authentication / signin PPPoE or what3ever to DD-WRT DEDICATED computer
  3. As direct consequence:
    a. one level of NAT has been removed
    b. Routing / processing and firewall now in a device much more capable

Required Wiring:

  1. One direct line from modem to DD-WRT computer input . No other devices on Modem
  2. One direct line out from DD-WRT computer (add ethernet USB dongle if required) to switch
  3. All other devices connect to switch.

Result:

  1. LAN is flat
  2. One layer of NAT occurs (within the computer itself) as modem is just a modem (media converter)

ISP -> <modem> -> DD-WRT computer -> <switch> -> All LAN devices.

Hey Chuck,

Yes, that is how I have my network set up. I have a modem only connected to openwrt. Openwrt feeds my Asus router working as a AP for wireless.

The map I gave earlier was the client side of the equation.

If this ASUS is nothing more than a wireless AP, please so state.
Saying “router” without stating clearly conveys it’s not creating another subnet which isn’t correct because routers, by default, do create a subnet even in bridge mode if you’re not careful.

Ok?

With this topology in place, From wired LAN, through WRT and out modem is the problem or does the problem exist through the wireless point on the LAN ?

Hey Chuck, thanks for the reply again. However, I feel like we are going in circles lol

Yes, I did state that the Asus router was in AP mode with all routing services turned off. I made the declaration of calling it router because it was on the name of the model number. I was asked to provide model numbers by someone helping me earlier.

Also, I stated that it only happens in external streams. All my smart TVs and devices steam reliably on my LAN. I can do like 12 devices. Problem only occurs over wan.

I think it’s just not meant to be lol