plugin.video.elementum icon indicating copy to clipboard operation
plugin.video.elementum copied to clipboard

Continuous playing Season pack: Second episode always freeze and drops

Open SubEdict opened this issue 3 years ago • 14 comments

Expected Behavior

Binge watching. Play all episodes of a season without stopping using Up Next.

Current Behavior

Few weeks now, maybe since kodi v19.1 release, I've this strange issue when continuous playing all episode (with or without Up next) from a season pack. Every second episode that start immediately will freeze after 3-10 minutes and eventually stop.

If I pause when it happen before the file drop I can see the info on the overlay status shows double cache and downloading. Sometimes if I just skip 10-20 seconds forward fix it but 50% of time the file will drop back to episodes list.

Possible Solution

Steps to Reproduce (for bugs)

  1. Click on the first episode from a season. Choose the season pack link result. start playing.
  • image below show first episode works great no CPU/GPU/RAM problem. More info, everything looks ok.
  1. Click next when Up Next button pop up at the end of the episode. Or just let it auto start at the end.

  2. Start immediately watching episode 2. Everything start fine in the first 3-10 minutes (found that small size like this show can take longer before the issue start so, size matter. I'm usually only play 1080p-4k)

  3. After 3-10 minutes watching, the file will freeze

  • Pause to help the buffer won't help and the file eventually drop back to episodes list
  1. Starting again episode 2 without any problem. Moving on to episode 3 that again will start immediately but will drop.
  • Sometime after the drop the "use this torrent again?" message will appear
  1. Finish episode 3 and episode 4 now drop with a new and strange progress bar at the top appear.

Context

Actions tested:

Everything that I load start in 3 second with download speed going up to 15MB/s ..So it's odd to see those 50kb cache download 100% of the time. I understand it's probably trying to to cache/load all the next starting episode pices

  • If I skip 2 second forward when it freeze I can see the buffering start again and everything is back to normal.
  • If I use the History to play from there (the windows with all the episode to choose from) there is no problem but I do need to open the windows again on each episode.

Your Environment

3 PC Windows 7/10. Fiber 1Gb download on LAN. All up-to-date. Issue started somewhere with Elementum 1.78 up to the latest 1.83 (default setting). Kodi 19.1 and up to the latest nighty build right now.

  • This issue affect only season continuous play. Everything else work fantastic.

Link to Kodi debug log:

Lol this was also an issue because when the Debug was on log file got over 22MB real quick and didn't let me upload (usually I use error only and file log show less than 200k). So I cut down 100k of repeated line (just the parts number not any real info or error) I got headache but maybe you guys can understand any of this.

  1. first log is searching and playing episode 1-6. https://paste.kodi.tv/wavacemede.kodi -Just a back up (same log file. This is because sometime I saw server/data error ..too long maybe?) https://paste.ubuntu.com/p/Y5qY2BbVjC/

  2. Just continue watching episode 7-10 till the end. First it's stuck on 0 download but after stop-play again everything was ok till episode 10 drop https://paste.kodi.tv/onufulanik.kodi

Thanks for reading

SubEdict avatar Jul 22 '21 18:07 SubEdict

Just a wild shot as I noticed that not only elementum has problems with back-to-back episodes, but actually the whole networks chugs a bit. Also I accidentally let a very popular movie paused and the whole network after some time came to a halt - I couldn't even ping the router.

After a bit of searching for the culprit I found that conntrack_count was maxed out at my OpenWRT router, at 16386 connections. For now, I just doubled the conntrack_max but I'll have to find a better/final solution. My speculation is that elementum opens too many connections and to play the next episode you'll have to wait to close the old one to be able to open any new. In #169 there's a recommendation to disable DHT and/or UTP. Maybe set a connection limit? Try these (if anything works please update us, I'm very interested)

Not 100% sure if we're facing the same issue though

dzervas avatar Jul 25 '21 01:07 dzervas

Just for test please try on BitTorrent tab to:

  1. Set connection limits
  2. Disable udp
  3. Disable dht

These should affect conntrack.

(But maybe there is a bug in the version of libtorrent elementum uses)

antonsoroko avatar Jul 25 '21 08:07 antonsoroko

Got it, thanks guys, will take some time but definitely will try. Never did that, knew connection limit: auto works best in Elementum. Never touched UDP / DHT. Just don't want to mess things that still works great for years now, 10+ Hours daily use other than seasons packs.

  • Reminder: This started somewhere with Kodi 19.1.
  • Thought: Maybe some kind of conflicts Up Next + El' setting both trying to load next episodes at the same time?

Also, there's no bottleneck on the router. Already tried "stress testing" other devices (3-4 at the same time) while streaming large files of season pack and still get 700Mb available bandwidth with speed test on the fifth device.

Update: OK, Connection: 300. Disable UDP/DHT. Looks like all the regular daily single episodes (From Magnet, Trakt-Progress, Search etc.) works exactly the same so next step will do season packs.

SubEdict avatar Jul 25 '21 13:07 SubEdict

Finish testing with the most trending season packs right now. Sorry guys, same issue, second file freeze and drop, when pause (on ep' 3-4-5) overlay status shows double or even triple cache / downloading but at least it's help a little and the files keep playing with a short 1 second buffering here and there.

I can upload a regular log (Errors) if it help or will try again with debug on the next season pack.

SubEdict avatar Jul 25 '21 23:07 SubEdict

There are no issues with downloading or networks.

Double texts in overlay status means there are more than 1 active Players (which should not happen) started. Since they own same torrent - one of them is being closed and closes torrent afterwards. Probably there is a bug with detecting active player, of just need to track if torrent is used by any other player.

elgatito avatar Jul 26 '21 10:07 elgatito

If there's anything I can help with (testing) just let me know.

SubEdict avatar Jul 26 '21 13:07 SubEdict

@SubEdict Can you test again with the latest version and upload a log if you see this issue again?

elgatito avatar Jan 12 '22 20:01 elgatito

@elgatito Woop's 5 days ago, didn't see your comment. OK.

  • Turn back on "Try to download next episodes"
  • Watched 6 episodes (full size 1080p, 50 Minutes each) straight non-stop with Up-Next (All episodes start immediately).

Almost! No drop or freeze until ep.6 But.. The overlay status still show double text, same as the above sample. *Next time will use the debug log, sorry.

SubEdict avatar Jan 17 '22 18:01 SubEdict

Some update: Install fresh Kodi (After crazy bugs with PM+Seren.. never mind), Only install my favorite 3 addons and run a new 6 ep from new season pack w/Up Next. It was smooth, everything works, not a single hiccup or any issues. Overlay status still show double so.. yes it's weird. Here's regular kodi log. I think line 967 is the beginning of the show.

  • Also, minor silly issue on Trakt site: Looks like when using Up-Next button, start-end episodes won't be mark until the last one stop and then will write as watched all 6 ep in a randomly order all in the same time (eg. Ep' 2, 1, 5, 3, 6, 4 @ 22:21). Not really a bug just FYI.

  • Must mention: The latest version of Elementum from my experience is most stable I've ever used (fast, smooth 4k, files with low seeders will buffer as long as it needed and wont drop the connection etc.) Very happy guy here. Amazing job.

1.29.2022 Update* after 10+ S.Packs: Sadly no change to this issue, yes, some episode less then 25 minutes can continuous play 5 or even (if lucky?) 6 episodes but everything above will have the same affect as mention in the beginning of this post.

1.31 - 2.24.2022 update*: Looks like manually stopping & playing next episode (without Up Next) works OK now. Also letting the Up Next finish the countdown and start the next episode automatically works OK (also marks fine on Trakt site). So for now it's only an issue when click on the Up Next button (I usually start it 120 seconds to skip all the end credits).

SubEdict avatar Jan 20 '22 13:01 SubEdict

Good news! Looks like the latest Up Next update v1.1.8 fixed this issue. Testing 3 days now on 4-5 seasons packs, all good.

SubEdict avatar Sep 19 '22 00:09 SubEdict

It's back again, yeah.. Bummer. Reopen.

SubEdict avatar Sep 30 '22 16:09 SubEdict

@SubEdict Is this relevant with the latest version?

elgatito avatar Dec 14 '23 14:12 elgatito

There was an issue in pre-last versions that were trying to add torrent with same hash.

Regarding startup of a next episode. Elementum is not starting next episode, it only provides information to UpNext how to start next episode if needed. And Elementum is starting download of a next episode once current is complete (to avoid waiting for buffers to fill up). So UpNext tries to start next episode when needed. But of course it should succeed. If it fails to start next episode - that is wrong and we should investigate the log.

elgatito avatar Dec 14 '23 14:12 elgatito

Nothing new since my last 1.31 - 2.24.2022 update:

Looks like manually stopping & playing next episode (without Up Next) works OK now. Also letting the Up Next finish the countdown and start the next episode automatically works OK


Yes.

...Elementum is starting download of a next episode once current is complete (to avoid waiting for buffers to fill up)

It's important to mention: As long as the countdown knows it finishes and starts automatically the next episode it instantly starts playing meaning the "download & cache next episode" does work well.

But.. Clicking on Up Next button while it doing the countdown will fail, sometimes with the message "file already in use" or can also crash Elementume if it does manage to start the next episode.

** My best workaround for this specific issue (skipping the 120 seconds countdown) is simple: Because you can't focus-click on the player timeline while the Up Next button appears I'm using Chorus Remote control on a laptop/Any other device to click-jump on the timeline to the last time frame, which will let Up Next "think" it got to countdown 0 and auto start the next episode. 😸

PCs, Win-7/10x64. Kodi 20.2, 21 Beta 2 pre-release, Nightly.

SubEdict avatar Dec 14 '23 17:12 SubEdict