Scythe42's fixes for 1.4.0 (3 Viewers)

Status
Not open for further replies.

Scythe42

Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Mediaportal just crashed again after resume. I reported a similar crash a lot of pages ago (https://forum.team-mediaportal.com/threads/scythe42s-fixes-for-1-4-0.118345/page-4#post-986571). This time it was a bit different.
    Can you try adding a delay in Configuration.exe when the system resumes? Give it like 10 seconds for an extreme try to check if it makes any difference. Even if not I need to see the logs here.

    From the logs I see that some devices wake up several seconds after Windows resumed. That should not be the case. Cannot tell you which one. The first one that wakes up seems to block the system for several seconds - In the meantime MP is already awake, it reactivates PowerScheduler and so on.

    All the DEVICECHANGED messages should happen in a row. There should not be huge delay in between them. In fact they should all come in even before MP tries to resume service.

    Also how did you wake up MP? By keyboard interaction, remote event, moving the mouse?

    It would be a daunting task to properly identify the devices with a name as I need to enumerate dozens of device types.

    But one blocks the wake up of the rest. And MP relies one of the device to be properly back. This can even be a device only used in plugin. Can you please disable all plugins for a test that do not come with MP?

    Also how is you network connected? LAN cable or Wifi? When using Wifi only makes it a difference if you use a cable? Wifi needs a bit longer before network connections are re-established.

    Your current system configuration probably needs a delay before MP can resume until the root cause why there is a delay of several seconds is identified. That should never be the case.
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    This does not happen often, first time since last report from me. But, it happens :p.
    Can you try the attached MediaPortal.exe on top of the current build. No changes, it just logs additional information from your system. Please provide me with a log when the issue does not happen and when it happens. As few interactions in MP as possible to reproduce it.
     

    Attachments

    • ForLightningOnly.7z
      340 KB
    Last edited:

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    I installed the latest build from @hwahrmann on my desktop because i found a bug inside the music player rework. this build doesn't contain your fixes and with this build it works as it should (exiting from topbar and shutdown menu) but maybe some other users can confirm this...i hope :)
    Windowed and/or Fullscreen mode? Any other stuff like always on top checked? When using full screen: is minimize to tray on focus loss checked? Over the Menu Bar, the Top Bar of MP, over a Skin Menu, Alt F4 etc.

    Do not need any logs. Just let me know where it does not work. Will do the fix for you...

    Yeah, that is the hell of offering some stupid configuration options in case a some user might like it. The combinations are endless... (n) Settings Portal :(

    In fact this is an annoying feature and should be removed. It has no real merit. Yes, there will be some kind of user who is used to it.

    It is only there because fullscreen could not be properly minimized before. Now it serves no purpose anymore.

    You do not want to see MP? Then just minimize the goddam window it is still one mouse click or button press or if in fullscreen activate minimization of loss of focus and it goes away when you switch context by whatever means.

    You have multiple screens and do not want to minimize on fullscreen on a focus change? Why the hell did you want to minimize on exit then it then in the first place?

    A more valid argument would be: Top Bar has no feature for minimizing MP. That is an ok feature request.
     
    Last edited:

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    Ok,
    third time writing this post now... as everytime i finished a new idea for testing pops into my head...
    I found why i all the sudden had problems. It turned out that i get the crash everytime. And just before pressing the Post Reply button, i remembered, that after installing the newest build, i wanted to enable threaded plugin loading of plugins. I did that, and a few hours ago, when there were no hibernate/resume cycles, everything worked fine. And now i got the problem and forgot that i fiddled around with that.
    So im sorry to rob your time :(.

    Still, as threaded loading is something you are working on, and it seems not to work perfectly, i attached my logs i did for you.

    Can you try adding a delay in Configuration.exe when the system resumes? Give it like 10 seconds for an extreme try to check if it makes any difference. Even if not I need to see the logs here.
    I added 10 seconds delay on resume. MP still crashes. Logs attached.

    Also how did you wake up MP? By keyboard interaction, remote event, moving the mouse?
    Waking up the htpc with my remote.

    Can you please disable all plugins for a test that do not come with MP?
    When disabling every plugin but the standard mp ones, it works. Logs attached.

    Also how is you network connected? LAN cable or Wifi?
    Cable, fixed ip address.

    Also logs with threaded plugin loading disabled, where everything is fine :).[DOUBLEPOST=1367028816][/DOUBLEPOST]
    This does not happen often, first time since last report from me. But, it happens :p.
    Can you try the attached MediaPortal.exe on top of the current build. No changes, it just logs additional information from your system. Please provide me with a log when the issue does not happen and when it happens. As few interactions in MP as possible to reproduce it.

    You still want me to do that, asi found my problem described above?
    Im happy to, if you need it.
     

    Attachments

    • 10sec NOT OK.rar
      10.9 KB
    • no plugins OK.rar
      8.8 KB
    • NO threaded OK.rar
      11 KB

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Can you please disable all plugins for a test that do not come with MP?
    When disabling every plugin but the standard mp ones, it works. Logs attached.
    Logs look very different. Not all device got reconnected yet. Probably beause there was not enough time between suspend and remove. Does not matter as the 10 seconds did not do the trick.

    As you mentioned it worked without 3rd party plugins. Could you be please so kind and enable on after another until the issues shows up again. Then remove the last one and verify that it is still ok. Enable it again and verify it still hangs. That should tell you which plugin it is. Does not mean that is it only one.

    But I could check it and might have an idea what bad thing it is doing during startup, so the maintainer can adjust his code. Or I see a quick way for MP to deal with such plugins.

    My bet from your logs and the information you provided earlier would be on World Weather/World Weather lite that already showed some incompatibilities. Maybe they go further.
     
    Last edited:

    Lightning303

    MP Donator
  • Premium Supporter
  • September 12, 2009
    798
    577
    Home Country
    Germany Germany
    As you mentioned it worked without 3rd party plugins. Could you be please so kind and enable on after another until the issues shows up again. Then remove the last one and verify that it is still ok. Enable it again and verify it still hangs. That should tell you which plugin it is. Does not mean that is it only one. But I could check it and might have an idea what bad thing it is doing during startup, so the maintainer can adjust his code. Or I see a quick way for MP to deal with such plugins. My bet from your logs and the information you provided earlier would be on World Weather/World Weather lite that already showed some incompatibilities. Maybe they go further.

    I sure can do that. But i will have to do that tomorrow.
    WorldWeather Lite was my first thought aswell, so i already did a testrun with it disabled, had no luck.
    Do you still want me to test your Mediaportal.exe?
     

    Scythe42

    Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Great, that you can do it tomorrow. As it is suspend/resume related it would be nice if you could use the MediaPortal.exe I provided for you with some additional specific login that might help me later.

    Could also be a combination of two plugins together. Always hard to find out it no exception is logged anywhere. Did you check the log directory if some plugin wrote some errors/exceptions to their log files?
     
    Last edited:

    edterbak

    Portal Pro
    March 4, 2008
    2,114
    1,176
    Home Country
    Netherlands Netherlands
    After the mentioned crash, I did a log collection (after crash)
    In your log some scraper has issues with its database and is running amok.

    Found it I think. MPsync syncing to an asleep DB location. (possibly) Will report there if I confirm.

    Can continue testing on this build for now :)
     

    seco

    Retired Team Member
  • Premium Supporter
  • August 7, 2007
    1,575
    1,239
    Home Country
    Finland Finland
    but you should do
    Code:
    public static DBValue GetOptions(String property)
    {
    	try
    	{
    		// UpdateTable();
    		String convertedProperty = property;
    		DatabaseUtility.RemoveInvalidChars(ref convertedProperty);
    		if (optionsCache.ContainsKey(convertedProperty)) return optionsCache[convertedProperty];
     
    		string sqlQuery = "select value from options where property = '" + convertedProperty + "'";
    		SQLiteResultSet results = DBTVSeries.Execute(sqlQuery);
    		if (results.Rows.Count > 0)
    		{
    			string res = DatabaseUtility.Get(results, 0, "value");
    			lock(thisLock)
    			{
    				if(!optionsCache.ContainsKey(property))
    					optionsCache.Add(property, res);
    			}
    			return res;
    		}
    	}
    	catch (Exception ex)
    	{
    		MPTVSeriesLog.Write("An Error Occurred (" + ex.Message + ").");
    	}
    	return null;
    }

    I'm not sure if this is correct. If the idea is to synchronize access to optionsCache, the following line does not work correctly

    Code:
    if (optionsCache.ContainsKey(convertedProperty)) return optionsCache[convertedProperty];

    After the if-check optionsCache can be modified by another thread and if the item is removed the return will fail?
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom