MP crashes sometimes after resume from Standby (2 Viewers)

HomeY

Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands

    blub

    MP Donator
  • Premium Supporter
  • October 1, 2013
    223
    82
    Giessen
    Home Country
    Germany Germany
    Ahh I seee!

    Ok do you think it makes sense an might help to improve the situation ? - sending the HTPC to sleep directly in MP instead of going directly through windows/iMon?
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I'm not sure to follow but MP get/receive WIndows message when going to STB :)
    You can try to simulate a STB and Wakeup by using 'SendMessage' but like Audio device will be not removed (or maybe you can turn it off after send suspend message) it will surely not crash.
     

    Attachments

    • SendMessage-1.1.2.zip
      88.8 KB

    blub

    MP Donator
  • Premium Supporter
  • October 1, 2013
    223
    82
    Giessen
    Home Country
    Germany Germany
    I'm not sure to follow but MP get/receive WIndows message when going to STB :)

    yea I think there might be a misunderstanding.

    What I am taking about is the "way the information flows":

    In a "normal setup" users mostly have a MCE remote control attached via USB and Mediaportal does directly receive/communicate the commands from the remote/USB-adapter. Hence if the user presses "power off" Mediaportal initiates the go to sleep action.

    In my setup the IR-remote only communicates with the iMon software which then translates the buttons on my remote to keyboard shortcuts for Mediaportal. However the power off command is not mapped to MP it is mapped directly to a windows function and windows initiates the go to sleep action.

    And here is what I was thinking:
    In my setup when I press "power off" windows starts already going to sleep and then "telling" MP -> "time to sleep buddy, hurry up" and maybe MP doesn't always executes the tasks necessary for a clean sleep because it is running "out of time" with the result MP being frozen on the next resume.

    So if my thinking has a slight possibility of being correct from a programmers point of view I would try to change the way the "go to sleep" information is handled.
    If you say nope, not possibl, I would spare myself the time of adding a MP-Function/Keyboard Shortcut and mapping it in iMon-Manager.
     

    HomeY

    Test Group
  • Team MediaPortal
  • February 23, 2008
    6,475
    4,645
    49
    ::1
    Home Country
    Netherlands Netherlands
    So if my thinking has a slight possibility of being correct from a programmers point of view I would try to change the way the "go to sleep" information is handled.
    Setup the PowerScheduler plugin so that the system goes into S3 after an xx number of minutes?
    PowerScheduler also triggers/configures the Windows Powersettings, so i don't think it'll make a difference, but worth a try.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    MCE didn't send special command to MP.
    MP receive Windows message, so i can confirm that MP should do the standby process as soon as possible because windows will not wait MP finish the process.

    So i can confirm that if i use MCE remote, MP react on Windows message, so it act like if you use the tool i have post :)

    Now with PS++, maybe MP can pause Windows Standby process until MP finish all what it has to do :)

    I can say that if i debup MP and set some BreakPoint in standby part of code. System will go in standby and it didn't wait MP finish the job (PS++ not enable).

    Maybe @michael_t can explain a little more too :)
     

    blub

    MP Donator
  • Premium Supporter
  • October 1, 2013
    223
    82
    Giessen
    Home Country
    Germany Germany
    OK that message seem to be logged every time now:

    Code:
    [2014-04-13 21:57:53,710] [Error  ] [MPMain   ] [ERROR] - MediaPortal stopped due to an exception Der Wert darf nicht NULL sein. mscorlib    bei System.Threading.Monitor.ReliableEnter(Object obj, Boolean& lockTaken)
       bei MediaPortal.Player.BaseTSReaderPlayer.UpdateCurrentPosition()
       bei MediaPortal.Player.BaseTSReaderPlayer.get_Duration()
       bei MediaPortal.Player.g_Player.get_Duration()
       bei MediaPortalApp.OnProcess()
       bei MediaPortal.D3D.OnIdle(Object sender, EventArgs e)
       bei System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
       bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       bei System.Windows.Forms.Application.Run(Form mainForm)
       bei MediaPortalApp.Main(String[] args)

    logs attached.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    It happen to me too (on fork) when i use stop playback in a different thread.
    This mean, Stop is handle in a second thread but in main thread MP act like stop is not done and then when get_Duration() code is hit -> boom !!!!

    So current Standby code (the WIP) is not correct.
    @michael_t :) (any idea ?)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Yep by looking log :
    Code:
    [2014-04-13 21:57:53,756] [Error  ] [PowerBroadcast Thread] [ERROR] - VMR9: Dispose() from wrong thread
    The message is clear :)
     

    Users who are viewing this thread

    Top Bottom