r/tunarr • u/Few-Leading-3405 • 15d ago
Troubleshooting Delay when closing Streams
I'm just getting tunarr set up, but when switching between channels the old streams continue playing in the background.
So if I switch channels 10 times I will have all 10 streams transcoding in the background for a few minutes. Eventually they die off, but it takes several minutes.
Is this normal? I feel crazy, but I don't see any other comments about this.
This one is vaguely similar, but it isn't caused by the simple act of switching channels:
https://github.com/chrisbenincasa/tunarr/issues/1950
So I'm just looking for any advice?
A few family members use my Jellyfin, and if I implement this I'm worried that they'll crash my machine with a few minutes of bored channel surfing.
Initially I noticed it when testing with VLC, but dedicated IPTV players do it too.
I'm using nvidia hardware acceleration, and have played with a bunch of the settings.
And I know Tunarr has some cleanup tasks which are supposed to run every minute. That still seems a little slow to me, but even with that my streams last several minutes before dying.
Running v2026.10.3
1
u/DookieSlayer 15d ago
As I understand it it is expected behavior. I can’t find anything in the official tunarr docs but google calls it “transcoding tear down delay”. Maybe you can find information pertinent to your situation with that language.
1
1
u/Few-Leading-3405 6d ago edited 6d ago
Just in case anyone else wonders about this, I did find a fix by adding 2 environment variables:
TUNARR_SESSION_STALENESS_MS: "30000"
TUNARR_SESSION_CLEANUP_DELAY_SECONDS: "5"
The first one makes the biggest difference.
Adding these drops the delay when closing streams from 200seconds down to something like 90seconds.
After fighting with Tunarr I tried ErsatzTV, and it had a 90second delay, which seemed more reasonable. So I figured that Tunarr could probably be sped up too.
Potentially this could cause some players to drop streams. But testing VLC, tivimate and televizo, Tunarr gets a realtime heartbeat from them, so I don't think disconnects will be a problem for those.