In my last blog about transcoding, the stutter came down to the Pi converting a 4K Dolby Vision file it couldn't keep up with. Then it stuttered again, and this time nothing was being transcoded.
Direct play, and still stuttering
By now I knew where to look first, so I opened the Jellyfin dashboard while it was stuttering. The session said "Direct playing". Nothing was being converted, the TV understood every part of the file and the Pi was just sending it over.
That ruled out everything from the last post. If the formats were fine and it still stuttered, then something else was keeping the Pi from sending the file fast enough.
Look at the CPU
So I SSHed into the Pi and looked at what it was doing. The CPU usage was sitting at 90% or more, which is a lot for a Pi that is supposed to be just playing a file. If your stack runs in Docker, this shows which container is busy:
docker stats --no-stream
Who was using it
After digging around, it was Bazarr and qBittorrent. Seerr had been instructed to request a show with four seasons, Tulsa King, and had all of it queued up, and both of them were churning through all of it at once.
Seerr hadn't done anything wrong. The person who requested the show wanted all the seasons, so it asked for all four.
Everything in the stack lives on the same Pi, with the same four cores. qBittorrent is busy for as long as it has many active torrents, and Bazarr is busy for as long as it has a pile of episodes to look at. Jellyfin only needed a small share to direct play one file, but when two apps take most of the CPU, that share gets squeezed.
Direct play is light work, but it still needs its share of the CPU, and with the Pi this busy it was probably getting less than it needed.
The fix: one torrent at a time
I limited qBittorrent to one active torrent. The rest of the season now waits in the queue and gets worked on one after another, so there is much less going on at any moment. While playing a movie or show, the CPU is back to around 20 to 30%, and the stutter is gone.
In qBittorrent this is in the options, under BitTorrent and then Torrent Queueing. Set the maximum active torrents to 1. The labels might differ a little on your version.
It does mean a whole show takes longer to arrive, since the episodes are no longer downloading side by side.
Watching it without SSH
This is the second time a stutter turned out to be the Pi working too hard, so a graph is easier than SSHing in every time. Beszel, the monitoring dashboard from the last post, shows the CPU chart too. Picking 12 or 24 hours shows what happened last night.

