Can't go fullscreen under Linux

Started by Morgrog, February 11, 2004, 02:49:46

Previous topic - Next topic

Morgrog

Ok, before I get lynched, I'm running kernel 2.6.1 (gentoo) with ati drivers (for XServer 4.3) :)
I cannot switch to fullscreen running the source code
I'm still working on my skeleton code (it was working under windows, now I'm trying to get it to work under Linux) ;)

Here's the error I get:

Unexpected Signal : 11 occurred at PC=0x40368A9F
Function=(null)+0x40368A9F
Library=/opt/sun-jdk-1.4.2.03/jre/lib/i386/client/libjvm.so

NOTE: We are unable to locate the function name symbol for the error
      just occurred. Please refer to release documentation for possible
      reason and solutions.


Current Java thread:
	at org.lwjgl.Display.setDisplayMode(Native Method)
	at Nehe01.Nehe01.process_keyboard(Nehe01.java:161)
	at Nehe01.Nehe01.main_loop(Nehe01.java:91)
	at Nehe01.Nehe01.<init>(Nehe01.java:28)
	at Nehe01.Nehe01.main(Nehe01.java:190)

Dynamic libraries:
08048000-0804e000 r-xp 00000000 03:41 450206     /opt/sun-jdk-1.4.2.03/bin/java
0804e000-0804f000 rw-p 00005000 03:41 450206     /opt/sun-jdk-1.4.2.03/bin/java
40000000-40014000 r-xp 00000000 03:41 128582     /lib/ld-2.3.2.so
40014000-40015000 rw-p 00013000 03:41 128582     /lib/ld-2.3.2.so
40028000-40036000 r-xp 00000000 03:41 128561     /lib/libpthread-0.10.so
40036000-40039000 rw-p 0000d000 03:41 128561     /lib/libpthread-0.10.so
40079000-4007b000 r-xp 00000000 03:41 128584     /lib/libdl-2.3.2.so
4007b000-4007c000 rw-p 00001000 03:41 128584     /lib/libdl-2.3.2.so
4007c000-401a4000 r-xp 00000000 03:41 128534     /lib/libc-2.3.2.so
401a4000-401a8000 rw-p 00127000 03:41 128534     /lib/libc-2.3.2.so
401ab000-405a5000 r-xp 00000000 03:41 450264     /opt/sun-jdk-1.4.2.03/jre/lib/i386/client/libjvm.so
405a5000-405c1000 rw-p 003f9000 03:41 450264     /opt/sun-jdk-1.4.2.03/jre/lib/i386/client/libjvm.so
405d3000-405db000 r-xp 00000000 03:41 450259     /opt/sun-jdk-1.4.2.03/jre/lib/i386/native_threads/libhpi.so
405db000-405dc000 rw-p 00007000 03:41 450259     /opt/sun-jdk-1.4.2.03/jre/lib/i386/native_threads/libhpi.so
405e5000-405f6000 r-xp 00000000 03:41 128522     /lib/libnsl-2.3.2.so
405f6000-405f7000 rw-p 00011000 03:41 128522     /lib/libnsl-2.3.2.so
405f9000-40619000 r-xp 00000000 03:41 128560     /lib/libm-2.3.2.so
40619000-4061a000 rw-p 0001f000 03:41 128560     /lib/libm-2.3.2.so
4061a000-4061e000 rw-s 00000000 03:48 91589      /tmp/hsperfdata_stamoun/3529
4062c000-40633000 r-xp 00000000 03:41 128525     /lib/libnss_compat-2.3.2.so
40633000-40634000 rw-p 00006000 03:41 128525     /lib/libnss_compat-2.3.2.so
40634000-4063c000 r-xp 00000000 03:41 128587     /lib/libnss_nis-2.3.2.so
4063c000-4063d000 rw-p 00007000 03:41 128587     /lib/libnss_nis-2.3.2.so
4063d000-40646000 r-xp 00000000 03:41 128586     /lib/libnss_files-2.3.2.so
40646000-40647000 rw-p 00008000 03:41 128586     /lib/libnss_files-2.3.2.so
40647000-40657000 r-xp 00000000 03:41 450268     /opt/sun-jdk-1.4.2.03/jre/lib/i386/libverify.so
40657000-40659000 rw-p 0000f000 03:41 450268     /opt/sun-jdk-1.4.2.03/jre/lib/i386/libverify.so
40659000-40679000 r-xp 00000000 03:41 450269     /opt/sun-jdk-1.4.2.03/jre/lib/i386/libjava.so
40679000-4067b000 rw-p 0001f000 03:41 450269     /opt/sun-jdk-1.4.2.03/jre/lib/i386/libjava.so
4067b000-4068f000 r-xp 00000000 03:41 450271     /opt/sun-jdk-1.4.2.03/jre/lib/i386/libzip.so
4068f000-40692000 rw-p 00013000 03:41 450271     /opt/sun-jdk-1.4.2.03/jre/lib/i386/libzip.so
40692000-4202a000 r--s 00000000 03:41 450826     /opt/sun-jdk-1.4.2.03/jre/lib/rt.jar
42074000-4208a000 r--s 00000000 03:41 450298     /opt/sun-jdk-1.4.2.03/jre/lib/sunrsasign.jar
4208a000-42165000 r--s 00000000 03:41 450786     /opt/sun-jdk-1.4.2.03/jre/lib/jsse.jar
42165000-42176000 r--s 00000000 03:41 450299     /opt/sun-jdk-1.4.2.03/jre/lib/jce.jar
42176000-426cf000 r--s 00000000 03:41 450824     /opt/sun-jdk-1.4.2.03/jre/lib/charsets.jar
4cb87000-4cba3000 r--s 00000000 03:41 450294     /opt/sun-jdk-1.4.2.03/jre/lib/ext/sunjce_provider.jar
4cba3000-4cba6000 r--s 00000000 03:41 450295     /opt/sun-jdk-1.4.2.03/jre/lib/ext/dnsns.jar
4cba6000-4cbb3000 r--s 00000000 03:41 450296     /opt/sun-jdk-1.4.2.03/jre/lib/ext/ldapsec.jar
4cbb3000-4cc6f000 r--s 00000000 03:41 450297     /opt/sun-jdk-1.4.2.03/jre/lib/ext/localedata.jar
4cc6f000-4cc8e000 r--s 00000000 03:05 288        /win/e/projects/lwjgl/lwjgl-0.8-win32/lwjgl.jar
4cc8e000-4ccc8000 r-xp 00000000 03:41 451946     /opt/sun-jdk-1.4.2.03/jre/lib/i386/liblwjgl.so
4ccc8000-4ccd4000 rw-p 00039000 03:41 451946     /opt/sun-jdk-1.4.2.03/jre/lib/i386/liblwjgl.so
4cce7000-4ccf6000 r-xp 00000000 03:45 197804     /usr/X11R6/lib/libXext.so.6.4
4ccf6000-4ccf7000 rw-p 0000e000 03:45 197804     /usr/X11R6/lib/libXext.so.6.4
4ccf7000-4cdd4000 r-xp 00000000 03:45 197791     /usr/X11R6/lib/libX11.so.6.2
4cdd4000-4cdd7000 rw-p 000dc000 03:45 197791     /usr/X11R6/lib/libX11.so.6.2
4cdd7000-4ce7c000 r-xp 00000000 03:45 208861     /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5.0.3
4ce7c000-4ce81000 rw-p 000a4000 03:45 208861     /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5.0.3
4ce86000-4ce8e000 r-xp 00000000 03:45 208870     /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libgcc_s.so.1
4ce8e000-4ce8f000 rw-p 00007000 03:45 208870     /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libgcc_s.so.1
4ce8f000-4cf05000 r-xp 00000000 03:45 276152     /usr/lib/opengl/ati/lib/libGL.so.1.2
4cf05000-4cf0a000 rw-p 00076000 03:45 276152     /usr/lib/opengl/ati/lib/libGL.so.1.2
4cf8c000-4d473000 rwxp 00000000 03:45 564365     /usr/X11R6/lib/modules/dri/fglrx_dri.so
4d473000-4d496000 rw-p 004e6000 03:45 564365     /usr/X11R6/lib/modules/dri/fglrx_dri.so

Heap at VM Abort:
Heap
 def new generation   total 576K, used 347K [0x44780000, 0x44820000, 0x44c60000)
  eden space 512K,  67% used [0x44780000, 0x447d6f10, 0x44800000)
  from space 64K,   0% used [0x44800000, 0x44800000, 0x44810000)
  to   space 64K,   0% used [0x44810000, 0x44810000, 0x44820000)
 tenured generation   total 1408K, used 0K [0x44c60000, 0x44dc0000, 0x48780000)
   the space 1408K,   0% used [0x44c60000, 0x44c60000, 0x44c60200, 0x44dc0000)
 compacting perm gen  total 4096K, used 1311K [0x48780000, 0x48b80000, 0x4c780000)
   the space 4096K,  32% used [0x48780000, 0x488c7fb0, 0x488c8000, 0x48b80000)

Local Time = Tue Feb 10 21:49:41 2004
Elapsed Time = 0
#
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002EF
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
#
# Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)
#
# An error report file has been saved as hs_err_pid3529.log.
# Please refer to the file for further information.
#
NOTICE: GL_EXT_vertex_shader disabled because of missing driver symbols


Oh and I don't suppose this has anything to do with me using a lwjgl-0.8-win32/lwjgl.jar (just pointing the obvious out) ;)
(fyi the pasted error above is the hs_err_pid3529.log file)

Thanks for even reading this newb's post :)

Maybe my skeleton code is crap :(

elias

I tried your program on two SUSE 9 installs, one with a nvidia card and one with an ati card (X 4.3 and driver version 3.7). Both worked with the latest CVS version of LWJGL.

- elias

cfmdobbie

First things first - is mode non-null after your mode selection loop?

Unfortunately you can't guarantee that a mode returned from getAvailableDisplayModes() will be possible on your hardware.  This won't cause a native crash so isn't related to this problem - just a heads up, it may bite you in the future.
ellomynameis Charlie Dobbie.

elias

you're right. I added a null check to CVS to prevent that in the future.

- elias

princec

Oh, and one more thing - make sure you select 16 for depth, not 8. The only widely supported hardware format is 16 bit depth buffers. Some newer posher cards have 24 and 32 bit.

Cas :)

Morgrog

cool, thanks for the quick reply, I'll check this issue tonight/tomorrow

Maybe I should try with the latest CVS version (it's just a matter of compiling it and putting the .so's and appropriate .jar where the old ones are eh?), I've never used CVS before (weird tho, considering I'm a ClearCase admin irl) :)  I'll give the latest version a shot and tell you how it went (if I can figure out this CVS stuff, which wouldn't be a bad thing) ;)

Morgrog

come to think of it, I think I know what the problem is and I feel a bit stupid for not thinking about it :(

My XServer is configured only to run in 1280x1024@75Hz (at 24 bpp), it has no other possible modes, I just need to add a few more that's all :)

(and make sure if the mode is available)

Thx cfmdoobie for making me think outside the box :D

edit: That would explain why in Quake3 and Enemy-Territory before changing the res to 1280x1024 I'd get a portion of my screen blacked out, e.g. when you start Q3 it's in 800x600, I'd be able to see everything, but my res would stay in 1280x1024 therefore leaving a whole bunch of nothing on screen

Morgrog

Elias, I jsut thought of another detail I forgot to mention in the previous posts...

When I run my app under Linux, I have no window border whatsoever (my guess is that any windowed lwjgl app would have the default wm's border eh? I have none)

Did you have any border when running yours?  I dunno if this has any impact on my problem :(

elias

That's odd, I have borders on my windows... Did you try the version on CVS?

- elias

Morgrog

no I didn't get the chance to

will do prolly tonight, if I can figure out how CVS works ;)

Can I get the binaries from the CVS or do I have to compile everything?





finally, wooooa that was a fast reply, do you hang around here all the time? ;)

elias

You have to compile everything :-) But it sounds like the borderless windows result from LWJGL being confused whether it is in fullscreen or not. Which Window.create are you calling?


I don't hang around, but I check the "notify me on reply" option :-)

- elias

Morgrog

I wish I was at home learning openGL thru lwjgl, alas I'm stuck at work doing J2EE :/


My init code (it's a work in progress)
:)

/** Init lwjgl (display and input if needed)
	 */
	
	public void init_lwjgl( int width, int height, int bpp )
	{
		// Find the display mode
		DisplayMode[] modes = Display.getAvailableDisplayModes();

		// Useful for fullscreen
		for(int i = 0; i < modes.length; i++)
		{
			if( modes[i].width == width
				&& modes[i].height == height
				&& modes[i].bpp >= bpp )
			{
				mode = modes[i];
			}
		}
		try
		{
			// Start in windowed mode
			Window.create("Nehe01", 50, 50, width, height, Display.getDepth(), 0, 8, 0);

			init_gl();
		} catch(Exception e) 
		{
			e.printStackTrace();
		}
	}



I'll start by fixing my xserver then I'll check with the latest CVS build and I'll get back to you


I forgot about the notify on reply thingy hehe  :oops: (that's me blushing)

elias

That seems like a windowed .create(). Should have borders in that case..

- elias

Morgrog

Ok, added different screen rez to my xserver and I can go fullscreen now *applauds*

but, I still don't have a window border :(

Altho it's not that important, I really wanted to get the fullscreen thingy fixed

I'll try with the CVS version later and tell you how it went :)