Jump to content

0 A.D. Screen Goes Black


Thales
 Share

Recommended Posts

0 A.D. was working without issue. But recently, the screen has begun to flick to black. It then restores itself momentarily before going to black again. This on/off cycle keeps repeating. Unfortunately, that makes game play impossible.

The game itself does not crash.

I suspect this may be the result of a recent Linux Mint update. I am using Mint 20.2. Also using a 4K monitor. The graphics are superb. The graphic card is: EVGA - SC ULTRA GAMING NVIDIA GeForce GTX 1660 Ti 6GB GDDR6 PCI Express 3.0 Graphics Card.

Anyone else experiencing a similar issue or have an idea for a workaround?

Link to comment
Share on other sites

17 hours ago, Stan` said:

When does it turn black?

The screen normally goes black after the title screen is displayed. Periodically, I can get to the game set-up screen and even the game itself for a short-time.

17 hours ago, Stan` said:

Does windowed mode work?

I have not tried that. I will have to look into testing that mode out.

Link to comment
Share on other sites

4 hours ago, Stan` said:

Can you take a screenshot?

A bit ironic to take a screenshot of a "black" screen. Since I am using Linux, I switched to a different work space and took a screenshot, where you will see that 0AD shows up in the control panel as being "active". (lower left, last icon to the right.) When the icon is "activated" it goes to full screen, but then goes back to black after a few seconds.465982163_Screenshotfrom2021-11-2206-48-45.thumb.png.32b336f99264c0b6d9fa0d1b52333adc.png

 

I enabled  window mode. That appears, at first glance, to have solved the issue. Testing will confirm.

466010402_Screenshotfrom2021-11-2207-45-57.thumb.png.ba1cf73caa6e5c401423ed84d32b3634.png

4 hours ago, Stan` said:

And upload userreport.txt please

A search of all files did not locate "userreport.txt". I'm using Linux Mint. How can this file be generated, if still interested?

Link to comment
Share on other sites

45 minutes ago, Thales said:

A bit ironic to take a screenshot of a "black" screen. Since I am using Linux, I switched to a different work space and took a screenshot, where you will see that 0AD shows up in the control panel as being "active". (lower left, last icon to the right.) When the icon is "activated" it goes to full screen, but then goes back to black after a few seconds.

We have to ask, because a lot of bug reports are imprecise and we need to know what the users are seeing. e.g your whole desktop could go black, or the window could be visible, etc :) 

47 minutes ago, Thales said:

A search of all files did not locate "userreport.txt". I'm using Linux Mint. How can this file be generated, if still interested?

My bad should have checked, should be called userreport_hwdetect.txt it's https://trac.wildfiregames.com/wiki/GameDataPaths

The file is generated when you launch the game :)

 

  • Like 1
Link to comment
Share on other sites

1 hour ago, Thales said:

A bit ironic to take a screenshot of a "black" screen. Since I am using Linux, I switched to a different work space and took a screenshot, where you will see that 0AD shows up in the control panel as being "active". (lower left, last icon to the right.) When the icon is "activated" it goes to full screen, but then goes back to black after a few seconds.

Could you make a screenshot via F2 in the game? To check that the renderer actually outputs a picture.

Link to comment
Share on other sites

5 hours ago, Stan` said:

My bad should have checked, should be called userreport_hwdetect.txt

Disabled windowed mode so that the screen flicks on and off to black, then looked for the file. Good news. Found the file. Copy attached.

5 hours ago, Stan` said:

We have to ask, because a lot of bug reports are imprecise and we need to know what the users are seeing. e.g your whole desktop could go black, or the window could be visible, etc :) 

Quite True.:)

5 hours ago, vladislavbelov said:

Could you make a screenshot via F2 in the game? To check that the renderer actually outputs a picture.

Appears that an image is being rendered even when the screen is black.  I pressed F2 when the screen was black.

screenshot0001.thumb.png.4be80d8a9df62f36da6f1af0e5bc862d.png

userreport_hwdetect.txt

Edited by Thales
Link to comment
Share on other sites

Does this happen with other 3D games? My nVidia graphics card had a similar problem. When playing any 3D game, sometimes the screen would flicker black and then return to normal, and sometimes the screen would stay black until I rebooted. Other times the screen would flicker black and then the game would crash to desktop, and a message about video driver recovery would appear. I tried many troubleshooting steps, including updating the drivers, reinstalling software and the OS, etc. When I replaced the power supply and disabled factory overclocking, the problem was resolved. When I temporarily re-enabled the factory overclock, the problem re-occurred only while the factory overclock was enabled.

So, one hypothesis to consider is the "black screen problem" that many factory-overclocked video cards have, especially as they age. I recommend the same steps that solved the problem in my case: disable factory overclocking of your video card, and if that doesn't resolve it then replace your power supply with a high quality power supply. I recommend using a power supply that gets good reviews from jonnyguru.com or another review site that stress tests power supplies at high temperature and load, checks them with an oscilloscope, and disassembles them to check whether quality components were used and whether they have good design and soldering. The Superflower OEM consistently has good power supplies. EVGA sometimes rebrands Superflower power supplies. The EVGA SuperNOVA G3 was the last series to use SuperFlower. They're still available direct from evga.com.

A pattern that I noticed with my video card, before I made the recommended changes to fix the problem, was that high FPS situations would make the black screen problem more likely to occur. For example, the simple menu of many games would allow the graphics card to pump out several hundred FPS, maybe close to 1000 FPS. The fans would speed up, which was an indication that the graphics card was drawing a lot of power and generating a lot of heat. This was also the most likely time that the factory-overclocked boost clock rates would be used.

You can run a simple test by monitoring the FPS when it's in the menu. Edit your user.cfg file (probably in ~/.config/0ad/config/user.cfg), and change or add the following line.

overlay.fps = "true"

Then watch the FPS when the black screen problem occurs. Also consider watching the clock rate, power consumption, etc. of your video card with appropriate software.

Later, for testing purposes, in order to treat the symptoms of the problem, you can enable "FPS throttling in menus", as well as in games. The equivalent user.cfg settings are as follows. Check how it's configured already before changing it, and please tell us. If it was set to 100 then FPS throttling was disabled.

adaptivefps.menu = "60.0"

adaptivefps.session = "60.0"

As time went on, my card got worse and worse with the black screen problem. It would happen even when using Firefox with layers.acceleration.disabled = false in about:config. This was until I disabled the factory overclock and replaced the power supply with a good one, as explained earlier.

In order to disable factory overclocking of your video card, you can enable "Debug Mode" in the nVidia Control Panel, at least in Windows. This changes the clock rates to reference clock rates, and it limits the power level that the video card can operate at. There is very little change in the FPS as a result of enabling this, and a very big change in the reliability. It is necessary to enable Debug Mode again after every reboot.

In Linux, if you can't find an equivalent feature in the nVidia settings UI, then you can replicate the feature with the nvidia-smi command, as follows. I looked up the likely reference clock rates for your video card at https://videocardz.net This is not a perfect replication of "Debug Mode" from the Windows nVidia Control Panel, because this locks your video card at the maximum reference clock rate. So I would suggest enabling this underclock only when you're gaming. Reboot in order to disable it.

nvidia-smi --id=1 --lock-gpu-clocks=1500,1500

nvidia-smi --id=1 --power-limit=100

Remember that It is necessary to run these nvidia-smi commands again after every reboot.

If that doesn't completely fix the problem then try using a power limit of 85. If that still doesn't fix the problem then try installing Windows, and enable "Debug Mode" in the Windows nVidia Control Panel before gaming. If that doesn't fix the problem then get a quality power supply. If that still doesn't solve the problem then continue the troubleshooting process. The fact that a screenshot is normal when the screen is black implies to me that the problem is most likely related to your video drivers or hardware, especially your video card, monitor, monitor cables, or power supply.

Edited by Norse_Harold
Link to comment
Share on other sites

2 hours ago, Norse_Harold said:

Does this happen with other 3D games?

0AD is the only 3D game that I have unless X-Plane flight simulator qualifies.

2 hours ago, Norse_Harold said:

My nVidia graphics card had a similar problem.

A lot to digest in your suggestions. As a preliminary dive into looking into this, I ran across this article: "Linux Overclocking Software" which mentioned CoolBits. I know nothing of this program. Furthermore, the article is a bit "old" now so it may no longer be relevant. 

Quote

Since the NVIDIA 1.0-7664 display driver release on the first of June last year, their Linux drivers have supported CoolBits. To enable CoolBits, Option "CoolBits" "1" needs to be added to the nvidia device section of the xorg.conf.

The link below is simply for future reference as the author has provided a sample configuration, which I assume would still have to be tweaked for the specific card that I have.

https://forums.developer.nvidia.com/t/solved-coolbits-without-xorg-conf/37305/5

Thanks very much for providing your suggestions on how to solve the problem.

Edited by Thales
Added aditional information
Link to comment
Share on other sites

2 hours ago, Norse_Harold said:

You can run a simple test by monitoring the FPS when it's in the menu. Edit your user.cfg file (probably in ~/.config/0ad/config/user.cfg), and change or add the following line.

overlay.fps = "true"

 

There's a setting in the Options to toggle fps overlay. There are also sliders for fps throttling.

Link to comment
Share on other sites

1 hour ago, Gurken Khan said:

here's a setting in the Options to toggle fps overlay. There are also sliders for fps throttling.

The fps default was hovered around 60fps in both windows mode and non-windows mode.

I changed the fps, so that it was around 40. That did not go too well. The screen flashes almost immediately to black now.

I see that @Norse_Harold has identified changing the fps through the configuration file. I'll give that a try.

--------------------------------------------------------------------------------------------------------------------------------------------

Well, revising the configuration file proved interesting.

adaptivefps.menu = "100"

With the above, 0AD did not go a black screen and the fps was just over 1000fps. (This is limited testing. Long term ???)

adaptivefps.session = "100"

With the above, 0AD did flicker to black periodically while in the game. However, the game was displayed correctly for significantly more time and stayed black for less time.

The fps in this case was just above 100fps. But, it also seems that the fps changes with the degree of zoom. When I zoom in (detailed image) the fps shot-up to around 200. Zoom out and the fps dropped to under 100.

 

Edited by Thales
Link to comment
Share on other sites

1 hour ago, Thales said:

With the above, 0AD did not go a black screen and the fps was just over 1000fps. (This is limited testing. Long term ???)

Exactly. "Absence of evidence is not evidence of absence." You need long-term testing in order to get a definite answer about whether the problem is fixed by a certain change, or not.

Thanks for running this test. It is interesting. Even though it is the opposite pattern from what I saw with my video card, it doesn't conflict with the hypothesis that the black screen problem could be caused by factory overclocking of your video card or a problem with your power supply.

Operating electronics at higher than their reference clock rate (ie. overclocked) means that the electronics are not guaranteed to function correctly. Current video cards are adjusting their clock rates and voltages frequently. When the FPS is low, the card will try to save power by reducing the clock rate and voltage. This sudden change in the current flowing through the card could be stressful on the components and cause glitches, especially in the power regulation circuitry (VRMs), which could cause glitches in the GPU (the main chip of the video card). An overclocked card is less tolerant of glitches because it's aggressively pushing for the next clock cycles faster than the electronics were designed for. Maybe if you get frustrated enough, like what happened to me, you'll try disabling the factory overclock, also known as "underclock" or "return the card to reference clock rates". :banger:  :crash:

Another hypothesis that comes to mind: maybe your monitor is using a refresh rate synchronization feature like G-SYNC or FreeSync. And maybe it doesn't like to have missed refresh cycles. Therefore, lower FPS would be more likely to cause the black screen symptom. A way to hopefully rule out this hypothesis is if the problem happens when the game is windowed.

Also, test with other games! There are free (as in freedom and price) 3D games for Linux like extremetuxracer (downhill skiing as the Linux mascot), Nexuiz (similar to Natural Selection), quake3arena, Xonotic (fast-paced shooter), Chromium B.S.U. (overhead shoot 'em up like Raptor), Toribash (abstract martial arts), Cube2, Sauerbraten, Super Tux Kart, and more. Most of these are probably available in your distro for instant installation.

Edited by Norse_Harold
Link to comment
Share on other sites

1 hour ago, Norse_Harold said:

A way to hopefully rule out this hypothesis is if the problem happens when the game is windowed.

Based on very limited testing, he game appears to work correctly in windowed mode. 

1 hour ago, Norse_Harold said:

synchronization feature like G-SYNC or FreeSync

A graphic headache. At the time I bought the 4K monitor, I did not have 0AD or X-Plane. I subsequently bought X-Plane and they then upgraded X-Plane to use the Vulkan graphic engine. Turned out that required G-SYNC, which my monitor did not have. Fortunately, NVIDIA had a setting to mimic G-SYNC.  The monitor does have FreeSync.

Just after mentioning FreeSync, I had the thought to disable it. Disabling FreeSync seems to have SOLVED the problem.  Of course testing was extremely limited.

 

PS: if I add the # symbol to the beginning of a line in the ~/.config/0ad/config/user.cfg file, does that comment (disable) that line out?

Link to comment
Share on other sites

Okay, thanks for running the tests. I doubt that the changes have solved the problem. (If they have solved the problem then I encourage you to look for an answer to why they've solved the problem.) You can try to reproduce the symptoms with further testing, or you can use the computer normally for a few weeks or months. Sometimes my video card would go for many months without the black screen occurring. The only thing that reliably stopped it, at least for years, was Debug Mode and replacing the power supply. If you want to use a progressive approach to testing then that's fine with me. A possibly faster test would be to temporarily re-enable FreeSync, restore any other changes you've made, then disable the factory overclock. If that also seems to fix the problem then it's very interesting.

Also, if you think that you have found the root cause of the problem, try temporarily undoing the "fix" and test whether the problem re-occurs.

Yes, adding the # symbol comments out the line in user.cfg. The game ignores such lines. If you later change that setting in the game's UI then it will add another line, uncommented, in user.cfg affecting the same variable, possibly in a much different place in the file. And, if there are duplicate configuration lines that affect the same setting then the last such line in the file is the one that takes effect.

Edited by Norse_Harold
Link to comment
Share on other sites

Apparently black screen problems are common when trying to use G-SYNC with a FreeSync monitor. First, ensure that you are using a DisplayPort 1.4 certified cable of not-too-long length. Second, only certain FreeSync monitors are certified by nVidia to be compatible with G-SYNC. Check out the list.

I learned about this from this article.

Quote

Monitors that have received this designation passed tests ensuring they ... don't blank, pulse, flicker, ghost or present other artifacts with G-Sync enabled.

Link to comment
Share on other sites

Experience is the best teacher. At the time I bought by 4K monitor (VA32UQ) I was unaware of G-SYNC and FreeSync. I also did not have any games installed either. But stuff eventually gets added. After getting X-Plane, I had a rude awaking. And just recently, 0AD added to that awakening as you need to know what monitors work with which games. (Also the graphic card itself needs to be considered, the Linux NVIDIA driver did not originally come with Vulkan installed, but it was installed with a subsequent update.) My 4K monitor (VA32UQ) was not on the approved list. Thanks, very much for providing a sounding board and for your research into the issue so that a solution was found.

Last night, played a game for approximately two hours with no problems.

As a reminder, for anyone else who may be following this thread, disabling FreeSync on the monitor appears to have resolved the black screen problem.

  • Thanks 2
Link to comment
Share on other sites

  • 1 month later...

A follow-up note. Everything is working well with 0AD.

The follow-up note relates to the cabling between the device (computer, Roku) and the display screen (monitor, TV).  With both my computer (to play 0AD) and my TV, I recently upgraded my devices. I used existing cables(HDMI and Displayport). Everything appears to be working correctly. Cabling may not be an issue with 0AD. I had not considered the potential that recently adopted new cabling standards could affect your video quality.

In looking to upgrade my TV soundbar, I ran across several articles that discussed HDMI and Displayport specifications. Basically, my existing cables were now "obsolete" by new standards. I just installed a "newer" HDMI cable between by Roku and TV to see what would happen. It was cheap enough. The picture looks better, but that is subjective. A lot of testing would resolve that, but I'm not about to do it.

Whether current industry standard HDMI and/or displayport cables would have a positive effect on 0AD is an unknown, but still something that should be considered.

HDMI ARC vs. Bluetooth - Is ARC/eARC Better Than Bluetooth?

DisplayPort Explained

DisplayPort vs HDMI: Which is Better?

Link to comment
Share on other sites

  • 9 months later...
  • 4 weeks later...

@KieranthegreatTake a look at this bug that can cause a black screen with a mouse cursor. Bug #6320 is marked as "fixed", but people still experience it well after it was supposedly fixed. Maybe wraitii considers it normal behavior that development versions, such as release candidates, are permitted to create files in the mods/user folder. So, we continue tell users about this issue so they can clear the mods/user folder.

Edited by dave_k
Link to comment
Share on other sites

  • 2 months later...
 	pyrogenesis.exe!CFont::CalculateStringSize(const wchar_t * string, int & width, int & height) Line 68	C++
 	[Inline Frame] pyrogenesis.exe!CTextRenderer::PutAdvance(const wchar_t *) Line 120	C++
 	pyrogenesis.exe!CTextRenderer::PrintfAdvance(const wchar_t * fmt, ...) Line 96	C++
 	pyrogenesis.exe!CLogger::Render(CCanvas2D & canvas) Line 250	C++
 	pyrogenesis.exe!CRenderer::RenderFrame2D(const bool renderGUI, const bool renderLogger) Line 521	C++
 	pyrogenesis.exe!CRenderer::RenderFrameImpl(const bool renderGUI, const bool renderLogger) Line 478	C++
 	pyrogenesis.exe!CRenderer::RenderFrame(bool needsPresent) Line 431	C++
 	pyrogenesis.exe!Frame() Line 446	C++
 	pyrogenesis.exe!RunGameOrAtlas(int argc, const char * * argv) Line 687	C++
 	pyrogenesis.exe!SDL_main(int argc, char * * argv) Line 739	C++
 	pyrogenesis.exe!main_getcmdline() Line 74	C
>	[Inline Frame] pyrogenesis.exe!invoke_main() Line 90	C++
 	pyrogenesis.exe!__scrt_common_main_seh() Line 288	C++
 	pyrogenesis.exe!CallStartupWithinTryBlock() Line 363	C++
 	kernel32.dll!770700f9()	Unknown
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	ntdll.dll!771e7bbe()	Unknown
 	ntdll.dll!771e7b8e()	Unknown

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...