1.15.0 MediaPortal Invisible on Resume from Hibernate (2 Viewers)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I'm agree with you but still the error i have explain about GPU crash, MP will not recover even with releasing render target because GPU card are not more available, but this happen only when GPU is recovered/crashed and for sure there are other devicelost message that can surely be solved by like you explain.

    I will surely add log to know if in @rmeredit case, GPU information are there or not on his system.

    I will supply you the log when i trigger/simulate the GPU recovery and you will see what is happening and i really hope i'm wrong and that releasing render target can be enough :p
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I'm agree with you but still the error i have explain about GPU crash, MP will not recover even with releasing render target because GPU card are not more available...
    I am saying that "GPU card are not more available" because reset failed, and reset failed because the render target was not released.
    Release render target => reset succeeds ==> GPU available again

    Is it clear now? :)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I'm understanding you very clear :)
    Maybe i'm wrong but it seems that we can have different level of GPU failed but like i'm saying, i'm maybe totally wrong.
    Let's hope we can clear correctly render target.
     

    SpudR

    Retired Team Member
  • Premium Supporter
  • July 27, 2007
    2,657
    718
    Yorkshire, UK
    Home Country
    England England
    Glad you guys know WTF is going on - Waaaaaaay above my pay grade...
    FYi, I also had an error with the MusicInfoHandler timing out. Disabled and testing...
    Not sure if at all relevant...
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    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. :(

    It seems that we can't have 'IDirect3DDevice9::CreateAdditionalSwapChain' method on C#.

    Still my simulation doesn't exactly what @rmeredit get in log but like MPC-HC / DVBViewer handle that correctly, we should be able to do it with MP but in my case after disable/enable the card, MP can't get the list of GPU card who was disabled.

    I have added logs :

    Code:
    [2016-10-06 20:22:12,451] [Log    ] [MPMain   ] [DEBUG] - D3D: Init()
    [2016-10-06 20:22:13,616] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:22:14,368] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:15,054] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:15,058] [Log    ] [MPMain   ] [DEBUG] - D3D: Init Adapter #0: NVIDIA GeForce GTX 460 - Driver: nvd3dum.dll (10.18.13.6839) - DeviceName: \\.\DISPLAY10
    [2016-10-06 20:22:15,059] [Log    ] [MPMain   ] [DEBUG] - D3D: Init Adapter #1:  - Driver:  (0.0.0.0) - DeviceName:
    [2016-10-06 20:22:15,059] [Log    ] [MPMain   ] [DEBUG] - D3D: Init Adapter #2:  - Driver:  (0.0.0.0) - DeviceName:
    [2016-10-06 20:22:24,929] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:22:25,622] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:26,224] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:26,245] [Log    ] [MPMain   ] [DEBUG] - D3D: Starting and find Enumeration Settings - retry 0
    [2016-10-06 20:22:26,808] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:22:27,405] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:28,008] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:28,011] [Log    ] [MPMain   ] [DEBUG] - D3D: Starting and find Adapter info - retry #0
    [2016-10-06 20:22:28,659] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:22:29,263] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:29,901] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information :
    [2016-10-06 20:22:30,525] [Log    ] [MPMain   ] [DEBUG] - D3D: FindAdapterForScreen Adapter #0: NVIDIA GeForce GTX 460 - Driver: nvd3dum.dll (10.18.13.6839) - DeviceName: \\.\DISPLAY10
    [2016-10-06 20:22:31,253] [Log    ] [MPMain   ] [DEBUG] - D3D: Starting and find Adapter #0: NVIDIA GeForce GTX 460 - retry #1

    Against when on MP start :
    Code:
    [2016-10-06 20:19:17,341] [Log    ] [MPMain   ] [DEBUG] - D3D: Init()
    [2016-10-06 20:19:18,058] [Log    ] [MPMain   ] [DEBUG] -  D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:19:18,718] [Log    ] [MPMain   ] [DEBUG] -  D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:19,526] [Log    ] [MPMain   ] [DEBUG] -  D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:19,535] [Log    ] [MPMain   ] [DEBUG] - D3D: Init Adapter #0: NVIDIA GeForce GTX 460 - Driver: nvd3dum.dll (10.18.13.6839) - DeviceName: \\.\DISPLAY10
    [2016-10-06 20:19:19,536] [Log    ] [MPMain   ] [DEBUG] - D3D: Init Adapter #1: Intel(R) HD Graphics 4000 - Driver: igdumdim32.dll (10.18.10.4425) - DeviceName: \\.\DISPLAY85
    [2016-10-06 20:19:19,536] [Log    ] [MPMain   ] [DEBUG] - D3D: Init Adapter #2: Intel(R) HD Graphics 4000 - Driver: igdumdim32.dll (10.18.10.4425) - DeviceName: \\.\DISPLAY86
    [2016-10-06 20:19:19,941] [Log    ] [MPMain   ] [DEBUG] -  D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:19:20,303] [Log    ] [MPMain   ] [DEBUG] -  D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:20,612] [Log    ] [MPMain   ] [DEBUG] -  D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:20,613] [Log    ] [MPMain   ] [DEBUG] - D3D: Starting and find Enumeration Settings - retry 0
    [2016-10-06 20:19:29,481] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:19:30,238] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:30,982] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:30,984] [Log    ] [MPMain   ] [DEBUG] - D3D: Starting and find Adapter info - retry #0
    [2016-10-06 20:19:35,303] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : NVIDIA GeForce GTX 460
    [2016-10-06 20:19:35,885] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:36,173] [Log    ] [MPMain   ] [DEBUG] - D3DEnumeration ai.Information : Intel(R) HD Graphics 4000
    [2016-10-06 20:19:36,427] [Log    ] [MPMain   ] [DEBUG] - D3D: FindAdapterForScreen Adapter #2: Intel(R) HD Graphics 4000 - Driver: igdumdim32.dll (10.18.10.4425) - DeviceName: \\.\DISPLAY86
    [2016-10-06 20:19:36,800] [Log    ] [MPMain   ] [DEBUG] - D3D: Starting and find Adapter #2: Intel(R) HD Graphics 4000 - retry #1

    We can see clearly that Intel(R) HD Graphics 4000 is no more detected until MP restart.

    So we have both thing to fix :
    - When GPU hung -> add a restart of MP because for now it's not possible to retrieve GPU card list and other information from 'Microsoft.DirectX.Direct3D.Manager.Adapters'
    - Trying to fix render target etc. (or have a wait loop with a timeout and trying to properly release it until all was ok and let MP rendering)
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    It seems that we can't have 'IDirect3DDevice9::CreateAdditionalSwapChain' method on C#.
    Quick Google search tells me it is done like this:
    https://msdn.microsoft.com/en-us/library/windows/desktop/bb153281(v=vs.85).aspx
    Code:
    SwapChain sc = new SwapChain(device, presentParams);

    - When GPU hung -> add a restart of MP because for now it's not possible to retrieve GPU card list and other information from 'Microsoft.DirectX.Direct3D.Manager.Adapters'
    As I said in my previous replies, I think restarting is only necessary if we can't reset properly. My opinion is that failure to receive the GPU card list is due to failure to reset. As it says in the documentation:
    https://msdn.microsoft.com/en-us/library/windows/desktop/bb174425(v=vs.85).aspx
    In addition, when IDirect3DDevice9::Reset fails, the only valid methods that can be called are IDirect3DDevice9::Reset, IDirect3DDevice9::TestCooperativeLevel, and the various Release member functions. Calling any other method can result in an exception.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Thanks :)
    I have done a quick try and for sure like you explain the reset failed hard (it failed for both line):

    Code:
                    SwapChain sc = new SwapChain(GUIGraphicsContext.DX9Device, _presentParamsBackup);
                    GUIGraphicsContext.DX9Device.Reset(_presentParamsBackup);

    When i disable/enable the card, GUIGraphicsContext.DX9Device is no longer valid along with 'Microsoft.DirectX.Direct3D.Manager.Adapters'

    So 'SwapChain sc = new SwapChain(GUIGraphicsContext.DX9Device, _presentParamsBackup);' failed too because of GUIGraphicsContext.DX9Device
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I expect it to fail like that. In order to have a chance of working, the swap chain must be integrated properly from MP startup (ie. D3D/DX init) including replacement of Device.Present() with SwapChain.Present() etc. etc. etc. I think that's going to be quite a lot of work, and unfortunately I don't have the skill to do it.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    No luck :(

    After many try, until we are not able to retrieve list of GPU card after a recovery from Windows, it's even no need to try to fix the rendertarget or swapchain etc :(
    The only way that i have quite succeeded was about to start new mediaportalApp inside already started one but after it doesn't work well.
    So in case of GPU driver crash, the only way is to restart MP (but i have two gpu card so maybe it's why it was working lol).

    What can be done is to have a loop running to check if D3D device is ready.
    It seems that DX11 can be handled correctly :)

    Or maybe make a real big rework to have some kind of process before the window form that analyse the device and know where to create the form with GPU failed (but still we can't solve the issue of GPU no more retrieved after a recovery/crash of GPU driver.

    @rmeredit did you try the mediaportal.exe attached few post back ?
     

    Users who are viewing this thread

    Top Bottom