[fixed] Anti Aliasing branch issue (1 Viewer)

Smeulf

Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hello,

    Want to mention that at current state, anti aliasing branch can cause Video to became fully black because of a DirectX lost.

    How to reproduce : with AA enabled (didn't tried without), play a video in fullscreen. Minimize the client, restore it to fullscreen. Can needs multiple tries. After one or 2 minimize here, I have a black screen and the following error. Pauseing/restarting the video doesn't restore the video.

    Cheers.

    Smeulf.

    Code:
    [2012-02-19 20:32:33,586] [24330  ] [AMQ 'ScreenManager'] [DEBUG] - ScreenManager: Showing screen 'FullscreenContentVideo'...
    [2012-02-19 20:32:33,587] [24331  ] [Thread78 ] [INFO ] - WorkflowManager: Screen was updated by workflow model
    [2012-02-19 20:32:41,097] [31841  ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device
    SlimDX.Direct3D9.Direct3D9Exception: Unknown: n/a (-2005530510)
       à SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
       à SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
       à SlimDX.Result.Record[T](Int32 hr, Object dataKey, Object dataValue)
       à SlimDX.Direct3D9.DeviceEx.PresentEx(Present flags)
       à MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)
    [2012-02-19 20:32:41,109] [31853  ] [DX Render] [DEBUG] - SkinEngine MainForm: Render thread stopped
    [2012-02-19 20:32:41,149] [31893  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-19 20:32:41,378] [32122  ] [Main     ] [DEBUG] - ContentManager: Freeing all assets
    [2012-02-19 20:32:41,382] [32126  ] [Main     ] [DEBUG] - ContentManager: All assets freed
    [2012-02-19 20:32:41,383] [32127  ] [Main     ] [DEBUG] - SkinEngine MainForm: Starting render thread
    [2012-02-19 20:32:44,408] [35152  ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device
    SlimDX.Direct3D9.Direct3D9Exception: Unknown: n/a (-2005530510)
       à SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
       à SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
       à SlimDX.Result.Record[T](Int32 hr, Object dataKey, Object dataValue)
       à SlimDX.Direct3D9.DeviceEx.PresentEx(Present flags)
       à MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)
    [2012-02-19 20:32:44,420] [35164  ] [DX Render] [DEBUG] - SkinEngine MainForm: Render thread stopped
    [2012-02-19 20:32:44,425] [35169  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-19 20:32:44,425] [35169  ] [Main     ] [DEBUG] - SkinEngine MainForm: Starting render thread
    [2012-02-19 20:32:45,880] [36624  ] [InputMgr ] [DEBUG] - VideoPlayer: Pause
    [2012-02-19 20:32:46,596] [37340  ] [InputMgr ] [DEBUG] - VideoPlayer: Resume
    [2012-02-19 20:32:47,971] [38715  ] [InputMgr ] [DEBUG] - VideoPlayer: Stop
    [2012-02-19 20:32:47,978] [38722  ] [InputMgr ] [DEBUG] - VideoPlayer: Stop playing
    [2012-02-19 20:32:48,034] [38778  ] [InputMgr ] [DEBUG] - VideoPlayer: Graph state after stop command: Stopped
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    Are you sure that this happens only on AA branch? Besides major refactorings I think there were no substantial changes to the device handling.

    One issue I could imagine is, that there were changes from DirectX9->DirectX9Ex and device lost handling. I will look again where I've read about those changes.

    Also our code treats every exception as device lost, so there could be minor things that could be ignored.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hi Morpheus,

    I just checked again : I could restore from minimized to fullscreen a dozen of time at Dev, without any error in the log, but not even one at AA branch. I had the error as soon as I tried to restore the window. If I correctly reads the logs, Dev is "AA's mother branch".

    It's too much to be only a coincidence, so I'm 99.999999% certain it's only in AA branch ;)

    A bit more logs this time (just uncolapse) :

    Code:
    [2012-02-20 21:54:45,348] [17710  ] [AMQ 'ScreenManager'] [DEBUG] - ScreenManager: Showing screen 'FullscreenContentVideo'...
    [2012-02-20 21:54:45,348] [17710  ] [Thread64 ] [INFO ] - WorkflowManager: Screen was updated by workflow model
    [2012-02-20 21:54:47,954] [20316  ] [DX Render] [WARN ] - GraphicsDevice: Lost DirectX device
    SlimDX.Direct3D9.Direct3D9Exception: Unknown: n/a (-2005530510)
       à SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
       à SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
       à SlimDX.Direct3D9.DeviceEx.PresentEx(Present flags)
       à MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)
    [2012-02-20 21:54:47,965] [20327  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,005] [20367  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,028] [20390  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,039] [20401  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,114] [20476  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,116] [20478  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,136] [20498  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,223] [20585  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,225] [20587  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,237] [20599  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,332] [20694  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,335] [20697  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,346] [20708  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,442] [20804  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,444] [20806  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,456] [20818  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,550] [20912  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,561] [20923  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,572] [20934  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,662] [21024  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,663] [21025  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,673] [21035  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,769] [21131  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread
    [2012-02-20 21:54:48,771] [21133  ] [DX Render] [DEBUG] - SkinEngine MainForm: Starting main render loop
    [2012-02-20 21:54:48,783] [21145  ] [DX Render] [DEBUG] - SkinEngine MainForm: Main render loop was stopped
    [2012-02-20 21:54:48,880] [21242  ] [Main     ] [DEBUG] - SkinEngine MainForm: Stoping render thread

    Cheers.

    Smeulf.
     

    Albert

    MP2 Developer
  • Premium Supporter
  • February 18, 2008
    1,297
    1,130
    47
    Freiburg im Breisgau, Germany
    Home Country
    Germany Germany
    In the AA branch, I added a proper device reset for each size change of the window, so minimizing the window and restoring it will do a reset, which first releases all resources and then reallocates them.
    I'll have a look at that problem. Maybe it points me to a problem with releasing resources.
    Thanks Smeulf!
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    This is a good reading:

    Unlike previous versions of DirectX, calling IDirect3DDevice9Ex::ResetEx does not cause surfaces, textures or state information to be lost.
    Pixel shaders and vertex shaders survive IDirect3DDevice9Ex::ResetEx calls for Direct3D 9. They do not need to be re-created explicitly by the application.

     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    Smeulf:
    I could not manage to get this excpeption here, no matter how often I minimized/restored the window. So maybe some special NVidia behaviour?

    The error code is D3DERR_INVALIDCALL = 0x88760872 (2289436786) which can occure in many places, i.e. calling an "end" method without doing a "begin" before, or when using invalid arguments.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    The error code is D3DERR_INVALIDCALL = 0x88760872 (2289436786) which can occure in many places, i.e. calling an "end" method without doing a "begin" before, or when using invalid arguments.

    To debug those D3DERR_INVALIDCALL (or any other DirectX errors) instlal DirectX Control panel and turn on the debug mode binaries for DirectX. Then just hook DebugView and you can get much more detailled information about the errors.
     

    Smeulf

    Retired Team Member
  • Premium Supporter
  • October 27, 2010
    672
    454
    France
    Home Country
    France France
    Hi,

    It's very much better with you last commits : I can't reproduce the bug anymore.

    Just I still have the warning in the logs, but without side effect apparently :

    Code:
    [2012-02-26 22:03:12,074] [374315 ] [DX Render] [WARN ] - GraphicsDevice: DirectX Exception, DeviceState: Ok, DeviceLost: False
    SlimDX.Direct3D9.Direct3D9Exception: Unknown: n/a (-2005530510)
       à SlimDX.Result.Throw[T](Object dataKey, Object dataValue)
       à SlimDX.Result.Record[T](Int32 hr, Boolean failed, Object dataKey, Object dataValue)
       à SlimDX.Direct3D9.DeviceEx.PresentEx(Present flags)
       à MediaPortal.UI.SkinEngine.DirectX.GraphicsDevice.Render(Boolean doWaitForNextFame)

    So I would say fixed.

    Smeulf.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,070
    7,459
    Home Country
    Germany Germany
    I think this issue is currently avoided by my locking fix and the changes regarding exception handling.

    Albert plans to rework the AssetCore classes later to prevent the issues, this should be not handled in this thread...
     

    Users who are viewing this thread

    Top Bottom