Black screen & seeing part of desktop after resume from standby (1 Viewer)

pridehaveit

Portal Member
April 7, 2008
34
4
Kiel
Home Country
Germany Germany
I had the problem that sometimes ofter resuming from standby parts of the screen were black and the other part showed the desktop. When i pressed the down key on my MCE compatible remote MediaPortal was reacting again and also show correctly on screen again.

I hunted down the problem in the MedioPortal 1.0 code and found out that sometimes OnSizeChanged was called in class D3DApp after resuming from standby. That leads to the affect that MediaPortal tried to change from fullscreen mode to normal mode although MediaPortal was started in fullscreen mode.

I fixed that issue by extending the if statement in OnSizeChanged. Current code:

2475 protected override void OnSizeChanged(EventArgs e)
2476 {
2477 if (GUIGraphicsContext.IsDirectX9ExUsed() && this.Visible && !_resizeOngoing && !_toggleFullWindowed &&
2478 !_ignoreNextResizeEvent && this.WindowState == _windowState)
2479 {
2480 Log.Info("Main: OnSizeChanged - Resetting device");
2481 SwitchFullScreenOrWindowed(false);
2482 OnDeviceReset(null, null);
2483 }
2484 base.OnSizeChanged(e);
2485 }


New code:

2475 protected override void OnSizeChanged(EventArgs e)
2476 {
2477 if (GUIGraphicsContext.IsDirectX9ExUsed() && this.Visible && !_resizeOngoing && !_toggleFullWindowed &&
2478 !_ignoreNextResizeEvent && this.WindowState == _windowState && !startFullscreen)
2479 {
2480 Log.Info("Main: OnSizeChanged - Resetting device");
2481 SwitchFullScreenOrWindowed(false);
2482 OnDeviceReset(null, null);
2483 }
2484 base.OnSizeChanged(e);
2485 }


Can someone please put this change to subversion.

TV-Server Version: 1.0
MediaPortal Version: 1.0
MediaPortal Skin: Blue3wide
Windows Version: Windows Vista Ultimate SP1
CPU Type: Intel Core 2 Duo 2.1 GHz
HDD: 160 GB
Memory: 1 MB
Motherboard: Shuttle FG33 (SG33G5M)
Video Card: GMA 3100 (onboard)
Video Card Driver: Shuttle 2008-06-05
Sound Card: Realtek ALC888DD
Sound Card AC3:
Sound Card Driver: Shuttle 2007-08-23
1. TV Card: Terratec Cinergy S2 HD PCI
1. TV Card Type: DVB-S, DVB-S2
1. TV Card Driver:
2. TV Card: -
2. TV Card Type: -
2. TV Card Driver: -
3. TV Card: -
3. TV Card Type: -
3. TV Card Driver: -
4. TV Card: -
4. TV Card Type: -
4. TV Card Driver: -
MPEG2 Video Codec: MPV
MPEG2 Audio Codec: MPA
h.264 Video Codec: none
Satelite/CableTV Provider: Astra 19.2°E
HTPC Case: Shuttle SG33G5M
Cooling:
Power Supply:
Remote: Shuttle Multimedia Remote (MCE compatible)
TV: Sony
TV - HTPC Connection: HDMI
 

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I'm not sure (without testing...) but the change could break ALT-ENTER toggle when MP is set to start up in fullscreen.

    Also what comes to the issue itself, sounds like a bug in display driver as the screen size will most likely change on wakeup, as normally MP shouldn't be getting OnSizeChanged() on resume from S3/S4.
     

    pridehaveit

    Portal Member
    April 7, 2008
    34
    4
    Kiel
    Home Country
    Germany Germany
    Have you got an idea what i can do about an error in the display driver?
    I use the newest drivers coming from Shuttle for my barebone.
    May be there are drivers from Intel for chipset GMA 3100.

    The OnSizeChanged method was introduced first in version 1.0 RC3.
    Previously the problem does not exists.

    What does the key combination ALT-ENTER?
    Does it change between fullscreen and normal mode?
     

    d0nd

    Portal Member
    March 25, 2009
    7
    0
    Home Country
    France France
    I am experiencing the exact same issue on my Shuttle S33G5M (Vista Ultimate SP1).
    How can I change the code myself as suggested above? I'm very interested in this tweak !
    If it requires to compile from sources etc, can pridehaveit please send me the exe or dll or whatever that is so I can benefit from this fix?
    Thanks a lot !
     

    d0nd

    Portal Member
    March 25, 2009
    7
    0
    Home Country
    France France
    Thanks a lot for sharing your fix !
    I just tried it and it did improve things: the black square isnt black anymore but shows MP interface which is fully functional instead of hanging.
    MP doesnt go back to full screen (720p) though, and remains a square with the desktop background behind it.
    When I launch a movie it does go fullscreen and remains fullscreen once i go back to MP Interface.
    It's still way better cause i dont need to start MP over etc but theres still something wrong I assume since it doesnt go back to full screen.
    Do you have any idea that would help me fix that one last thing ?

    Thanks a lot for your help.
     

    pridehaveit

    Portal Member
    April 7, 2008
    34
    4
    Kiel
    Home Country
    Germany Germany
    If i should help you you need to post your log files directly after the problem occurs.
     

    d0nd

    Portal Member
    March 25, 2009
    7
    0
    Home Country
    France France
    Since MP doesn't crash, the watchdog doesn't kick in to gather all usefull logs.
    Can you please tell me what files would be useful to investigate?

    Thanks again !
     

    pridehaveit

    Portal Member
    April 7, 2008
    34
    4
    Kiel
    Home Country
    Germany Germany
    Post the file C:\ProgramData\Team MediaPortal\MediaPortal\logs\MedioPortal.log or something like that.

    tourettes:

    The real problem does not reside in the OnSizeChanged method but in method SwitchFullScreenOrWindowed.
    The method contains this code:

    if (GUIGraphicsContext.IsDirectX9ExUsed() && (useEnhancedVideoRenderer || !useExclusiveDirectXMode))
    {
    BuildPresentParamsFromSettings(true);
    }
    else
    {
    BuildPresentParamsFromSettings(bWindowed);
    }


    On my system BuildPresentParamsFromSettings is called with bwindowed = true because i use EVR. This results in switching to partly to windowed mode. Can you explain why for EVR BuildPresentParamsFromSettings is always called with true?

    I look a little bit further in the subversion history of d3dapp.cs:

    The if statement was introduced in revision 20400.

    The modification was made by you with the comment:

    2nd try for Mantis issue: 0001669: MediaPortal minimizes to system tray when it loses focus (Vista specific)

    May be this change has a bad sideeffect.
     

    pridehaveit

    Portal Member
    April 7, 2008
    34
    4
    Kiel
    Home Country
    Germany Germany
    d0nd:

    Here is a fixed MediaPortal.exe for version 1.0.1 if you are interested.
     

    Attachments

    • MediaPortal.zip
      30.6 KB

    Users who are viewing this thread

    Top Bottom