Repository navigation
|
I found this in Dispatcharr's plugins and it seemed interesting. I tried it using TiviMate/Emby/iMPlayer, etc and noticed often I would see micro-freezes. I also use a Windows IPTV app called FredTV which has a stats for nerds type overlay where you can see bitrate, resolution etc of your streams. One stat is cache and shows MB and the correlated secs. When running my normal stream profile it runs upwards of 10Mb+ and 15+secs. However with Reservoarr as my stream profile, it fluctuates between 3-400k to 4Mb. As a result, I see those same micro freezes. So I attempted to fine tune using the tunables but I'm not sure where and how to enable them. I'm using Unraid and first tried adding a variable in the container setup, then tried appending them on the stream profile command line. Any idea how I could try out those tunables using Unraid? |
Replies: 11 comments 30 replies
|
I found that I could edit the reservoarr.py directly and I could get those cache #'s to increase. However, after 2-3mins, streams would still micro-freeze. I tried adjusting just these 2 variables: PREFILL_BYTES = int(os.getenv("RESV_PREFILL_BYTES", str(3064 * 1024))) - Increased the pre-fill to 3064 vice 1532 HEADSTART_S = float(os.getenv("RESV_HEADSTART_S", "3")) - Lowered from 5 to 3 I thought if I increased the pre-fill, but decreased the Headstart, that would lessen how much is released to the client. Seemed to somewhat work but would eventually hiccup again. I did at one point increase the Headstart to 10secs and I could see that matching 10secs initially in the player. So I know at least the changes at least had some effect. |
|
The tunables are environment variables on the Dispatcharr container that launches Reservoarr, not arguments appended to the stream-profile command. In Unraid, add e.g. Your follow-up explains why increasing Look at |
|
Sorry for the very late reply — I didn't see this discussion until now, and thanks to @Dotoryman for the detailed help in the meantime. Where the tunables go: they are environment variables on the Dispatcharr container (in Unraid, 'Add another Path, Port, Variable' → Variable, Key On your freezes: your 1-second capture shows 11–15s buffered, ingest errors at zero and |
|
Correction to my earlier answer: you were right. Variables set on the Dispatcharr container (including an Unraid Variable) are not seen by reservoarr — Dispatcharr starts its workers through What works: create a new stream profile with command Fix: #52 |
|
Just curious if you ever found the solution to this? Im living in the same world only using channels on Apple TV. Get these micro stutters as described every so often. Log file shows a great buffer built up with no errors. Did changing RESV_TARGET work? From watching the channels stream on their UI, it seems like reservoarr isn't releasing enough to the client even though the buffer is build up which causes microstutters. If a perfect stream is running at 1x (normal time) or greater, I see drops around .95x which obviously will cause the client to catch up and briefly stutter. Happy to create a new discussion if preferred but think we are running down the same issue |
|
Tinkering around a bit further and looking at the code, seems like this all has to do with release_factor function. At least in my scenario achieving the 30 second buffer would cause the micro stutters as the release factor was dumping down to .97 quite a bit on the way up there. Setting RESV_TARGET_S to a lower number (say 5 seconds) helped and looked to resolve the issue. In my case my upstream CDN is pretty solid but im looking to clean up the EOF and other small gaps that I think 5 seconds will cover. I need to spend more time with it though I did tinker with the release_factor variables, increasing the max and the floor etc with the now obvious result of eating the actual buffer almost completely. Decided to just lower RESV_TARGET_S instead. Hope this helps, happy to try other things |
|
I had stopped using it as I realized it also wasn't working well with Emby. I think it's just the way Emby gives up too quickly perhaps, so streams wouldn't start at all. I also use iMPlayer and Tivimate so I can try it out again and see how it runs. |
|
There could be something going on with the upstream pull as well that’s just my speculation I was getting quite a few http 405 errors last night. I haven’t really took a look….so take this with a grain of salt. But that seems pretty consistent over time with any channel or provider eventually. Could totally be my providers though On Oct 28, 2026, at 5:37 PM, sm0keb0x ***@***.***> wrote:
I watched a little last night and this morning, trying both iMPlayer and Tivimate and while not 2-3 minutes in, I still saw the micro-freezes. Here is a snippet from the delaybuf.log that shows the cushion going to 0:
2026-10-28T09:37:07+0000 [94877.ts] cushion=0s(pcr) buf=0.5MB out=8.59Mbps in=8.43Mbps crate=8.58Mbps in_total=1207MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:37:22+0000 [94877.ts] cushion=9s(pcr) buf=9.1MB out=7.31Mbps in=9.03Mbps crate=8.60Mbps in_total=1229MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:37:37+0000 [94877.ts] cushion=10s(pcr) buf=11.6MB out=8.55Mbps in=9.12Mbps crate=8.56Mbps in_total=1248MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:37:52+0000 [94877.ts] cushion=11s(pcr) buf=12.1MB out=8.57Mbps in=9.17Mbps crate=8.57Mbps in_total=1264MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:38:07+0000 [94877.ts] cushion=13s(pcr) buf=13.1MB out=8.54Mbps in=9.10Mbps crate=8.53Mbps in_total=1281MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:38:22+0000 [94877.ts] cushion=8s(pcr) buf=9.4MB out=8.50Mbps in=8.95Mbps crate=8.58Mbps in_total=1293MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:38:37+0000 [94877.ts] cushion=11s(pcr) buf=11.5MB out=8.60Mbps in=9.12Mbps crate=8.59Mbps in_total=1312MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:38:52+0000 [94877.ts] cushion=11s(pcr) buf=11.3MB out=8.53Mbps in=9.01Mbps crate=8.50Mbps in_total=1327MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:39:07+0000 [94877.ts] cushion=11s(pcr) buf=11.4MB out=8.55Mbps in=9.33Mbps crate=8.49Mbps in_total=1344MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:39:22+0000 [94877.ts] cushion=12s(pcr) buf=13.6MB out=8.53Mbps in=9.48Mbps crate=8.58Mbps in_total=1362MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:39:37+0000 [94877.ts] cushion=9s(pcr) buf=9.3MB out=8.56Mbps in=8.61Mbps crate=8.50Mbps in_total=1373MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:39:52+0000 [94877.ts] cushion=8s(pcr) buf=9.7MB out=8.54Mbps in=8.62Mbps crate=8.55Mbps in_total=1390MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:40:07+0000 [94877.ts] cushion=12s(pcr) buf=11.5MB out=8.51Mbps in=8.67Mbps crate=8.51Mbps in_total=1408MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:40:22+0000 [94877.ts] cushion=13s(pcr) buf=14.4MB out=8.54Mbps in=9.15Mbps crate=8.60Mbps in_total=1427MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:40:37+0000 [94877.ts] cushion=9s(pcr) buf=8.9MB out=8.57Mbps in=8.63Mbps crate=8.57Mbps in_total=1437MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:40:52+0000 [94877.ts] cushion=8s(pcr) buf=8.5MB out=8.57Mbps in=8.64Mbps crate=8.59Mbps in_total=1453MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:41:07+0000 [94877.ts] cushion=8s(pcr) buf=8.2MB out=8.58Mbps in=8.62Mbps crate=8.59Mbps in_total=1469MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:41:22+0000 [94877.ts] cushion=6s(pcr) buf=6.0MB out=8.55Mbps in=8.33Mbps crate=8.47Mbps in_total=1482MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:41:37+0000 [94877.ts] cushion=6s(pcr) buf=7.2MB out=8.57Mbps in=8.73Mbps crate=8.65Mbps in_total=1500MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:41:52+0000 [94877.ts] cushion=7s(pcr) buf=6.5MB out=8.63Mbps in=8.25Mbps crate=8.59Mbps in_total=1515MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:42:07+0000 [94877.ts] cushion=3s(pcr) buf=3.6MB out=8.54Mbps in=8.35Mbps crate=8.55Mbps in_total=1528MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:42:22+0000 [94877.ts] cushion=0s(pcr) buf=0.0MB out=4.99Mbps in=7.45Mbps crate=7.63Mbps in_total=1534MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:42:38+0000 [94877.ts] cushion=0s(pcr) buf=0.0MB out=4.23Mbps in=7.06Mbps crate=6.72Mbps in_total=1543MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:42:53+0000 [94877.ts] cushion=0s(pcr) buf=0.0MB out=2.62Mbps in=6.23Mbps crate=5.78Mbps in_total=1548MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:43:08+0000 [94877.ts] cushion=0s(pcr) buf=0.0MB out=2.39Mbps in=5.40Mbps crate=4.57Mbps in_total=1552MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:43:23+0000 [94877.ts] cushion=1s(pcr) buf=0.3MB out=3.55Mbps in=4.72Mbps crate=3.73Mbps in_total=1559MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T09:43:38+0000 [94877.ts] cushion=1s(pcr) buf=2.0MB out=3.33Mbps in=4.26Mbps crate=3.17Mbps in_total=1567MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
The Emby issue still seems present but random. Sometimes streams start somewhat quickly, sometimes not at all. Here's the log when I switched streams after it had started without issue. You can see reservoarr reporting an input and cushion but Emby just hung. So this is likely an Emby issue
2026-10-28T21:30:40+0000 [369275.ts] cushion=3s(pcr) buf=3.0MB out=9.52Mbps in=9.20Mbps crate=9.51Mbps in_total=259MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:30:55+0000 [369275.ts] cushion=4s(pcr) buf=3.8MB out=9.44Mbps in=9.48Mbps crate=9.43Mbps in_total=278MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:31:10+0000 [369275.ts] cushion=4s(pcr) buf=4.9MB out=9.49Mbps in=9.51Mbps crate=9.48Mbps in_total=297MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:31:25+0000 [369275.ts] cushion=6s(pcr) buf=6.2MB out=9.48Mbps in=9.36Mbps crate=9.44Mbps in_total=316MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:31:40+0000 [369275.ts] cushion=7s(pcr) buf=7.4MB out=9.46Mbps in=9.51Mbps crate=9.43Mbps in_total=335MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:31:55+0000 [369275.ts] cushion=1s(pcr) buf=1.1MB out=9.41Mbps in=9.04Mbps crate=9.37Mbps in_total=346MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:32:10+0000 [369275.ts] cushion=6s(pcr) buf=6.5MB out=9.46Mbps in=9.42Mbps crate=9.51Mbps in_total=369MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:32:34+0000 [934703.ts] cushion=8s(pcr) buf=9.4MB out=13.57Mbps in=18.43Mbps crate=10.07Mbps in_total=35MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:32:49+0000 [934703.ts] cushion=10s(pcr) buf=12.3MB out=10.01Mbps in=15.00Mbps crate=9.99Mbps in_total=57MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
2026-10-28T21:33:04+0000 [934703.ts] cushion=10s(pcr) buf=12.1MB out=9.99Mbps in=13.30Mbps crate=9.98Mbps in_total=75MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0%
—Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
Updated and was testing more last night but swapped back to the default ffmpeg profile after it seemed to stall out. This could have been a provider issue but it seemed to choke up for a long time, perhaps preventing Dispatcharr from moving to the next stream. 2026-10-29T09:50:17+0000 [94877.ts] cushion=5s(pcr) buf=4.6MB out=8.62Mbps in=8.58Mbps crate=8.54Mbps in_total=1568MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0% |
|
Seems like its running well. I have captured this in the logs but it doesn't look like it's viewer facing, or perhaps not yet. I also see where it states exiting so Dispatcharr can take over but Dispatcharr doesn't switch streams and it stays on the first stream: Delaybuf: 2026-11-01T13:23:31+0000 [934703.ts] upstream down and reservoir dry (no data 5s); exiting so Dispatcharr can reconnect or fail over Dispatcharr: 2026-11-01 08:23:31,641 -0500 INFO live_proxy.manager Stream info for channel a4884ae2-44d1-441d-b89f-b66f4d1fe791: [delaybuf] upstream down and reservoir dry (no data 5s); exiting so Dispatcharr can reconnect or fail over |
|
Here is the delaybuf log from a couple mins prior, up to the 13:23 error. I believe it may have jumped back in video. 2026-11-01T13:20:27+0000 [934703.ts] cushion=12s(pcr) buf=15.2MB out=9.50Mbps in=10.01Mbps crate=9.77Mbps in_total=1147MB reconnects=0 ccerr=0 pcrrej=0 disc=0 sync=0 pcr_back=0 vholes=0% aholes=0% dry=0.0s maxgap=4.9s |
Correction to my earlier answer: you were right. Variables set on the Dispatcharr container (including an Unraid Variable) are not seen by reservoarr — Dispatcharr starts its workers through
su -, which clears the environment and re-exports only its own list. The README and plugin note were wrong to say otherwise.What works: create a new stream profile with command
/usr/bin/envand parameters likeRESV_TARGET_S=40 /data/reservoarr/reservoarr.py {streamUrl} {userAgent}, and assign it to your channels. Don't edit the profile the plugin generated — "Generate Stream Profile" resets it. The docs are fixed in v6.3.10 (docs/TUNABLES.md, "Where settings go").Fix: #52