-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Since ISA v21.1.1, some high bitrate content has abnormal memory usage that can cause Kodi to crash #1295
Comments
I can confirm the error. I wanted to open an issue about it a few days ago, but couldn't get a useful debug log with the stupid firetv stick 4k. Hardware to slow for debuging. I tested Disney (StarWars movies) play 5min |
please test with this test build (i deleted my previous message, different link): |
@CastagnaIT |
Hardware: Nvidia Shield TV 2015 and Nvidia Shield TV Pro 2019 Nightly Kodi 21 Omega inputstream.adaptive Version: 21.1.2 = Not OK Netflix Addon = 4K Movies For example A Beautiful Life Disney+ Addon = 4K Movies For example Star Wars: Das Erwachen der Macht ( Episode VII ) Have the same problem and can confirm it. |
Hardware: Nvidia Shield TV 2015 Nightly Kodi 21 Omega Alpha Netflix Addon = 4K movies = Not OK 4K movie after a few minutes the picture and sound freezes and then you are out of Kodi. Here is a Kodi Debug LOG with Netflix Addon: Here is a Kodi Debug LOG with Disney+ Addon: Translated with www.DeepL.com/Translator (free version) |
i dont have any 4k account and no 4k tv on my hand so i am going blind my first suspect for now is for PR 1238 note test will not works with D+ because the code change is incomplete, you can test only with N€tflix |
Thanks for your help, just tested it but unfortunately it did not solve the problem. |
there is no problems with Kodi 20? |
With this InputStream Adaptive version, there are no more problems under Kodi 20 Nexus on the Nvidia Shield TV 2015 and the Nvidia Shield TV Pro 2019. Netflix Addon = 4K films/series = OK |
with the crashes, there are no problems. I've now watched two films of 20-30 minutes each. only N€tflix N€tflix Amazon Disney |
But maybe @glennguy has another idea to solve the problem in this direction: Kodi 21 Omega: inputstream.adaptive Version: 21.1.2 |
Ok so might need some more info. @Ronny-nerd could you please also supply the manifest file? In inputstream.adaptive settings you can turn on the option to save the manifest file, then please attach here. Also can you try switching the audio track between 6 channel and 2 channel and see what the behaviour is? I'm looking at the manifest in the OP and seeing that the NF video played there only has EC3 tracks, yet... |
mmh i will try check tonight or tomorrow |
Hope that worked out with the manifest file. https://www.dropbox.com/s/32qsyibxk7cod1z/manifests.zip?dl=0 |
Had changed it in the meantime, but the same problem is still there. Nvidia Shield TV 2015 is connected directly to the HDR monitor.... no AVR or soundbar is used. |
A question for the developers, I often see the manifest data being distributed via .zip. When size allows, I always use paste.kodi.tv |
so by reading n€tflix log at comment #1295 (comment) but in the log attached in the Issue description: i think its not a problem of wrong format type i noticed there are tons of prints: however maybe it could means some data problem? maybe slightly corrupted? @Kampfader depends from use cases, |
a question you are using "android IEC packer"? i have no way to investigate on this |
No, I always use Kodi IEC Packers. at this time I am unable to test further and hope someone else can. I agree that the best way to troubleshoot the issue is to try all commit changes for v21.1.0-v21.1.1 until we find the problem. It shouldn't take long to use the dichotomy. |
Does it really run without crashing with 21.1.0? I haven't tested the version myself, I'll do it today after work. I use the last kodi nightly for |
Someone on the Kodi forums reported the failure as a memory leak issue. |
i made some incremental builds i suggest to start test from the "test 5" and when fail try olders inputstream.adaptive-android-aarch64-omega-d660799_test5.zip |
Hardware: Nvidia Shield TV 2015 _test0.zip (this is same of 21.1.0) = OK LOG _test2.zip = Not OK |
_test1.zip = OK Netflix Addon = OK |
please test also this same as before with n€tflix |
_test6.zip = Not OK After one minute After two or three minutes = Kodi Crash |
LOG _test6.zip = Not OK |
luckily is not mutex problem, apparently is due to parser rework of PR 1067 with test6 if you set 1080p what happens? do you still see a progressive increase on occupied memory (during playback)? |
After 8 - 10 minute |
Apparently there is a memory leak in ISA and Kodi crashes when it runs out of memory, and Android terminates background programs to reclaim memory. I think we can start by listing the affected platforms and the content for now. For example |
can you explain better what means "Optional"? |
Bitrate: Does it happen when a certain bitrate is required? |
when you have time please try to see if there is some improvement with this test build: |
Im testing the 239525e N€tflix - 4k The Mother 30min viewed = no crash Amazon Vod - 4k StarWars IX with and without HDR10 = crash after 2min Disney - 4k Avatar = crash after 2min I tested the v21.1.0 to see how far going the system memory usage. Max was 65% |
Tested it and still have the same problem with this version. |
But the hope remains that you will solve the problem. |
I did some testing of my own with the Disney+ addon and Kodi Omega Alpha 2. I don't think the problem has something to do with the bitrate of the video, but rather the length of the video. With the movie Avatar, the problem also occurs if I choose the 2560x1440 stream with a bitrate of 15 or 18 Mbit/s. Same thing happens with the movie Black Panther: Wakanda Forever. With these movies the memory usage starts at over 80% and quickly rises to 93-95% after which Kodi crashes to the Shield's homescreen. But if I play a TV show episode of about 40 mins in 4K with a bitrate of 23-24 Mbit/s, the problem does not occur and the memory usage stays at about 73-74%. Also did some tests with Kodi Nexus and IS:A 20.3.9 and no issues there. EDIT: Did some more tests with the Netflix addon and that seems to behave a bit different. I played two episodes of Altered Carbon Season 1 (episode 6 with a length of about 46 mins and episode 7 with a length of about 1h07.). In both cases the 18 Mbit stream made the memory usage go up to 94-95% and Kodi crashed. The 10 Mbit stream kept playing, although the memory usage did grow to about 83-85%. |
It doesn't look like this should be a memory leak failure because certain content also takes up higher memory but the memory footprint doesn't keep growing. If the memory is large enough (looks like it needs to be 4GB?) then memory exhaustion will not occur and it will not cause Kodi to crash. However mainstream Android TV set-top boxes only have 2-3G of RAM, which is why the issue only seems to affect devices like Android at the moment, as they have less RAM. |
For comparison, the Amazon VOD addon with the movie "Dune (2021)", Kodi does not crash. Installed InputStream Adaptive version now |
@glennguy i think i have found a way to investigate also under Windows os by using following code snippet you can get HLS manifest from youtube (manifest url expire) from yt_dlp import YoutubeDL # yt-dlp - https://github.com/yt-dlp/yt-dlp
url = "https://www.youtube.com/watch?v=Hf5enZVznC4"
ydl = YoutubeDL({'format':'bestvideo*+bestaudio/best'})
result = ydl.extract_info(url, download=False)
for format in result['formats']:
if "manifest_url" in format.keys():
print(f"found a manifest_url {format['manifest_url']}\n") specified yt link on the code above, is a video of ~1h with 8K resolution,
i can see the gradual memory increase over the time |
@CastagnaIT awesome work! |
I'm curious to see what the future holds for us. |
Very strange behaviour for VP9. On windows with 4K test stream the memory usage as reported by task manager instantly jumps from around 130MB to 920MB. Usage keeps climbing to around 1250MB and then slowly creeps up, around 50MB per minute. This is all released upon stopping playback though and usage goes back to around 150MB. There's no h264 4K to compare to, but with 1080p starting at 130MB usage:
Why does Kodi need so much RAM just to start playing a 4K VP9 stream? |
yes it is strange, but if you use from this however take note that on android its used HEVC stream, not VP9 on this comment you can see the results of some tests based on branch commits: i make a lot of attempts changing code on i also tried change vector of pointer of |
one interesting thing that i found today is that if you set |
I remember trying "only video", but it didn't work. |
@CastagnaIT I tried using "video only" on a 4K HEVC movie in the Disney+ addon, but the memory usage still went to 95% within seconds, causing Kodi to crash. |
If for example under Normal: Render speed: 23.4 fps - 24.4 fps What amazes me is with Amazon with the movie: "Dune" this movie it does not matter how it looks at the render speed, but it runs stable. Translated with www.DeepL.com/Translator (free version) |
we have found one of problems that cause high memory allocation |
TOP CastagnaIT My test: Netflix Addon = OK System memory utilisation: = OK After two or three minutes = No Kodi Crash |
What else should be investigated and fixed? |
mmh i think was memory difference due to debug build vs release build |
Fire cube test Play 2h 10min StarWars IX = all good Memory usage start 68% |
Bug report
Describe the bug
Here is a clear and concise description of what the problem is:
Stream some new episodes(?) such as THE DAY, Black Mirror Season 6 using the Netflix add-on. Playback suffers severe frame drops for 1-2 minutes and eventually freezes.
It's worth noting that the problem seems to only occur at the highest bitrate. Maybe it is necessary to reach a certain bit rate. So we need to manually select the highest bit rate video stream when playing.
ISA v21.1.2 didn't change anything, even worse I think.
Expected Behavior
Here is a clear and concise description of what was expected to happen:
Smooth video playback
Actual Behavior
Severely dropped frames that don't recover over time and eventually freeze.
Possible Fix
Apparently this is a problem introduced since v21.1.1, because if I use v21.1.0, this problem doesn't happen.
To Reproduce
Steps to reproduce the behavior:
1.Open Netflix add-on
2.Play specific content, such as Black Mirror Season 6
3.Choose 4K, best bitrate to play.
Debuglog
The debuglog can be found here:
https://paste.kodi.tv/nufepuyara.kodi
MPD/M3U8s/ISM
An example or copy of a manifest (or manifests for HLS - master and variants) can be found here:
https://paste.kodi.tv/uruwirupiy
Screenshots
Here are some links or screenshots to help explain the problem:
Additional context or screenshots (if appropriate)
Here is some additional context or explanation that might help:
Your Environment
Used Operating system:Shield TV Pro 2019
Android
iOS
tvOS
Linux
OSX
Windows
Windows UWP
Operating system version/name:9.1.1(Android TV 11)
Kodi version:Kodi 21 20230613-2307e4d6
inputstream.adaptive version:v21.1.1
note: Once the issue is made we require you to update it with new information should that be required.
Team Kodi will consider your problem report however, we will not make any promises the problem will be solved.
The text was updated successfully, but these errors were encountered: