BUG : Fullscreen Desktop re-draw (1 Viewer)

xurr

Portal Pro
May 3, 2006
74
10
Italy
Home Country
Italy Italy
MyMusic is the cure?!

I just discovered that entering MyMusic (I configured it to use WMP and visualization on) suprisingly fixes the problem (latest CVS)!

Also, if you press "!", you can see the vertical line moving: if it looks perfectly "straight" then you won't be able to minimize/exit fullscreen, if it looks "jagged" then you can.

I believe this is related to "Exclusive DirectX mode", since there is no problem at all if I disable it (but then tearing appears in videos).
 

ThylakoiD

Portal Member
April 11, 2006
9
0
Hello, I found out that minimizing when exclusive directx mode is on is possible until video or tv playback starts, then its not possible even after stopping. I think that somehow MediaPortal isn't "releasing" the exclusive mode and even if it's window is minimized, it still refreshes the unreleased screen surface.
This could be also related with the other problem. When you have Autoplay turned on and insert DVD while MediaPortal is minimized (exclusive directx mode also on, but minimized properly), MediaPortal will grab the screen surface and start playing, while windows in back are flashing when they are being redrawn.
 

ThylakoiD

Portal Member
April 11, 2006
9
0
possible solution

Good news everyone 8) ,

the problem with MediaPortal and Exclusive mode was that MP didn't switch it on or off as needed.

The minimizing function only called Control.Hide(), which realy don't work with exclusive mode because DX don't care if the window is visible or not, so MP needs to disable excl. mode before or just after Hide()....


So, I did these changes to the D3DApp class in d3dapp.cs:

I added event handlers in the constructor
Code:
    public D3DApp()
    {
        //.......

        this.Deactivate += new EventHandler(D3DApp_Deactivate);
        this.Activated += new EventHandler(D3DApp_Activated);
    }

and the implementation of the handlers is:
Code:
        /// <summary> When MediaPortal is minimized or other applicaion gains focus, disable exclusive mode </summary>
        void D3DApp_Deactivate(object sender, EventArgs e)
        {
            if (this.useExclusiveDirectXMode)
            {
                PresentParameters pp = GUIGraphicsContext.DX9Device.PresentationParameters;
                pp.Windowed = true;

                GUIGraphicsContext.DX9Device.Reset(pp);
            }
        }
      
        /// <summary> When MediaPortal gains focus, enable exclusive mode </summary>
        void D3DApp_Activated(object sender, EventArgs e)
        {
            if (this.useExclusiveDirectXMode)
            {
                PresentParameters pp = GUIGraphicsContext.DX9Device.PresentationParameters;
                pp.Windowed = false;

                GUIGraphicsContext.DX9Device.Reset(pp);
            }
        }

That's it, I tested it on my dedicated HTPC and it worked pretty well.

Minimizing works even when there is video playing (but on restore it goes to fullscreen, which I think is related to another bug I think i've seen on this forum...).

MP is minimized almost immediately, restoring takes a few seconds, because of resetting device, but works fine.

This also works when other application or start menu gains focus.

I hope some MP programmer will look at this, test it and hopefully add it to svn :D , ofcourse this probably wont be 100% solution, but it has better behavior than before.
 

mPod

Portal Pro
January 26, 2005
2,084
3
Berlin
Home Country
Germany Germany
Looking good to me, it's in SVN and available in the next public build. Will be tested by the test team, as well. :wink:
 

mPod

Portal Pro
January 26, 2005
2,084
3
Berlin
Home Country
Germany Germany
Just undid the change again, it leads to the "Nothing will be rendered" problem and does sth very bad to the d3d surface.

Edit: Only works when MP is started as fullscreen. If started windowed, d3d doesn't work with the above fix.
 

kamrat

Portal Pro
May 24, 2005
147
1
Stockholm, Sweden
Just undid the change again, it leads to the "Nothing will be rendered" problem and does sth very bad to the d3d surface.

That's to bad!
My heart started racing when I found this thread: hoping the issue with minimize to tray and exclusive direct X would be solved. This is indeed the final big bug that keeps me from recommending MP to my friends.
It's good news that the Devs are now aware of the problem though.
And it seems like Mpod is on the case!

In the latest CVS he's accomplished a very important bug fix:

"MediaPortal General
On 24/05/2006 [11:41:33] mPod added the following change: fixed Crash when resizing/minimizing window when tv or other media is playing "

I just downloaded it and it seems to be working!! However the problem with minimize to tray is, as far as I can tell, still there.

Anyway, great job Mpod! Keep on it! Squash the final critical bug that keeps me from handing over control of MP to my girlfriend.
 

kamrat

Portal Pro
May 24, 2005
147
1
Stockholm, Sweden
Can you describe it again, pls?

I'll do my best. :D

First of all. Here's my setup:

Area: Media Portal Program
MP Version: 0.2.0 RC4 SVN of 25/5 13:30
Skin: razor 16:9
Windows Version: XP MCE2005 Sp2
CPU Type: Intel P4 3.2GHz HT
Memory: 1024 Mb DDR dual channel
Motherboard Chipset: Asus P5GD1
Video Card: Nvidia Gforce 6600GT
Video Card Driver: Forceware Version: 72.14
Video Render Type: VMR9
Video Codec Type & Version: Nvidia pure video decoder 1.02-150
TV Card: Hauppauge Win TV Nova DVB-T and Leadtek Winfast PVR2000
TV Card Type: Hardware & DVB-T
TV Card Driver: Hauppauge ver 2.104.22345.0 & Winfast ver. 5.13.22.6104

This is also important:
Exclusive direct X - ENABLED, Minimize to tray on exit - ENABLED.

Now - I have not had time to play around a lot since your great bugfix! BUT at least the following problem still exists.

When tv-playback is enabled in a small window on the home screen and I hit the X (top left of screen) to minimize to tray I can see the windows animation illustrating that the window is being minimized. But the MP overlay is still active and the windows desktop never shows up. Sometimes I can see the start button or the windows taskbar flickering under the MP screen.
It seems to me that MP never releases it's hold of the Exclusive direct X overlay (is that the right term).
Now - if I hit the home button on my MCE-remote I see the windows maximize-animation and the flickering stops and MP regains full control.

One other thing that I have noticed since your fix is that if I have a DVD loaded and paused and try to switch between full screen and windowed mode MP crashes.

I really hope you can fix this annoying bug. To me it seems related to the bug you have just fixed.

Please let me know if you need any more information!

You are doing such a great job! Thank you!!!
 

Splog

Portal Member
September 16, 2006
5
0
41
Home Country
United Kingdom United Kingdom
Hi there,
sorry to resurrect this thread, however i'm still encountering this problem, exactly as described by kamrat. was there ever a fix that was settled for this?

turning off exclusive directX mode does fix this, however i'd gotten quite attached to that mode. :)
 

Users who are viewing this thread

Top Bottom