Plex 4K HDR Stuttering on AppleTV is Thermal Throttling

Plex Stutters when playing 4K HDR files via Direct Play on AppleTV. On all three revisions of the AppleTV 4K. Even with gigabit ethernet connection. It’s intermittent, hard for Plex to reproduce. Often the first 20min or so of a file will work fine, but then it starts to drop frames.

:fire: The cause is thermal throttling from excessive CPU load. :fire:

Which actually explains all the weirdness we’re seeing.

We’ve been facing this issue for years. I’ve read so many threads, here and on reddit. Some people post settings changes that work for them, which don’t work for others, or don’t work for long.

There’s 50 more of these threads on these board and elsewhere.

When some people use the old audio player, or the old video player, it’ll work. Some people (@atamido) turn on Auto Adjust Quality and/or enable Allow Direct Play.

For some this works, for others it doesn’t. :thinking:

It’s because the old players, the old/reduced settings use slightly less CPU. Generate slightly less heat. Updated versions (8.13 vs 8.12) are doing a bit more, pushing the thermal envelope just enough.

And of course every one of our rooms is a different temp. Every one of our AppleTVs is sitting on a different surface enclosed/open, next to different heat-generating devices.

tvOS 17 is being reported as making it worse. iOS 17 just released an overheating fix for 17.0.2, maybe that will help if it comes to tvOS. It’s been a problem long before tvOS 17 though. But that would make sense if it used more CPU, made the underlying overheating issue worse.

@DaveBinM and @chrisallen, This is why you’re having such a hard time reproducing.

Very first thing you should do is measure CPU use, and ideally thermal state in the Debug screen so we can all see what’s happening when frames are dropping.

You can access thermal state in Swift via ProcessInfo.processInfo.thermalState. Here’s a singleton example that will subscribe live to changes.

I’ll bet a year’s Plex Pass that this will make reproducing and debugging these issues 10x easier for all of us.

The next thing you should do is build a process to identify when the player starts melting the cpu after making a change.

Probably a good idea is to have a mode during internal testing that throws up a red border or something any time the thermal state or cpu gets too high. If it’s up too long, you’ve got a problem. Not a bad idea to do a bit of thermal stress testing (put it in a wood box, maybe) to eliminate things like testing it in a cool office on a good conducting desk or whatever.

Anyway, your call on that. I can help with ideas, I do this sort of thing for a living.

Here’s my testing which found that it was thermal throttling…

Recently my 4K HDR videos have begun stuttering 20-30min into the movie. I’m only ever using Direct Play from the server via gigabit ethernet connection. Playback becomes unusable. (These are files that previously played fine.)

It started on a scene with tons of complexity and fast-motion, but even if I rewound 10min it would be happening on scenes that had just played fine moments before.

Debug overlay shows file streaming buffer never drops below 50 seconds. It ain’t a network issue. (Which so many before have confirmed.)

This of course is 100% consistent with thermal load issues. Maybe iOS 17 became more sensitive to thermal state, maybe there’s higher background CPU load, maybe recent changes with Plex have caused higher CPU load. Maybe the weather’s colder and my heat is on in the room instead of A/C. :man_shrugging:

Read on for more detail…

I turned debug on and tried all the ‘solutions’ in the threads above and elsewhere to see if I could get the Dropped Frames to zero. Nothing worked. Though some did help. The number of dropped frames would grow more slowly, especially on less complex scenes. But they’d continue to grow and grow.

Key thing I noticed: (This is important for reproducing the issue.) When I’d pause, read some solutions, or even go out to the menu and go back in (only 20 seconds or so), the stuttering and frame drops would go away for a while. Only when I played long enough, on complex enough scenes would the stuttering come back. And it would be back on the scenes before that I’d just played through.

Therefore, when testing, you MUST let these files play long enough. Complex enough. The AppleTV is fanless, but still pretty impressive at shedding heat. It has to hit the throttling heat threshold and then be pushed to stay there, otherwise it will quickly cool down.

So everything failed to eliminate frame drops, but after noticing this behaviour, I suspected it was SUSTAINED COMPLEXITY that was causing my issues to recur. That made me think of the heat. (For my particular room temp and low-heat-conducting wood surface it was sitting on.)

So I walked over and felt my AppleTV. It was BLISTERING HOT. :fire:

==Thermal Throttling Test==

Same video, same everything, except I turned all the settings back to their default (worst) state. I played the movie for a short while on some complex scenes until frames started dropping and bad stuttering was back.

Next I turned the AppleTV on its side (for maximum airflow across its surfaces) and pointed a fan at it.

Frame Drops have been COMPLETELY eliminated. Stuttering gone.

It took a minute or two, but framedrops were already slowing almost immediately (makes sense from the early hints above about the sustained complexity causing the issue). Within a couple minutes, the surface of the AppleTV was much, much cooler, and try as I might I cannot cause framedrops.

I kept looping through an especially complex scene (which is what I’d have to do for 2-3min to get the frame drops and stuttering back after pausing). I looped back through it for about 10min before getting bored. Zero frames dropped.

The movie’s been playing for about 2.5h now and the debug screen still shows (the cumulative stat over all that time):

Frames dropped: 0

Fam, this is the solution for me. The almost literal smoking gun.

Plex folks, please give us this info in the debug screen. :folded_hands: And see if you can’t do something about optimizing the player. I’m sure once you get a test process together for thermal throttling, these problems will go away. After all… other apps can play all these same files from the Plex server without issue. :thinking:

I’m running a test without the fan now (AppleTV still on its side). Will update with results. But surely I’ll be able to find some solution for passive cooling. :crossed_fingers:

Update: With the fan off (still on its side) I restarted the movie and it’s dropping frames again within the first 12min. :disappointed_face: Turn the fan back on and witin 3-4min the frames stop dropping. Maybe I can find some sort of heat-sink I can set it on? I don’t really want to slather my AppleTV with thermal paste.

Update 2: I just ordered two 80mm x 80mm heat sinks and some thermal tape from amazon for very cheap. I’ll stick one to the top and bottom and hopefully that will help! Will report back in a few days.

Update 3: My pair of $14 80x80mm heatsinks arrived! (From amazon.ca, with a bit of thermal tape)

Running the same test as originally, same file, same Plex app and tvOS version, etc. AppleTV is on its side, cabinet is closed up, no fan.

So far it’s been running 48min and still cumulative 0 frames dropped! :+1:

I’ll put it through a few more paces tonight and see if I can stress it out, but I mean, this is a great workaround while we wait hopefully for a fix.

I’m sure I can optimize it a slight bit further by putting the vanes vertical and even raising the side off the wood. I heard a few people suggesting running the cables pointing up, so that’s why I oriented the vanes that way.

So far no need though. I really do think this will probably vent heat faster than my USB fan over the smooth plastic case anyway.

My little Hellraiser AppleTV is probably well into the overkill territory already!

Too bad its closed away, I’m kinda in love with the look! :star_struck:

Update 4: Rats. Started dropping frames and stuttering again after about 70min. :pensive_face: Major progress, but not quite there. Hopefully there’s a Plex app or tvOS 17 fix that might ever so slightly reduce the CPU load and thermal generation.

Also trying another test with the heatsink fins oriented vertically which *theoretically* could improve dissipation by as much as 25%. Which may be enough for this file to play all the way through.

9 Likes

The question is why it’s causing excessive CPU load? Why for example Infuse doesn’t do that no matter what file you throw at it, even on latest versions of tvOS, iOS, iPadOS? This issue happens on literally every OS, iOS, iPadOS, tvOS, as you said, and if you ask me this kind of issue should be priority highest. They released an update yesterday, but no fix yet.

2 Likes

Very good question.

I think Plex might prioritize the issue higher once it’s clear what’s going on. Especially if they add ProcessInfo.processInfo.thermalState to the debug screen, so we can all see it and report, “Yep, the thermal state is critical when it stutters.”

They’ve been spending a fair amount of time trying to reproduce the issues and they’ve been making a ton of little fixes to resolve it on some files. But to my knowledge nobody actually knew what’s going on until now. (I’m :100: convinced now after my fan/no-fan testing.)

I mean, all devs know to avoid premature optimization. But it seems like this new info is finally a smoking gun that optimization is no longer premature, it’s overdue.

1 Like

strangely, for me anyway, i mostly only saw the stuttering occur after i had paused and resumed playback.

example, was watching a high bitrate 4k movie, played fine, i paused it to go do something, and from that point onwards it stuttered. i stopped playback, killed the app, reloaded, re-started playback and it seemed to then continue to play fine.

the only time i’ve seen stuttering it after resuming playback from a paused state, and only when the content is high bitrate 4k (ie full remux).

1 Like

This commonly reported stuttering issue is with Direct Play, no remuxing.

With Direct Play, the only thing coming from the server is the raw file data at whatever point you start/stop/skip to (file-data streaming is old netcode hoodoo, very solid, happening well beneath the Plex layer of the stack, and not the issue here).

With remuxing, every time you change playback, you’re stoping, restarting, and resynchronizing a server-side job. That’s all in the Plex integrated server/client netcode (very new hoodoo).

1 Like

you’ve misunderstood when i said “full remux”.
i wasn’t saying the plex server was remuxing the file, i was referring to the file being a a full BRRIP (ie a remux).

the files are direct playing in plex.

1 Like

Same issue here on Apple TV 4K (3rd gen.) after tvOS 17 update.
I tried to watch “Black Phone (2022)” but it was a complete mess.

Media
Duration 1:43:22
Bitrate 62284 kbps
Width 3840
Height 2160
Aspect Ratio 1.78
Video Resolution 4K
Container MKV
Video Frame Rate 24p
Audio Profile hra
Video Profile main 10
Parte
Duration 1:43:22
File The Black Phone (2021).mkv
Size 45.00 GB
Audio Profile hra
Container MKV
Indexes sd
Video Profile main 10
Codec HEVC
Bitrate 56091 kbps
Lingua Inglese
Language Tag en
D O V I B L Compat I D 6
D O V I B L Present true
D O V I E L Present true
D O V I Level 6
D O V I Present true
D O V I Profile 7
D O V I R P U Present true
D O V I Version 1.0
Bit Depth 10
Chroma Location topleft
Chroma Subsampling 4:2:0
Coded Height 2160
Coded Width 3840
Color Primaries bt2020
Color Range tv
Color Space bt2020nc
Color Trc smpte2084
Frame Rate 23.976 fps
Height 2160
Livello 5.1
Profilo main 10
Ref Frames 1
Titolo UHD VU
Width 3840
Display Title 4K DoVi/HDR10 (HEVC Main 10)
Extended Display Title UHD VU (4K DoVi/HDR10 HEVC Main 10)
Codec DCA
Canali 8
Bitrate 2046 kbps
Lingua Italiano
Language Tag it
Audio Channel Layout 7.1
Bit Depth 24
Profilo hra
Sampling Rate 48000 Hz
Titolo DTS-HD MA 7.1
Display Title Italiano (DTS-HD HRA 7.1)
Extended Display Title DTS-HD MA 7.1 (Italiano)
Codec AC3
Canali 6
Bitrate 640 kbps
Lingua Italiano
Language Tag it
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titolo AC3 5.1
Display Title Italiano (AC3 5.1)
Extended Display Title AC3 5.1 (Italiano)
Codec TRUEHD
Canali 8
Bitrate 2992 kbps
Lingua Inglese
Language Tag en
Audio Channel Layout 7.1
Bit Depth 24
Sampling Rate 48000 Hz
Titolo TrueHD 7.1
Display Title Inglese (TRUEHD 7.1)
Extended Display Title TrueHD 7.1 (Inglese)
Codec AC3
Canali 6
Bitrate 448 kbps
Lingua Inglese
Language Tag en
Audio Channel Layout 5.1(side)
Sampling Rate 48000 Hz
Titolo AC3 5.1
Display Title Inglese (AC3 5.1)
Extended Display Title AC3 5.1 (Inglese)
Imposti true
Codec SRT
Lingua Italiano
Language Tag it
Titolo Forced
Display Title Italiano Forzato (SRT)
Extended Display Title Forced (Italiano SRT)
Imposti true
Codec PGS
Lingua Italiano
Language Tag it
Header Compression true
Titolo Forced
Display Title Italiano Forzato (PGS)
Extended Display Title Forced (Italiano PGS)
Codec SRT
Lingua Italiano
Language Tag it
Titolo Regular
Display Title Italiano (SRT)
Extended Display Title Regular (Italiano SRT)
Codec PGS
Bitrate 20 kbps
Lingua Italiano
Language Tag it
Header Compression true
Titolo Regular
Display Title Italiano (PGS)
Extended Display Title Regular (Italiano PGS)
Codec PGS
Bitrate 21 kbps
Lingua Inglese
Language Tag en
Header Compression true
Titolo Regular
Display Title Inglese (PGS)
Extended Display Title Regular (Inglese PGS)
Codec PGS
Bitrate 27 kbps
Lingua Inglese
Language Tag en
Header Compression true
Titolo Non Udenti
Display Title Inglese (PGS)
Extended Display Title Non Udenti (Inglese PGS)

Please, fix this issue ASAP.

1 Like

The question is why it’s causing excessive CPU load? Why for example Infuse doesn’t do that no matter what file you throw at it, even on latest versions of tvOS, iOS, iPadOS?

https://www.reddit.com/r/PleX/comments/smaomn/laggy_playback_of_high_bitrate_4k_content_on/?share_id=zRlECrAubo14X0voZgt4A

this has been known about for at least a year. if it was using the hardware correctly thermal throttling wouldn’t be an issue - it’s only because it’s falling back to inefficient software (CPU) playback.

2 Likes

Is there any way to report this issue to Plex developers so it gets attention? Looks like they don’t even see it here nor acknowledge the issue, as well provide timeline for a possible fix.

@chrisallen Can you please help us?

1 Like

Bro, but the devs are too busy to fix this, have to postpone this 20 sprints later because they have to add some useless feature asap.
Inb4 this topic is still relevant in 2 years, I’ll bring popcorn truck.

EDIT: yes I work in DevOps as Senior DevOps engineer so don’t start with vague arguments. Also yes I switched to Infuse where there is actual development and feedback from developers on beta forums.

Apologies for being mean but this is ridiculous.

3 Likes

I get your frustration. I feel it too. Especially as a paying customer.

But software is expensive. Especially when it’s contracted out (which I presume is what Plex does). And priority goes to the work that will make the most return on that investment.

“No bucks, no Buck Rogers.” As the great movie says.

Unfortunately I suspect this problem hasn’t been up at the very top of the ROI priority list.

At least until now where I suspect having the cause finally identified after all the years and countless attempts by Plex staff to whack-a-mole at knock-on symptoms will greatly reduce the effort to finally resolve this issue once and for all. :crossed_fingers:

1 Like

I shared this post with our internal team last night and started looking into adding thermal state to the app to start tracking this. One of our team had some time to test out this theory and it does look like CPU load/temp is playing a part in the issue. I’ll try and get an update in here to share from our team once they have done some more digging. I do want to say a big thanks to @MrTemple for the interesting hypotheses which led to an internal Slack thread of 176 replies!

9 Likes

This is some stellar detective work.
After reading your post I switched back from binge watching in Infuse to binge watching in Plex. 1080p SDR in both cases whilst touching the Apple TV 4K.

I then switched to a 4K media in Plex and gradually felt the ATV get warmer and then the stutter started.
I turned the Apple TV on its side and the Apple TV seemed to go a little cooler and the stutter stopped for a while.
Maybe or may not be related but I haven’t had the elsewhere reported lip sync issue either whilst the stutter hasn’t been occurring.

2 Likes

Isn’t the core issue the fact that Plexs player is still based on OpenGL and they have no intention on fixing that anytime soon.

The fact that cpu is going that high when this should be something the gpu should be taking care of tells you that right there.

Anything can make almost anything throttle out when not programmed properly.

The fact the Plex player is hitting performance limits is known and so is the reason for it thanks to those pushing Plex for answers for LITERAL years.

This is why infuse works perfect and Plex as a modern media player on appleTV is a joke.

1 Like

I wish I read these threads before purchasing the Apple TV 4K 64Gb on sale for $100. It is a piece of junk compared to the Nvidia Shield. Nothing but issues and the only solution is to pay for another app. Disconnecting them…

Then that tells you the issue is the app, not the hardware.

The Plex and Emby apps aren’t as good as the android apps. I had issues with the Plex android app by nothing as bad as the Apple TV app. So for now, I’m benching it and hooking back up the Shield.

My other concern is the inability to bitstream audio on Apple TV.

but you knew that before buying the ATV though, yes?

1 Like

It really isn’t.

The common link there is they both use MPV player with the OPENGL api instead of Metal api.