Screen goes black for a while on exit (Ubuntu)

Hi,

I am having a strange issue when I quit a JMonkeyEngine game. The screen goes to black for a second or two and then returns back to Ubuntu. I can also hear that faint noise a screen can make when it is “between screen modes.” Not sure how to explain it, I hope you understand me.

This would be an expected behaviour if the game was running in fullscreen, but this occurs even with windowed games. And it occurs with the sample code that is generated when one starts a new “BasicGame” project, so it isn’t something funky I am doing. Yet.

Tried to verify this with the JmeTests that can be generated when creating a new project, but it refuses to start for some unknown reason with the error message “Permission Denied”(?!)

Ubuntu 13.10, GeForce GTX 650 Ti, I believe I am using the latest nvidia drivers. No other non-jmonkey games have this behaviour.

how about mineceaft (the demo if you dont have it) as it also is based on lwjgl.

Minecraft does not have this issue. (Tried with the full version updated to the lastest release).

Do you by any chance have a hybrid gpu system?

I have not the faintest idea… :slight_smile:
How can I check this?

Well are you using a somewhat new laptop? They often sue onboard grafic for non consuming applicaitons eg office to save power, and switch to the real gpu on demanding applications, this switching could cause the reinitializing of the monitor.

To find out you could problaby query the driver in some way or take a manual look at /dev

No this is a desktop computer.
I have however both an integrated graphics card (came with the motherboard) and this GeForce GTX 650 Ti card I purchased separately and inserted. Might this be a part of the issue?

I don’t think so. But I’m kinda out of ideas what could cause it :confused: Do you have a dual boot with windows by any chance? And try if this behaviour happens on windows too? (Then we would know if its hardware related)

Unfortunately I dont have dualboot. :frowning: Will get in the future, but not any time soon I’m afraid.

It’s odd that it’s only JMonkey that causes this. That made me wade through the JMonkey source code in a hunt for the cause of this but I didn’t find anything strange. (I might also have been looking in the wrong place)

I can still work on my little project, but having the screen blink to black for a short while every single time I close the game is a bit irritating in the long run. :slight_smile:

Edit:
I tried looking for one of my older JMonkey projects from a year back but sadly I had only saved a few sourcefiles of it. I then tried to go for a hunt for some JMonkey game someone else have done. I ended up in “Nord” that was showcased on the JMonkey main page. I don’t know what version of JMonkey they used but it too made my screen blank on exit.
But at the same time, minecraft does not. And not other games on steam (that does not use lwjgl nor jmonkey). This makes me believe that it is not a hardware issue, but might still be something with how JMonkey is cleaning up.

@deps81 said: Tried to verify this with the JmeTests that can be generated when creating a new project, but it refuses to start for some unknown reason with the error message "Permission Denied"(?!)

Run it with sudo (?!)

@javagame said: Run it with sudo (?!)
I have only tried to run it inside Netbeans/JMonkeySDK, but I could try. It's just odd that I for some reason needs root privilegies to run the tests.

Edit:
I still get a permission denied error inside netbeans/Jmonkey if I run it using sudo.
Cannot get it to give me a proper release in the dist folder no matter what I do. I get a jar file that cannot be launched in the normal way (java -jar filename.jar)

I can get it running with something like this:

java -cp JME3TestsTemplate.jar jme3test.TestChooser

Which gives me a dialog with the following options:

class jme3test.app.TestApplication
class jme3test.app.TestContextRestart
class jme3test.app.TestCustomAppSettings
class jme3test.asset.TestCustomLoader
class jme3test.material.TestMaterialCompare
class jme3test.math.TestHalfFloat

And I cannot start anyone of them becasue they cannot find the JME3 core stuffs.

Starting of getting tired of all these problems. :confused:

I tried another game, MythRuna, and it too had the “screen goes blank on exit” problem.

My linux machine is currently headless so I can’t test but when it had a monitor I had no such problems, I have another nVidia card but used their drivers.
It sure sounds like it is switching video mode for some reason. I wonder if it is something that jME selects that doesn’t match the video mode X uses, like 16/24/32 bit colors or something.

I don’t have a lot of ideas, maybe you could try to turn off desktop effects or boot into “classic” gnome so it doesn’t use a compositing window manager.

@jmaasing said: My linux machine is currently headless so I can't test but when it had a monitor I had no such problems, I have another nVidia card but used their drivers. It sure sounds like it is switching video mode for some reason. I wonder if it is something that jME selects that doesn't match the video mode X uses, like 16/24/32 bit colors or something.

I don’t have a lot of ideas, maybe you could try to turn off desktop effects or boot into “classic” gnome so it doesn’t use a compositing window manager.

I can try to boot into classic gnome. But it’s odd that this only occurs when shutting down the game. Here’s one of my ideas on what might be going on:

  1. Game starts up. Saves the current screen resolution and settings.
  2. Game is running. Player presses Escape.
  3. JMonkey shuts down and during the clean up process it sets the screen to whatever screen setting was saved in step 1. (lwjgl may not be the problem here as minecraft works just fine)
  4. X, using my drivers/settings/bad luck, takes this as a new mode and switches the current screen resolution to the same values.

But it’s just a hunch and I have not been able to confirm this in the source.

Hmm. Minecraft does not have this issue, but I just saw it when quitting a libgdx/lwjgl powered test project.
So it really looks like a lwjgl issue now. (in combination with my computer)

After making sure I was using the latest drivers, and a restart for good measure, before starting to be creative with display managers, the issue disappeared.

So I guess it was a driver issue only affecting small and simple games using lwjgl and not games like Kerbal Space Program, Left For Dead 2 or even a “PlayOnLinux” powered Diablo 3.

I hate computers a little bit more now. :slight_smile:
Thanks for the help anyway!

1 Like