Restore from minimized broken in Vista (3 Viewers)

Swede

Portal Pro
September 6, 2006
493
47
West Coast Archipelago
Home Country
Sweden Sweden
Still have to say that minimize/restore does not work properly in Vista or if it is my Nvidia 7600 GS GPU
  1. Some textures dissapear
  2. TV Series can go heywild
  3. Some DX errors occur
2009-03-11 08:16:08.760588 [ERROR][MPMain]: render exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at MediaPortal.GUI.Library.GUIImage.FontEngineDrawTexture(Int32 textureNo, Single x, Single y, Single nw, Single nh, Single uoff, Single voff, Single umax, Single vmax, Int32 color, Single[,] matrix)
at MediaPortal.GUI.Library.GUIImage.Render(Single timePassed)
at MediaPortal.GUI.Library.GUIControl.DoRender(Single timePassed, UInt32 currentTime)
at MediaPortal.GUI.Library.GUIWindow.Render(Single timePassed)


and
2009-03-11 08:14:06.310418 [ERROR][16]: Exception : System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.DirectX.Direct3D.VertexBuffer.InternalLock(Int32 offsetToLock, Int32 size, Int32 flags)
at Microsoft.DirectX.Direct3D.VertexBuffer.Lock(Int32 offsetToLock, Type typeVertex, LockFlags flags, Int32[] ranks)
at Microsoft.DirectX.Direct3D.VertexBuffer.Lock(Int32 offsetToLock, LockFlags flags)
at MediaPortal.Player.PlaneScene.DrawTextureSegment(VertexBuffer vertexBuffer, Single srcX, Single srcY, Single srcWidth, Single srcHeight, Single dstX, Single dstY, Single dstWidth, Single dstHeight, Int64 lColorDiffuse)
at MediaPortal.Player.PlaneScene.DrawTexture(UInt32 texAddr, Int64 lColorDiffuse)
at MediaPortal.Player.PlaneScene.RenderLayer(Single timePassed)
at MediaPortal.GUI.Library.GUILayerManager.Render(Single timePassed)
at MediaPortalApp.RenderFrame(Single timePassed)


What changed in the code regarding minimize to tray since RC3 wich worked perfectly?. The strange behavior came in one of the RC3 SVN´s

Maybe one of these?
- 0001543: [general] MediaPortal gets minimized to tray by pop up windows of external applications (infinityloop) - closed.
- 0001768: [general] Minimize to tray on GUI exit doesnt work (Vista) (Tourettes) - closed.
- 0001713: [Skin Engine] Resizing MediaPortal in windowed mode is not handled correctly (Vista) (Tourettes) - closed.
 

Swede

Portal Pro
September 6, 2006
493
47
West Coast Archipelago
Home Country
Sweden Sweden
Could someone please tell me if it could be as easy as that only some GPU's are really using packed textures? That would explain a lot.

If I do a minimize+restore and then check the log in XP SP3 with ATI Radeon 9600XT Bravo, I get:
2009-03-12 08:55:23.609375 [Info.][MPMain]: D3D: Restoring from tray


If I do a minimize+restore and then check the log in Vista with Nvidia Geforce 7600 GS, I get:
2009-03-12 08:53:31.638793 [Info.][MPMain]: D3D: Restoring from tray
2009-03-12 08:53:31.681759 [Info.][MPMain]: Main: OnSizeChanged - Resetting device
2009-03-12 08:53:31.687618 [Debug][MPMain]: D3D: Switch to exclusive mode - Playing media: False
2009-03-12 08:53:31.690548 [Debug][MPMain]: GUIFont:texture disposing:0 debug
2009-03-12 08:53:31.693477 [Debug][MPMain]: GUIFont:texture disposing:1 font10
2009-03-12 08:53:31.719843 [Debug][MPMain]: GUIFont:texture disposing:2 font11
2009-03-12 08:53:31.720819 [Debug][MPMain]: GUIFont:texture disposing:3 font12
2009-03-12 08:53:31.724725 [Debug][MPMain]: GUIFont:texture disposing:4 font13
2009-03-12 08:53:31.725702 [Debug][MPMain]: GUIFont:texture disposing:5 font14
2009-03-12 08:53:31.726678 [Debug][MPMain]: GUIFont:texture disposing:6 font15
2009-03-12 08:53:31.727655 [Debug][MPMain]: GUIFont:texture disposing:7 font16
2009-03-12 08:53:31.730584 [Debug][MPMain]: GUIFont:texture disposing:8 font17
2009-03-12 08:53:31.731561 [Debug][MPMain]: GUIFont:texture disposing:9 font18
2009-03-12 08:53:31.743279 [Info.][MPMain]: TexturePacker: disposing texture:1999
2009-03-12 08:53:31.745232 [Info.][MPMain]: TexturePacker: disposing texture:1998
2009-03-12 08:53:31.746208 [Info.][MPMain]: TexturePacker: disposing texture:1997
2009-03-12 08:53:31.747185 [Info.][MPMain]: TexturePacker: disposing texture:1996
2009-03-12 08:53:31.748161 [Info.][MPMain]: TexturePacker: disposing texture:1995
2009-03-12 08:53:31.749138 [Info.][MPMain]: TexturePacker: disposing texture:1994
2009-03-12 08:53:31.750114 [Info.][MPMain]: TexturePacker: disposing texture:1993
2009-03-12 08:53:31.754997 [Debug][MPMain]: D3D: Switched to windowed mode successfully
2009-03-12 08:53:31.756950 [Info.][MPMain]: Main: Resetting DX9 device
2009-03-12 08:53:31.759879 [Info.][MPMain]: fonts.Dispose()
2009-03-12 08:53:31.762809 [Info.][MPMain]: Load fonts from C:\Program files\Team MediaPortal\MediaPortal\Skin\Blue3wide\fonts.xml
2009-03-12 08:53:31.765738 [Info.][MPMain]: fonts.InitializeDeviceObjects()
2009-03-12 08:53:31.768668 [Debug][MPMain]: Loaded font:debug height:12 texture:256x256 chars:[32-255] miplevels:1
2009-03-12 08:53:31.799916 [Debug][MPMain]: Loaded font:font10 height:16 texture:1024x1024 chars:[32-1537] miplevels:1
2009-03-12 08:53:31.844835 [Debug][MPMain]: Loaded font:font11 height:17 texture:1024x1024 chars:[32-1537] miplevels:1
2009-03-12 08:53:31.998145 [Debug][MPMain]: Loaded font:font12 height:20 texture:2048x1024 chars:[32-1537] miplevels:1
2009-03-12 08:53:32.144620 [Debug][MPMain]: Loaded font:font13 height:21 texture:2048x1024 chars:[32-1537] miplevels:1
2009-03-12 08:53:32.288166 [Debug][MPMain]: Loaded font:font14 height:22 texture:2048x1024 chars:[32-1537] miplevels:1
2009-03-12 08:53:32.346756 [Debug][MPMain]: Loaded font:font15 height:24 texture:2048x1024 chars:[32-1537] miplevels:1
2009-03-12 08:53:32.404369 [Debug][MPMain]: Loaded font:font16 height:26 texture:2048x1024 chars:[32-1537] miplevels:1
2009-03-12 08:53:32.577210 [Debug][MPMain]: Loaded font:font17 height:28 texture:2048x2048 chars:[32-1537] miplevels:1
2009-03-12 08:53:32.638729 [Debug][MPMain]: Loaded font:font18 height:29 texture:2048x2048 chars:[32-1537] miplevels:1
2009-03-12 08:53:32.641659 [Debug][MPMain]: GUIWaitCursor: init at position 632:336
2009-03-12 08:53:32.917032 [Info.][MPMain]: TexturePacker: Loaded C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Blue3wide\packedgfx20.png texture:2048x2048 miplevels:1
2009-03-12 08:53:32.918008 [Info.][MPMain]: TexturePacker: fontengine add texure:1999
2009-03-12 08:53:32.918985 [Warn.][MPMain]: GraphicContext: NO screen calibration file found for resolution 1360x768!
2009-03-12 08:53:32.919961 [Info.][MPMain]: GraphicContext: MP will render at 25 FPS, use animations = True
2009-03-12 08:53:33.119167 [Info.][MPMain]: TexturePacker: Loaded C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Blue3wide\packedgfx24.png texture:2048x2048 miplevels:1
2009-03-12 08:53:33.120144 [Info.][MPMain]: TexturePacker: fontengine add texure:1998
2009-03-12 08:53:33.427741 [Info.][MPMain]: TexturePacker: Loaded C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Blue3wide\packedgfx21.png texture:2048x2048 miplevels:1
2009-03-12 08:53:33.428718 [Info.][MPMain]: TexturePacker: fontengine add texure:1997
2009-03-12 08:53:33.692373 [Info.][MPMain]: TexturePacker: Loaded C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Blue3wide\packedgfx26.png texture:2048x2048 miplevels:1
2009-03-12 08:53:33.693349 [Info.][MPMain]: TexturePacker: fontengine add texure:1996
2009-03-12 08:53:33.920874 [Info.][MPMain]: TexturePacker: Loaded C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Blue3wide\packedgfx22.png texture:2048x2048 miplevels:1
2009-03-12 08:53:33.921850 [Info.][MPMain]: TexturePacker: fontengine add texure:1995
2009-03-12 08:53:34.173787 [Info.][MPMain]: TexturePacker: Loaded C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Blue3wide\packedgfx23.png texture:2048x2048 miplevels:1
2009-03-12 08:53:34.174764 [Info.][MPMain]: TexturePacker: fontengine add texure:1994
2009-03-12 08:53:34.574152 [Info.][MPMain]: TexturePacker: Loaded C:\ProgramData\Team MediaPortal\MediaPortal\Cache\Blue3wide\packedgfx25.png texture:2048x2048 miplevels:1
2009-03-12 08:53:34.575129 [Info.][MPMain]: TexturePacker: fontengine add texure:1993
2009-03-12 08:53:34.683520 [Debug][MPMain]: Window: MediaPortal.GUI.Video.GUIVideoFiles deinit
2009-03-12 08:53:34.701097 [Debug][MPMain]: TextureManager: CleanupThumbs()
2009-03-12 08:53:34.796794 [Debug][MPMain]: Window: MediaPortal.GUI.Video.GUIVideoFiles init
2009-03-12 08:53:34.803630 [Debug][MPMain]: GUIVideoFiles: Resetting virtual directory
2009-03-12 08:53:35.968594 [Info.][MPMain]: fonts.SetDevice()
2009-03-12 08:53:35.969571 [Info.][MPMain]: Main: Resetting DX9 device done


Is this bacause of Vista or the Nvidia GPU? Anyway, it's slow in the Vista setup and textures are dissapearing. It works perfectly in the XP setup.
 

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Nothing to do with the GPU type (packed textures are used always the same way, they are just a big texture, nothing fancier). Most likely the difference is coming from the different way of D3D device handling.

    XP == DirectX9

    Vista == DirectX9 Ex

    Maybe "OnSizeChanged - Resetting device" is triggered falsely when DX9Ex is used, or some other workaround causes that to happen on purpose. Sorry would require some debugging to get more proper answer.
     

    Swede

    Portal Pro
    September 6, 2006
    493
    47
    West Coast Archipelago
    Home Country
    Sweden Sweden
    Isn't this weird too?
    2009-03-12 08:53:31.754997 [Debug][MPMain]: D3D: Switched to windowed mode successfully
    I don't use windowed mode.

    One more interesting thing:
    - Vista setup cannot use the "packet textures fix" (where there are no packing of textures).
    - XP setup doesn't bother with or without (more mem left without)
    - XP Media Center Edition setup in my laptop needs it to work.

    I have tried to trigger "OnSizeChanged - Resetting device" in the XP setup by resizing the screen while MP was running, but I couldn't. I can trigger a "Resetting device" but the texturepacker never runs. If it worked the same way in Vista I probably wouldn't lose textures as I do now.
     

    Swede

    Portal Pro
    September 6, 2006
    493
    47
    West Coast Archipelago
    Home Country
    Sweden Sweden
    tourettes

    I found a way to fix this problem in d3app.cs OnSizeChanged(EventArgs e)

    I blocked out:
    ///if (GUIGraphicsContext.IsDirectX9ExUsed() && this.Visible && !_resizeOngoing && !_toggleFullWindowed &&
    /// !_ignoreNextResizeEvent && this.WindowState == _windowState)
    ///{
    /// Log.Info("Main: OnSizeChanged - Resetting device");
    /// SwitchFullScreenOrWindowed(false);
    /// OnDeviceReset(null, null);
    ///}


    Now the restore in Vista is as good as in XP. :)

    Was that part important for anything else?
     

    Attachments

    • MediaPortal.zip
      30.6 KB

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Was that part important for anything else?

    Probably it will now break the the resize. I.e. MediaPortal won't recreate the fonts on window resize. Not sure if there is some other side effects.
     

    Swede

    Portal Pro
    September 6, 2006
    493
    47
    West Coast Archipelago
    Home Country
    Sweden Sweden
    Yeah, what I really need to find is why OnSizeChanged is falsely triggered in Vista, or if it's with Nvidia GPU.

    Btw, witch kind of windows resize should I test

    Edit: Interresting!!! I get the same errors when resizing a windowed MP as when I restore from minimized in the original MediaPortal.exe. My change only affects (fix?) when I restore. Still errors when I resize.
     

    Swede

    Portal Pro
    September 6, 2006
    493
    47
    West Coast Archipelago
    Home Country
    Sweden Sweden
    I was wondering what had changed since RC3 (when minimizing worked) and this WAS part of it!

    This change (mantis #1713) broke restore from Minimize in Vista. After the change Vista does a falsely triggered OnSizeChanged... that does not work properly either.
    Revision 20588 -
    Modified Sat Oct 25 09:41:07 2008 UTC (4 months, 3 weeks ago) by misterd_sf
    File length: 118888 byte(s)
    Diff to previous 20573
    Fixed #1713: Resize doesn't work also on skin change

    Revision 20525 -
    Modified Sat Oct 18 08:59:34 2008 UTC (4 months, 4 weeks ago) by tourettes_
    File length: 117518 byte(s)
    Diff to previous 20433
    Fixed Mantis issue: 0001713: Resizing MediaPortal in windowed mode is not handled correctly (Vista)


    I haven't found any way where this does any good. I've tried all kinds of resize methods I could find out. The strech of a windowed MP looses textures with or without this. The textures come back if I toggle window/fullscren, so that's the way to go.

    For your consideration. Please change the way OnSizeChanged works to the same way window/fullscreen works, AND don't trigger OnSizeChanged if restoring from tray.
     

    Attachments

    • d3dapp diff.jpg
      d3dapp diff.jpg
      90.4 KB

    Swede

    Portal Pro
    September 6, 2006
    493
    47
    West Coast Archipelago
    Home Country
    Sweden Sweden
    One more thing regarding XP:
    When MP first starts:
    2009-03-18 14:48:06.189957 [Debug][MPMain]: Loaded font:debug height:12 texture:256x256 chars:[32-255] miplevels:1
    2009-03-18 14:48:06.486832 [Debug][MPMain]: Loaded font:font10 height:21 texture:2048x1024 chars:[32-1537] miplevels:1
    2009-03-18 14:48:06.986832 [Debug][MPMain]: Loaded font:font11 height:23 texture:2048x1024 chars:[32-1537] miplevels:1
    2009-03-18 14:48:07.283707 [Debug][MPMain]: Loaded font:font12 height:26 texture:2048x1024 chars:[32-1537] miplevels:1
    2009-03-18 14:48:07.689957 [Debug][MPMain]: Loaded font:font13 height:28 texture:2048x2048 chars:[32-1537] miplevels:1
    2009-03-18 14:48:08.252457 [Debug][MPMain]: Loaded font:font14 height:30 texture:2048x2048 chars:[32-1537] miplevels:1
    2009-03-18 14:48:08.721207 [Debug][MPMain]: Loaded font:font15 height:32 texture:2048x2048 chars:[32-1537] miplevels:1
    2009-03-18 14:48:09.158707 [Debug][MPMain]: Loaded font:font16 height:35 texture:2048x2048 chars:[32-1537] miplevels:1
    2009-03-18 14:48:09.502457 [Debug][MPMain]: Loaded font:font17 height:37 texture:2048x2048 chars:[32-1537] miplevels:1
    2009-03-18 14:48:09.939957 [Debug][MPMain]: Loaded font:font18 height:39 texture:2048x2048 chars:[32-1537] miplevels:1


    and if I go to windowed mode and back I have another resolution on the fonts:
    2009-03-18 17:50:38.018082 [Debug][MPMain]: Loaded font:debug height:12 texture:256x256 chars:[32-255] miplevels:1
    2009-03-18 17:50:38.033707 [Debug][MPMain]: Loaded font:font10 height:13 texture:1024x512 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.049332 [Debug][MPMain]: Loaded font:font11 height:15 texture:1024x1024 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.049332 [Debug][MPMain]: Loaded font:font12 height:17 texture:1024x1024 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.064957 [Debug][MPMain]: Loaded font:font13 height:18 texture:1024x1024 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.080582 [Debug][MPMain]: Loaded font:font14 height:19 texture:2048x1024 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.096207 [Debug][MPMain]: Loaded font:font15 height:20 texture:2048x1024 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.111832 [Debug][MPMain]: Loaded font:font16 height:23 texture:2048x1024 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.111832 [Debug][MPMain]: Loaded font:font17 height:24 texture:2048x1024 chars:[32-1537] miplevels:1
    2009-03-18 17:50:38.127457 [Debug][MPMain]: Loaded font:font18 height:25 texture:2048x1024 chars:[32-1537] miplevels:1


    You will see less sharp fonts than before you went to windowed mode. If you try to change skin, you drop out of Fullscreen.


    ...Bummer... I'm talking to myself ...again
     

    Users who are viewing this thread

    Top Bottom