Jump to content


Photo

The Black Screen Syndrom


  • Please log in to reply
3 replies to this topic

#1 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 823 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 12 December 2006 - 04:52 PM

When you compile a xna program you can find the .exe binary in bin\x86\Debug

If you are just a player, be warned that if you try to run a program by compiling its source you may be completely stuck with a black screen. Alt+F4 won't stop the program. You will have to try to kill the right task by doing Ctrl+Alt+Suppr then Enter, but with a black screen you may kill the wrong task. Quite a nightmare...

The solution is, even if sources are given to you, to test the .exe binary first (if you don't have it, compile it with F6 but do not use F5 because F5 will compile then run.

If you get stuck with black screen after launching a xna .exe binary then just hit Alt+F4 to kill it.

It seems developers out there only run their program on xbox360 or high res Windows and they just produce black screen if screen resolution is not appropriate under Windows. A lots of progress needs to be made in that domain...

Note that all existing xna games around (except spacewar) crashed or produced black screen.
Just like if things created with beta xna had no chance to work on Windows with final xna (at least in my config)... Developers really need to autodetect things and avoid crashes or black screens...


#2 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 823 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 14 December 2006 - 04:16 PM

I've found this post in official xna forums (about black screen in full screen mode)

<< (from Arnd. G.)
Hi,

I had the same problem. But my Iiyama Vision Master reported "Fast Signal".

In DirectX Utility "Caps Viewer" I found below "Display Modes" different Refresh Rates which are not "good" for my monitor (e.g. 800x600 @ 240 Hz).

Fortunatelly with the DirectX Utility "Control Panel" -> Direct Draw you can switch the "Forced Refresh Rate from "Auto" to a value like "75".

Viola, the FullScreenToggle works!

Regards,

Arnd
>>

That means there is an awful issue in xna gse. It lets directdraw choose highest possible refreshrate.
In most case that will be too much for your screen, and so the black screen.

The worst is that they marked the case solved. Which means they gladly think mere players will install also (in joy) directX SDK (as if installing visual c sharp was not bad enough). Well I say so because I assume the utilities refered above are found in that SDK. I will check that now.


That other post looks promising, I will try also.

<< (from Shawn Hargreaves - MSFT)
Answer Re: Why does XNA render at 75 Hz in fullscreen?
Was this post helpful ?


By "runs at 75 hz" do you mean that the monitor refresh rate is being set to 75, or that we are calling your Draw function at 75?

My guess would be that we're just using the default monitor refresh rate. If you want to change that you can hook the GraphicsDeviceManager.PreparingDeviceSettings event, and modify the args.GraphicsDeviceInformation.PresentationParameters.FullScreenRefreshRateInHz property.
>>

Edited by openxdkman, 14 December 2006 - 04:18 PM.


#3 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 823 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 14 December 2006 - 04:50 PM

Ahhhh... Finally, that damn black screen syndrome in full screen mode can be fixed manually in code.


For example, in Spacewar starter kit, replace

void PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
// We turn off auto depth buffer creation when scaling output.
//
e.GraphicsDeviceInformation.PresentationParameters.EnableAutoDepthStencil = !enableDrawScaling;
}

with

void PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
// We turn off auto depth buffer creation when scaling output.
//
e.GraphicsDeviceInformation.PresentationParameters.EnableAutoDepthStencil = !enableDrawScaling;
#if XBOX360
#else

if (e.GraphicsDeviceInformation.PresentationParameters.IsFullScreen)
e.GraphicsDeviceInformation.PresentationParameters.FullScreenRefreshRateInHz = 60;
#endif
}


I will look for a way to improve this patch (better to detect the current windows desktop resolution refreshrate and keep it for full screen mode)

Damn... Without fullscreen mode there was no way to reach top 3D performance on Windows... How come mere beginners have to handle this issue after MONTHS of beta!?!

Edited by openxdkman, 14 December 2006 - 04:51 PM.


#4 openxdkman

openxdkman

    X-S Genius

  • Moderator
  • PipPipPipPip
  • 823 posts
  • Xbox Version:unk
  • 360 version:unknown

Posted 14 December 2006 - 05:18 PM

With this you can set in fullscreen mode the same refreshrate as the one detected in windowed mode :
(you can still force its value though if you wish)
It's for Spacewar starter kit (file SpacewarGame.cs)

At line 30, add a new variable

private int preferredRefreshRate = 0;
//0 will mean you want to set this variable when we are in windowed
//mode and reuse it later when we go back to fullscreen mode



replace

void PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
// We turn off auto depth buffer creation when scaling output.
//
e.GraphicsDeviceInformation.PresentationParameters.EnableAutoDepthStencil = !enableDrawScaling;
}

with


void PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e)
{
// We turn off auto depth buffer creation when scaling output.
//
e.GraphicsDeviceInformation.PresentationParameters.EnableAutoDepthStencil = !enableDrawScaling;

#if XBOX360
#else
if (e.GraphicsDeviceInformation.PresentationParameters.IsFullScreen)
{
if (preferredRefreshRate!=0)
e.GraphicsDeviceInformation.PresentationParameters.FullScreenRefreshRateInHz = preferredRefreshRate;
else //we never went in windowed mode before, dunno what is refreshrate yet
e.GraphicsDeviceInformation.PresentationParameters.FullScreenRefreshRateInHz = 60;
}
#endif
}



finally, replace

// going fullscreen, use desktop resolution to minimize display mode changes
// this also has the nice effect of working around some displays that lie about
// supporting 1280x720
GraphicsAdapter adapter = graphics.GraphicsDevice.CreationParameters.Adapter;
graphics.PreferredBackBufferWidth = adapter.CurrentDisplayMode.Width;
graphics.PreferredBackBufferHeight = adapter.CurrentDisplayMode.Height;

with

// going fullscreen, use desktop resolution to minimize display mode changes
// this also has the nice effect of working around some displays that lie about
// supporting 1280x720
GraphicsAdapter adapter = graphics.GraphicsDevice.CreationParameters.Adapter;
graphics.PreferredBackBufferWidth = adapter.CurrentDisplayMode.Width;
graphics.PreferredBackBufferHeight = adapter.CurrentDisplayMode.Height;
if (preferredRefreshRate==0) preferredRefreshRate = adapter.CurrentDisplayMode.RefreshRate;


Ok... now we can have fun!

Edited by openxdkman, 14 December 2006 - 05:19 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users