Concept: Switch MP2 to D3D11/D2D rendering (1 Viewer)

hofi

MP Donator
  • Premium Supporter
  • February 19, 2009
    301
    46
    Ardagger Markt
    Home Country
    Austria Austria
    Did a test on Windows 10 technical preview, but there is only a black screen with mouse cursor, if i use the cursor buttons on IRFB i hear the switching between the plugins.
    On the Server with Windows 2012 i testet this version also, and there it's okay.
    SpreenshotDX11.PNG
     

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    @Developers , mainly @Stéphane Lenclud could you help in D2D debugging? Issue seems to be a D2D effect with two input sources (image 1 + 2 for transition) and a set of parameters. When calling the effect rendering, I get an "INVALID_ARG" then all further calls an "INVALID_STATE".

    The render starts here, coming with 2 inputs: https://github.com/MediaPortal/Medi...gement/AssetCore/EffectAssetCore.cs#L195-L197.

    The calling code is the ImageContext, StartRenderTransition:
    https://github.com/MediaPortal/Medi...kinEngine/Rendering/ImageContext.cs#L218-L243

    The ImageTransitionEffect is defined here: https://github.com/MediaPortal/Medi...isuals/Effects2D/ImageTransitionEffect.cs#L67. The attributes on member properties are used for SharpDX parameter mappings to the data structure (is set as "Constant Buffer" to the shader(s)).

    I think I already have double checked all types and indexes of variables and also order of constant buffer, but somewhere an issue is hiding :( It also could be a problem with the later combined shader sub functions for transitions (they are selected randomly).

    Still don't have MP2 clone here I'm afraid.

    Not sure what gives you "INVALID_ARG" and "INVALID_STATE". Are those DX error codes or SharpDX?
    Typically a shader will take a certain set of input arguments (attributes or unifroms), maybe that's your problem.
    I would recommend you try implementing your transition effects outside MP.
    This SharpDX library your are using surely comes with some examples you could modify to test your transitions?
    Did it get broken when porting from one version of DX to another? Are you sure your are using the SharpDX library that works with the newer version of DX?
     

    aspik

    Retired Team Member
  • Team MediaPortal
  • April 14, 2008
    1,322
    586
    So far I've noticed two issues, both inside Titanium:
    1. when you open the shutdown menu and scroll up and down few times, everything disappears and the home screen looks like in the attached screenshot.
    2. when you go into settings, then back and then again into settings, the settings menu will have now buttons and not list items (screenshot). Selecting on of the buttons crashes MP2

    Besides screenshots, I also post logs from both "sessions".
     

    Attachments

    • settings.png
      settings.png
      1.1 MB
    • shutdown.png
      shutdown.png
      1.2 MB

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #94
    [2015-05-02 06:44:59,211] [2816 ] [AMQ 'ScreenManager'] [WARN ] - Cannot open bitmapSource: 782140e7-4850-4c4d-9a88-7f670b4f37e2.jpg
    [2015-05-02 06:44:59,212] [2817 ] [AMQ 'ScreenManager'] [WARN ] - Cannot open bitmapSource: ea48bd6e-60d3-45b2-9c35-1ab437cc72fb.jpg
    [2015-05-02 06:44:59,212] [2817 ] [AMQ 'ScreenManager'] [WARN ] - Cannot open bitmapSource: 2c0d5028-e9fe-4eb3-b7fd-b8492b1009d2.jpg
    [2015-05-02 06:44:59,213] [2818 ] [AMQ 'ScreenManager'] [WARN ] - Cannot open bitmapSource: 76d0d121-0b4b-400d-9104-09c7f20ee3a7.jpg
    Also found this.
    Thanks! Both things are normal: this is a "Debug" build where more test plugins are enabled and they don't have own tile images.
    ALT-Enter causes screen to go Black. Had to use ALT-Tab to bring MP2 Client Screen back.
    This is indeed an issue...
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #95
    Did a test on Windows 10 technical preview, but there is only a black screen with mouse cursor, if i use the cursor buttons on IRFB i hear the switching between the plugins.
    On the Server with Windows 2012 i testet this version also, and there it's okay.
    View attachment 164341
    Thanks!

    Seems to be a new issue, effects doesn't work the same way in Win10. The failing function is a D2D1 internal one. So for now I would not spend too much time in debugging Win10 issues until the product goes RTM.
    Code:
    [2015-05-02 19:05:51,790] [1678   ] [DX Render] [WARN ] - GraphicsDevice: DirectX Exception
    SharpDX.SharpDXException: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: Falscher Parameter.
    
       bei SharpDX.Result.CheckError()
       bei SharpDX.Direct2D1.Factory1.GetRegisteredEffects(Guid[] effects, Int32 effectsCount, Int32& effectsReturned, Int32& effectsRegistered)
       bei SharpDX.Direct2D1.Factory1.get_RegisteredEffects()
       bei MediaPortal.UI.SkinEngine.ContentManagement.AssetCore.EffectAssetCore`1.Allocate()
       bei MediaPortal.UI.SkinEngine.ContentManagement.EffectAsset`1.Allocate()
       bei MediaPortal.UI.SkinEngine.Rendering.ImageContext.StartRender(RenderContext renderContext, Color borderColor, Vector4 frameData)
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #96
    Not sure what gives you "INVALID_ARG" and "INVALID_STATE". Are those DX error codes or SharpDX?
    Typically a shader will take a certain set of input arguments (attributes or unifroms), maybe that's your problem.
    I would recommend you try implementing your transition effects outside MP.
    This SharpDX library your are using surely comes with some examples you could modify to test your transitions?
    The error codes are from DX11.1: E_INVALIDARG and E_INVALIDSTATE (for all subsequent calls after the first error appeared). SharpDX is "only" a C# wrapper around DX and D2D APIs.
    Unfortunately there doesn't exist many examples for custom D2D effects, which I use here, especially with 2 inputs. The normal single image render effect is quite similar and is working correctly (after many days of work :()
    Did it get broken when porting from one version of DX to another? Are you sure your are using the SharpDX library that works with the newer version of DX?
    Yes, didn't work yet since the D2D rewrite of those classes. In DX9 version everything is fine. Main issue is that D2D is also another API on top of DX11.1 for 2D drawing operations. This is good for all GUI rendering, but introduces new problems in shader handling: i.e. I cannot control SamplerStates to use other modes than "Clamp" (I need "Border" for all of our uses)
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #97
    So far I've noticed two issues, both inside Titanium:
    1. when you open the shutdown menu and scroll up and down few times, everything disappears and the home screen looks like in the attached screenshot.
    2. when you go into settings, then back and then again into settings, the settings menu will have now buttons and not list items (screenshot). Selecting on of the buttons crashes MP2

    Besides screenshots, I also post logs from both "sessions".
    Thanks! There was an internal driver error which caused a "device lost" and re-creation of device:
    Code:
    [2015-05-02 21:52:39,730] [24580  ] [DX Render] [DEBUG] - ScreenManager: Closing screen 'configuration-section'
    [2015-05-02 21:52:39,917] [24767  ] [DX Render] [WARN ] - GraphicsDevice: DirectX Exception
    SharpDX.SharpDXException: HRESULT: [0x887A0005], Module: [SharpDX.DXGI], ApiCode: [DXGI_ERROR_DEVICE_REMOVED/DeviceRemoved], Message: The GPU device instance has been suspended. Use GetDeviceRemovedReason to determine the appropriate action.
    
       at SharpDX.Result.CheckError()
       at SharpDX.DXGI.SwapChain.Present(Int32 syncInterval, PresentFlags flags)
       at MediaPortal.UI.SkinEngine.DirectX11.GraphicsDevice11.Render(Boolean doWaitForNextFame)
    [2015-05-02 21:52:39,919] [24769  ] [DX Render] [WARN ] - GraphicsDevice: DeviceRemovedReason: HRESULT = 0x887A0020
    [2015-05-02 21:52:39,920] [24770  ] [DX Render] [WARN ] - GraphicsDevice: Resetting DX11 device...
    The error code is:
    DXGI_ERROR_DRIVER_INTERNAL_ERROR
    0x887A0020
    The driver encountered a problem and was put into the device removed state.​
    A driver update could help maybe...

    But an issue remains: after device reset the textures should be re-allocated which doesn't seem to happen :(
     

    jehe

    Portal Pro
    February 15, 2011
    694
    216
    58
    Home Country
    Belgium Belgium
    Hi,
    i have noticed the following in the menu section:
    upload_2015-5-3_11-36-47.png
    After mouse movement:
    upload_2015-5-3_11-39-29.png

    logs added
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #99
    I also have issues with dialogs on my tablet. A driver update to the inbuilt Intel HD graphics is not available. So I hope we can fix this in code. If not we might need a way to disable effects in such cases :(
     

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    So DX9 version did not use D2D. Would it be easier to first just move to DX11 and then consider a move to D2D?
    Maybe you are trying to hammer in 3D stuff into your 2D framework and it does not like that. There should be nothing the 3D framework cannot do in 2D. It's just a specific projection.
     

    Users who are viewing this thread

    Top Bottom