1.15.0 MediaPortal Invisible on Resume from Hibernate (1 Viewer)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    You can use deploy separate installer to update to another MP version and like explain MM, you can backup your data before proceed, i'm used to that for testing :)

    To do that :

    1- Clean your %temp% folder
    2- Start the full installer (what ever is 1.15 1.14 etc.)
    3- Close the installer (or cancel)
    4- Go to your %temp% and in \MediaPortal Installation\deploy, you can find here both installer, it's the installer start using the full one but with other check etc.
    5- Install first : package-mediaportal.exe and then package-tvengine.exe (if you use TV).

    When doing that, you will use the version that full installer extract.

    Based on MM comment, when GPU crash, MP can't be working, when working that issue, it was not possible to do a fully recover when driver crash or when simulate a crash (by disabling GPU and re-enable it) when doing that MP didn't detect the new D3D GPU card, no clue why, i think it's maybe DX9 C# related.

    So for sure something happen, now maybe MP on resume trigger something that lead to GPU crash, from your log, we can see dispose font before the devicelost message, it's kinda on resume, MP react like left code not executed on shutdown (i'm not sure of that lol).
     

    SpudR

    Retired Team Member
  • Premium Supporter
  • July 27, 2007
    2,657
    718
    Yorkshire, UK
    Home Country
    England England
    Just a quick FYI
    I have had something similar and noticed that the nVidia drivers are crashing and recovering. That really buggers up the playback!
    My Event Viewer reports errors with KERNEL.DLL or somesuch...
    Nvidia driver version 372.90

    Not sure whether related or not - but worth posting JIC.
     
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Maybe it's a side effect of GPU drivers crash :

    "10/3/2016 8:47:05 AM";"Display";"(0)";"Warning";"Display driver igfx stopped responding and has successfully recovered.";"4101"

    and from MP.log :
    [2016-10-03 08:47:33,377] [Log ] [MPMain ] [DEBUG] - GUIFont:texture disposing:0 debug

    So 30 secs in between (this delay comes from the 30 secs is the option delay).
    So the drivers crash and recover but we know that when it happen MP can't work after that and this is surely why we get the dispose and after all kind of errors messages about GPU.

    I think we can't do nothing right now about that because when testing/simulate the crash MP or i would say .NET didn't know/detect the new D3D GPU from the current Form Window instance lol.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I think we can't do nothing right now about that because when testing/simulate the crash MP or i would say .NET didn't know/detect the new D3D GPU from the current Form Window instance lol.
    Yes, I seem to remember Scythe42 and/or you discovering this. I will try to find some time to do some research about whether this is actually true. On my system (still XP), DVBViewer (written in Delphi) seems to be able to do it... or at least, it seems more resilient than MP. It can handle Window resize (which I know usually triggers D3D device lost), windowed/full-screen switching etc. much better.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I have retry yesterday while debugging and when disable/enable GPU card, in C# the manager class is not more filled correctly from the current windows form instance.
    The solution is to close MP and restart it lol.

    I will try how dvbviewer handle this too later :p

    The manager (Microsoft.DirectX.Direct3D.Manager.Adapters) is no more filled correctly and no clue why maybe there some kind of trick to have it correctly, then we can maybe doing something to reset properly the D3D device etc.

    [2016-10-04 20:13:19,906] [Log ] [MPMain ] [INFO ] - Main: GPU_HUNG - Error in the application.
    -2005530512 (Unknown)
    at Microsoft.DirectX.Direct3D.Device.PresentInternal(tagRECT* sourceRectangle, tagRECT* destRectangle, IntPtr overrideWindow)
    at Microsoft.DirectX.Direct3D.Device.Present()
    at MediaPortalApp.Render(Single timePassed) in D:\svnroot\MediaPortal-1_Fork_1\mediaportal\MediaPortal.Application\MediaPortal.cs:line 3610
    [2016-10-04 20:13:19,908] [Log ] [MPMain ] [DEBUG] - D3D: RecoverDevice()
    [2016-10-04 20:13:19,910] [Log ] [MPMain ] [DEBUG] - Main: RecreateSwapChain()
    [2016-10-04 20:13:19,962] [Log ] [MPMain ] [DEBUG] - GUIFontManager: SafeDispose()
    [2016-10-04 20:13:19,984] [Log ] [MPMain ] [DEBUG] - TextureManager: Dispose()
    [2016-10-04 20:13:19,985] [Log ] [MPMain ] [INFO ] - TexturePacker:Dispose()
    [2016-10-04 20:13:19,985] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1997
    [2016-10-04 20:13:19,986] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1986
    [2016-10-04 20:13:19,987] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1996
    [2016-10-04 20:13:19,987] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1987
    [2016-10-04 20:13:19,988] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1982
    [2016-10-04 20:13:19,988] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1995
    [2016-10-04 20:13:19,989] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1993
    [2016-10-04 20:13:19,989] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1991
    [2016-10-04 20:13:19,989] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1990
    [2016-10-04 20:13:19,990] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1981
    [2016-10-04 20:13:19,990] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1984
    [2016-10-04 20:13:19,991] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1992
    [2016-10-04 20:13:19,991] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1978
    [2016-10-04 20:13:19,992] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1974
    [2016-10-04 20:13:19,992] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1977
    [2016-10-04 20:13:19,992] [Log ] [MPMain ] [INFO ] - TexturePacker: remove texture:1976
    [2016-10-04 20:13:19,996] [Log ] [MPMain ] [DEBUG] - Main: RecreateSwapChain() by restoring startup DirectX values
    [2016-10-04 20:13:20,153] [Log ] [MPMain ] [DEBUG] - D3D CleanupEnvironment()
    [2016-10-04 20:13:30,061] [Log ] [MPMain ] [DEBUG] - D3D: Init()
    [2016-10-04 20:13:46,727] [Log ] [MPMain ] [DEBUG] - D3D: Init Adapter #0: NVIDIA GeForce GTX 460 - Driver: nvd3dum.dll (10.18.13.6839) - DeviceName: \\.\DISPLAY10
    [2016-10-04 20:13:46,728] [Log ] [MPMain ] [DEBUG] - D3D: Init Adapter #1: - Driver: (0.0.0.0) - DeviceName:
    [2016-10-04 20:13:46,728] [Log ] [MPMain ] [DEBUG] - D3D: Init Adapter #2: - Driver: (0.0.0.0) - DeviceName:
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Well i have made some test :)
    DVBViewer works.
    Kodi crash lol.

    @rmeredit can you try the attached bin ? (backup original before).
    I have add a restart of MP when GPU crash.
     

    Attachments

    • MediaPortal_restart.zip
      503.9 KB

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    @Sebastiii
    I wonder if the problem/limitation is that we should be (but are not!) releasing the render target before calling reset:
    https://msdn.microsoft.com/en-us/library/windows/desktop/bb174425(v=vs.85).aspx
    Before calling the IDirect3DDevice9::Reset method for a device, an application should release any explicit render targets, depth stencil surfaces, additional swap chains, state blocks, and D3DPOOL_DEFAULT resources associated with the device.

    This is difficult for us because our render target is the main form/window. That could be why reset doesn't work unless MP is restarted.

    I found this suggestion which may help:
    http://stackoverflow.com/questions/...-in-slimdx-dx9-without-disposing-all-device-r

    I don't understand enough about D3D, back buffers etc. to fix this problem. :(
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Thanks :)

    That could be a nice idea for ex when with switch from full-screen to windowed or reverse, this will avoid to call reset which is slow :p
    But i think it will not correct the issue when the driver is recovered from windows because when it happen, it's like the GPU card doesn't exist anymore.

    From my POV (while debugging) The manager (Microsoft.DirectX.Direct3D.Manager.Adapters) seems to be filled with all correct information when the windows form is created but when the driver crash and recovered (that seems to happen for @rmeredit) the Microsoft.DirectX.Direct3D.Manager.Adapters along with Screen.... call are filled with 0 value for the new recovered GPU card and i have try different thing the only way was to restart MP (because a new windows form is created).

    So effectively , we missed surely something because dvbviewer handle it correctly and i think it works with DX9 but Kodi for ex directly crash.

    Yes me too backbuffer stuff and co and not easy for me but still it will surely possible to make it works, maybe we need to test other open source C# and find one that can handle it and understand why lol.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    But i think it will not correct the issue...
    I humbly and respectfully disagree. :)

    We can check the log files...
    [2016-10-03 08:47:35,019] [Log ] [MPMain ] [WARN ] - Main: OnDeviceLost()
    [2016-10-03 08:47:35,019] [Log ] [MPMain ] [DEBUG] - Main: OnDeviceLost CurrentState : LOST
    [2016-10-03 08:47:35,029] [Log ] [MPMain ] [DEBUG] - D3D: RecoverDevice()
    [2016-10-03 08:47:35,029] [Log ] [MPMain ] [DEBUG] - Main: RecreateSwapChain()
    [2016-10-03 08:47:35,049] [Log ] [MPMain ] [DEBUG] - GUIFontManager: SafeDispose()
    [2016-10-03 08:47:35,059] [Log ] [MPMain ] [DEBUG] - TextureManager: Dispose()
    [2016-10-03 08:47:35,069] [Log ] [MPMain ] [INFO ] - TexturePacker:Dispose()
    [2016-10-03 08:47:35,069] [Log ] [MPMain ] [DEBUG] - Main: RecreateSwapChain() by restoring startup DirectX values
    [2016-10-03 08:47:35,079] [Error ] [MPMain ] [ERROR] - D3D: D3DERR_INVALIDCALL - presentation parameters might contain an invalid value
    [2016-10-03 08:47:35,119] [Log ] [MPMain ] [DEBUG] - GraphicContext: Loading settings from C:\ProgramData\Team MediaPortal\MediaPortal\ScreenCalibration1920x1080.fs.xml
    [2016-10-03 08:47:35,119] [Log ] [MPMain ] [DEBUG] - Skin Folder : C:\ProgramData\Team MediaPortal\MediaPortal\Skin\Titan
    [2016-10-03 08:47:35,129] [Log ] [MPMain ] [DEBUG] - Cache Folder: C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Titan
    ...

    IMHO the bolded part is the problem. That error message seems to be ignored, and MP carries on. I think that is wrong; the error should not be ignored, because it means that reset/recover failed. MP cannot be stable after that unless we find out how to reset/recover the device properly. My suggestion is an idea for solving that error => successful reset/recover.

    So to be clear, we dispose fonts (font manager), textures (texture manager, texture packer)... but it seems that we do not dispose the render target (which is the main form/window), and that's what I think the problem is.

    Does that make more sense?
     

    Users who are viewing this thread

    Top Bottom