How to troubleshoot streaming on 4th generation Apple TV and Plex app?

I’m having a problem with streaming video pausing and then failing just before the end of anything I’m watching. I’m not clear how to troubleshoot this one and need some help. To illustrate the problem imagine you are watching a TV show that is 45 minutes long. At 37 minutes a white spinning ring appears on the Plex app and the video pauses. A few seconds later the video resumes. Repeat. The only option to recover at this point is to run through Apple’s restart option for the TV. After the reboot playback resumes and all is well.

The first couple of times I thought it was a fluke, but it’s happening consistently across any video type, at various times during the day. And consistently it’s only happening when there is less than 15 minutes left of whatever show I’m watching. What’s the magic behind this only happening with 15 minutes or less? Where should I start troubleshooting? The Apple TV? The Plex App? The network?

Technical notes:

The behavior does not happen watching videos on the Apple TV using the the Apple Video App. It doesn’t happen when using the Plex app on a Mac laptop in her house. Hulu on the Apple TV doesn’t have this problem, nor does Netflix, suggesting to me that it’s something with the Plex app. But what could it be?

The Plex Server is running at my house behind a Comcast business class internet connection with guaranteed upload speeds of 35Mbps. Plex server is running on a Mac mini with 16GB of RAM, quad-core Intel i7 CPU with videos being stored on a Drobo 5D connected to the server via Thunderbolt. The 4th gen Apple TV (64GB) running the Plex app is at my girlfriends house. She averages around 100Mbps download speeds on her Comcast connection. I assumed it was Wifi so I disabled the Comcast Wifi and installed a new Apple Airport Extreme and made sure no other wifi networks are sharing the same wireless channel. Signal strength from the Apple TV to the Airport Extreme is constant at 87% or higher. Not perfect but it’s not possible to get them any closer together.

The Plex app was originally configured to use Unlimited for Remote Bandwidth. I keep scaling this down to see if that will eliminate the problem. I’m down to 3mbps at 720 quality and the behavior continues.

What does the pms logs say when this happens?
What type of media files are you trying to play?
Have you tried various bitrates and codecs to see if that makes a difference? (use the provided optimizer feature)
Could you borrow her AppleTV for a sec and place it locally in your home for test purpose purely?
Could also for test purpose connect it at her house with a network cable instead of wifi o truly rule that one out?

Peter, is there something in the PMS logs I should be looking for? it’s all greek to me. :frowning:

Media files - they are are mix of MP4 and MKV files.

I do have the same Apple TV at my house. It’s connected via Wifi also via Airport Extreme and it does not experience the issue which makes the think it’s related to the caching process associated with having less bandwidth available when the content is being viewed remotely.

While I agree it would be nice to switch to a network cable and just rule out wifi, I can’t get a network cable to the apple TV in her place so that isn’t an option.

Without posting the entire PMS log, here’s a chunk from the timeframe when the error occurred last night:

Dec 15, 2015 02:02:03 [0x70000019a000] ? - [Transcoder]
Dec 15, 2015 02:02:03 [0x70000019a000] ? - [Transcoder]
Dec 15, 2015 02:02:03 [0x700000117000] ERROR - Expected 3 images, but found 7
Dec 15, 2015 02:02:23 [0x70000019a000] ? - [Transcoder]
Dec 15, 2015 02:02:23 [0x70000019a000] ? - [Transcoder]
Dec 15, 2015 02:02:23 [0x700000117000] ERROR - Expected 2 images, but found 6

followed by a few of these:

Dec 15, 2015 02:22:24 [0x700000117000] ERROR - Expected 1 images, but found 4
Dec 15, 2015 04:30:28 [0x7000005b2000] ERROR - EventSource: Retrying in 15 seconds.
Dec 15, 2015 04:31:03 [0x7000005b2000] ERROR - EventSource: Retrying in 30 seconds.
Dec 15, 2015 04:31:53 [0x7000005b2000] ERROR - EventSource: Retrying in 60 seconds.
Dec 15, 2015 10:06:46 [0x700000081000] WARN - Sync: local sync directory /Users/bryangarmon/Library/Caches/PlexMediaServer/Transcode/Sync does not exist
Dec 15, 2015 10:06:46 [0x700000081000] WARN - Sync: local sync directory /Users/bryangarmon/Library/Caches/PlexMediaServer/Transcode/Sync does not exist
Dec 15, 2015 20:34:30 [0x700000117000] WARN - Unable to load episode file [seasons/2/episodes/20.xml]
Dec 15, 2015 20:34:42 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:34:43 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:34:44 [0x7000005b2000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:49:43 [0x7000005b2000] ERROR - CERT: Error in TLS handshake: Connection reset by peer
Dec 15, 2015 20:49:46 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:49:49 [0x7000005b2000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:49:50 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:49:57 [0x7000005b2000] ERROR - CERT: Error in TLS handshake: Connection reset by peer
Dec 15, 2015 20:49:59 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:50:17 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:50:40 [0x700000081000] ERROR - Couldn’t get remote endpoint: remote_endpoint: Invalid argument
Dec 15, 2015 20:50:40 [0x700000081000] ERROR - Caught exception trying to stream file: /Volumes/Drobo/Data/Videos/TV Shows/The Blacklist - S02e20.mp4
Dec 15, 2015 20:50:41 [0x7000005b2000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 20:50:43 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe

Dec 15, 2015 21:18:58 [0x7000002a0000] ? - [Transcoder]
Dec 15, 2015 21:18:59 [0x700000117000] ? - [Transcoder]
Dec 15, 2015 21:20:11 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 21:21:38 [0x700000bd6000] WARN - Unable to load episode file [seasons/2/episodes/21.xml]
Dec 15, 2015 21:23:13 [0x7000005b2000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 21:25:21 [0x70000052f000] ERROR - Error writing media: 32 - Broken pipe
Dec 15, 2015 21:25:47 [0x700000081000] ? - [Transcoder]
Dec 15, 2015 21:25:47 [0x7000002a0000] ? - [Transcoder]
Dec 15, 2015 21:28:35 [0x700000bd6000] WARN - Transcode runner appears to have died.
Dec 15, 2015 22:06:47 [0x700000cdc000] WARN - Sync: local sync directory /Users/bryangarmon/Library/Caches/PlexMediaServer/Transcode/Sync does not exist
Dec 15, 2015 22:06:47 [0x700000cdc000] WARN - Sync: local sync directory /Users/bryangarmon/Library/Caches/PlexMediaServer/Transcode/Sync does not exist
Dec 15, 2015 22:06:49 [0x700000cdc000] INFO - Sync: downloaded and examined 0 sync list(s) with 0 sync items(s)
Dec 15, 2015 22:59:17 [0x7000005b2000] ERROR - EventSource: Retrying in 15 seconds.
Dec 15, 2015 23:13:39 [0x7fff7c509000] INFO - Library section 3 (TV Shows) will be updated because of a change in /Volumes/Drobo/Data/Videos/TV Shows/
Dec 15, 2015 23:13:50 [0x7fff7c509000] INFO - Library section 3 (TV Shows) will be updated because of a change in /Volumes/Drobo/Data/Videos/TV Shows/
Dec 15, 2015 23:15:27 [0x700000117000] ? - [Transcoder]
Dec 15, 2015 23:15:27 [0x700000081000] ? - [Transcoder]

That doesn’t look good. I’ve seen other threads with that error code - such as this https://forums.plex.tv/discussion/140342/error-error-writing-media-32-broken-pipe - but I can’t remember seeing an actual solution to it I hope a Ninja will have a look at it and this thread, I believe this is beyond my ability.

With that said, we can still have the ball running to make it easier for the ninjas when they have the time to look this over. Do you get the same type of log entries/crashing if trying to play on another device connected to the same wifi? Such as a mobile phone. It might be good if we could really pinpoint it to the actual client of iOS and truly rule out the network as such. Since it doesn’t seem to stem from the media as you’ve described it happening to various codecs.

edit: A good idea to further aid the ninjas is to zip all of the logs in PMS an attach here (don’t paste all of them, attach as file), perhaps even go as far as trying to get the actual iOS logs on the AppleTV device - https://support.plex.tv/hc/en-us/articles/212639598-Apple-TV-Logs

Since experiencing this problem, I replaced the Mac Mini with a new 4 Ghz Quad Core iMac with 32GB of RAM, a new tvOS update came out from Apple, and Plex made it to version 1.0. Whatever was the culprit for this issue, I haven’t seen it since.