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
Netflix addon causes high CPU load when starting music playback - 2nd try #859
Comments
Could you try open a second session on console or via ssh and try sudo top -H command to see the CPU eater thread , you can run it in batch using sudo top -Hb andsave it to a file using > pipe ps -aux is another option to check |
POST EDIT: i see now same author of thread.. I could theorize a Kodi problem that with some CPU is not able to good handle the threads I could tell you to do two tests:
|
another try is install an older version of Kodi 18, e.g. 18.6 |
I think this is the info you need. Kodi log: Top batch log: My own investigation using your request already revealed it is the "LanguageInvoker" thread that is using all cpu... |
|
The problem does not occur for me since I updated kodi to latest version, but since I have decided to start including my music library in kodi... So let's see what the other results so far can help us. I'd rather not downgrade kodi on my htpc which I use on a daily basis. Switching configs is easy, kodi versions not so much (for me)... |
Try this: After this, update with: |
The previous tests I did were with an unconfigured netflix plugin, so "sync the watched status of videos with neflix" was already off. I installed your updated plugin, but problem persists. kodi debug log: top log: Again LanguageInvoker is the one eating up CPU... |
The LanguageInvoker are threads where each type of addons live (normal with gui, service, scripts ecc...) the main problem is that Kodi 18 is EOL, the support is terminated, You can do in this way to not lost your current Kodi data+addons+userdata:
Then to restore Kodi 18:
After this i can open a thread in the Kodi forum to ask to Kodi dev |
Thanks, I have used the “trick” with the .kodi folder a lot. However, how do I upgrade to kodi 19 and downgrade to kodi 18 later on? |
oh good |
Then I’ll be stuck on 19 which is an alpha release which I can not rely on. Since this is my main device for consuming media I am reluctant. I will try to find more info online... |
why? it is only a temporary attempt to understand if the issue persist on Kodi 19 |
I think you stated before that going from kodi 19 back to kodi 18 is not recommended/unwise. I do not want to go to alpha version for normal media consumption... Anyway, I'll find a way to test on kodi 19. I'll keep you posted |
i think you do not understand
|
OK, I succeeded to install Kodi 19 Matrix (and later on downgrade to 18 Leia). After updating to 19, I started with a fresh configuration, added my mysql musicdatabes and added my samba music source. Unfortunately (or not) the problem is exactly the same. Before installing Netflix I tried playback of music, there no increase in CPU usage can be observed. Log here: I then installed Netflix. First I tried it using the repo zip (from https://github.com/castagnait/repository.castagnait/raw/matrix/repository.castagnait-1.0.0.zip). I succesfully installed the zip, it showed the castagnait repository, but it was empty... I installed the version from your dropbox (plugin.video.netflix_1.8.0+matrix.1_20200909.zip). Then I started music playback and observed the high CPU load. Waited for CPU to drop, started playback again and observed high CPU load again. It took between 15 and 60 seconds for the CPU load to drop. Log here: |
good, |
Can you give me a link to the kodi forum thread? |
I did not had time, will do today opened here: https://forum.kodi.tv/showthread.php?tid=357047 |
I investigated some more. I tried the same on my Windows 10 notebook with the same type of results. Observations: It does not matter if kodi is run on Windows or Ubuntu (tried on Windows 10 and Ubuntu 18.04) It does not matter if the music library is stored locally or on a samba share (tried with an external usb hdd with the exact same library). It does not matter if the music database is stored in the local kodi settings folder or in a mysql database. It does matter how large the playlist is you start playback from (400 songs in the database give no problems, 6583 songs shows high cpu usage for a second or two, 25k songs gives unusable behaviour because of high cpu load for more than 30s. If you first select a specific artist (leading to less tracks in the playlist) no increase in CPU is observed). It does matter if you install the netflix addon (without the netflix addon no increase in cpu usage is observed. Also when you install the netflix addon but disable it (leaving all the dependencies enabled), no increase in cpu is observed). It does not matter if you configure the netflix addon or not (I tried both with logged in netflix addon and without any configuration change after installing the addon). It does not matter if you use Kodi 18.8 or Kodi 19 Alpha1 (with the appropriate netflix addon for that kodi version). |
i reported it also to kodi forum, unfortunately it does not help to restrict the field |
@CastagnaIT : it looks like we are suffering from this (general) kodi issue. Netflix addon makes it worse, but the root cause is in the playlist handling... Do you think there is something to do on the Netflix addon side? |
not exactly, the only thing that could be are the Monitor objects a Monitor object is to receive what Kodi do in this moment (events) then receive a sort of message+data so i can put a debug point to see if it gets something |
Here if/when the addon will reveive monitor message we can see in the log something like:
so if we find thousands of these it could be the possible cause |
do we need debug logging for this (kodi and/or netflix)? |
yes better enable kodi debug, nf debug verbose is not really needed but enable it, always without login |
Here you go: What I did: p.s. I noticed that if I disable kodi debug logging and netflix verbose logging the CPU usage goes low quicker (after about 3 minutes and 40 seconds). That might be due to the log flooding with messages. |
This might confirm my suspicions if so, creating an Test addon with the same Monitor objects should present the same CPU problems I will create an addon test and if it confirms this theory, |
nice! |
Try install this test addon, and disable netflix: after reproduce the problem, exit from Kodi only by Power menu>Exit |
Here you go: I waited for cpu to drop to normal values after playback (after about 5minutes, 30s of playback) and then quit kodi. |
do you confirm that also with this test addon the CPU is in high load? |
yes, definitely. It starts when playback is started from a big (~25k songs) playlist and high cpu loads lasts for about 5 minutes 30s. |
good, i will open a thread issue to Kodi to report this problem |
great, keep me posted and please send me a link when you opened the thread on kodi forum... |
@CastagnaIT : I gave all latest(/nightly) versions a try and problem seems to be fixed there (but got another problem). Yeah! I installed:
Lyrics popup after about 10s (which is perfect) regardless of the netflix addon running or not. CPU usage does not go through the roof. Do you need me to do a test with the testplugin you created earlier (will it run on kodi matrix nightly?) However, when I exit Kodi it takes a long time (3 minutes or so). I see in the log that the netflix addon causes the delay ( AppData\Roaming\Kodi\addons\plugin.video.netflix\service.py: script didn't stop in 5 seconds - let's kill it ). |
resolved? how? and on K18 the problem still happens?
yes can be used with both kodi 18-19
i do not know about this delay, |
It does not consume 100% cpu power (at least not more than a few seconds) after starting music playback from a long (play)list (in my case 24k songs).
Agree, but my test case shows improvement. I did not change anything on my side, I only installed all the bleeding edge versions of the packages.
yes
Done, log here: https://bartthbo.stackstorage.com/s/RHRi3ociwQvpoxKx (updated, the test addon was not running in the previous link I shared). Here you see that the test addon still receives all the notifications, but my cpu does not go to 100% anymore...
You can see the delay in the log I linked to in my previous post, there you can see that kodi complains about the netflix addon not closing properly. |
yes have seen, but i have nothing to add to my previous response if for you the current situation with K19 is good, i will close the issue on Kodi GH |
I do not know if it is actually "good". I see in the test addon that all the notification are still caught by your test-plugin, so underwater it is not OK I would say... Still, if I uninstall the netflix addon, the lyrics are shown more quickly and kodi is more responsive... |
I left the thread Issue on Kodi GH opened for future improvements |
@CastagnaIT : thanks for all the help, let's see what the kodi developpers come up with. Keep up the good work on the netflix plugin! |
Bug report
Your Environment
Used Operating system:
Describe the bug
I have reported this bug earlier (#828), but then it was concluded that the CU LRC Lyrics addon was the problem. That addon is fixed and the problem still occurs, even with the lyrics addon not installed.
I started with a vanilla configuration, added my mysql music library (in advancedsettings.xml) and added my samba based music share (containing about 30k tracks). I played back a song from the music->songs menu and kodi cpu usage stayed below 30%. Logging here:
https://paste.kodi.tv/xopeberaya.kodi
Then I installed the netflix addon as well and started playback of the same song. Then CPU spikes to over 100% for about 15s. When I stop playback and start again, CPU spikes again for this 15 seconds. Third time, same result. Log here:
https://paste.kodi.tv/axesurezem.kodi
Expected behavior
CPU usage when starting music playback should not be higher when netflix addon is installed.
Actual behavior
cpu usage spikes for about 15s
Steps to reproduce the behavior
see "describe the bug" section
Possible fix
don't know
Debug log
see "describe the bug" section
Additional context or screenshots (if appropriate)
Installation
Other information
started with a clean config, as described in the "describe the bug" section
Screenshots
The text was updated successfully, but these errors were encountered: