PDA

View Full Version : OpenGL fullscreen on one monitor (dual system)


JeffVolc
11-11-02, 02:34 PM
Hello Everybody,

I have a Geforce2 MX dual with two monitors (17" NEC and 9" SVGA off-brand) running Mandrake 9 RPMed in from the SRPMs. Xinerama works great especially for full screening XawTV on the small 9" screen.

However, when I play OpenGL apps like Terminus it wants to use both screens. Is there any way I can have it full screen on the first monitor so I can watch TV on the second? If not, how about a dual independent display setup where I would Ctrl-Alt-F7 for monitor one and Ctrl-Alt-F8 for monitor two (with seperate logins).

There isn't an option for OpenGL in a window is there?

Thanks,
Jeff

bwkaz
11-12-02, 08:10 AM
Where in the UP are you from, out of curiosity? I'm at MTU now, in Houghton. ;)

Yes, OpenGL will work in a window just fine. glxgears, in fact, uses it.

If you want one screen on VC 7 and the other on VC 8, then you won't be able to do Xinerama. You'll want to turn it and TwinView both off in your XF86Config-4 file, then actually create two config files.

In one, set it up to display normally to your 17" monitor. Call the file XF86Config-4-monitor or something.

In the other, set it up to display to your TV screen. Call that file XF86Config-4-TV or something.

Then, set the XF86CONFIG environment variable to either XF86Config-4-monitor or XF86Config-4-TV before you startx, and the corresponding config file will be used. The first server you start will be display :0.0, and the second will be display :1.0.

I am almost positive that this won't work when you boot to runlevel 5 (graphical login), though. The reason is that you have to set the environment variable before X starts, and that runlevel starts X automatically. So edit /etc/inittab, and where it says id:5:initdefault:, change the 5 to be a 3. Then reboot, and you'll come up to a text-mode login screen. So log in, and then export XF86CONFIG=XF86Config-4-monitor ; startx to get the monitor's display up. Open up a terminal emulator, and do an export XF86CONFIG=XF86Config-4-TV ; startx to get the TV's display up.

Hopefully that works, anyway...

Yeah, the reason Terminus wants to use the full screen is probably because you have TwinView enabled with the MetaModes option. MetaModes makes the card report one large screen to the X server, which passes that information along to any naive programs that may be running when they ask what the resolution is. So if the naive program tries to go full-screen, it will use both monitors, because it doesn't know any better. If it was smarter and understood the Xinerama extension, it could be configurable to just take up one screen, but it sounds like Terminus doesn't understand Xinerama very well or something.

MadDog
11-13-02, 03:05 AM
excuse my ignorance ?

can I assume that the export command does the equivalent of the DOS SET command, to set the value of an Environment variable ?

:confused:

I'm still pretty new to this aswell, I have the new drivers installed on MDK 9, and I have OPENGL working, but I suffer from the same twinview problem.

If I remove the matamodes, can I still use my second monitor as a virtual desktop rather than an extended desktop ?

Regards

MadDog

JeffVolc
11-13-02, 07:39 AM
I live in Marqutte a few blocks over from NMU. I never went to NMU though. I've been out of college for a decade now.

Anyway, the only thing extra I add is the following for the second monitor:

*** snip ***
Option "TwinView"
Option "SecondMonitorHorizSync" "31.5"
Option "SecondMonitorVertRefresh" "50-60"
Option "MetaModes" "800x600,640x480"
Option "ConnectedMonitor" "CRT, CRT"
Option "TwinViewOrientation" "LeftOf"
*** snip ***

What would the second config look like? I've seen other people mention using two configs before, but that is with two video cards. Does the Xfree86 NV driver support dualhead on the matrox cards? I use the Nvidia drivers.

Thanks,
Jeff

UncleLumpy
11-13-02, 11:08 AM
Regarding MadDog's query - export under bash is quite like DOS SET.

Strictly it both sets the environment variable and flags it as inheritable by
any subprocesses later created (by running other commands from *that*
bash prompt).

The tcsh (or csh) equivalent is "setenv" - but the effect is the same.

****

Now to the issue of dual head - I posed a question on this topic before JeffVolc mentioned that he'd asked a similar question (apologies).

I too want to control the two heads seperately either with an X server
running on each or an x server on one and a framebuffer on the other.
Basically I want to turn one head (using a monitor) over to TV and DVD/VCD/MPEG playback (maybe using MythTV).

I will try what bwkaz suggests. In fact my monitors are similar so I can just fire up two X servers using the same config.

What I had wondered was whether you needed to pass any weird driver options to the nvidia driver in the second config so say "we are now driving the second head" - maybe telling it to use a different IO port or something. Maybe the driver notices it's instanciated twice and does the right thing?

Anyway - some experimentation should be interesting - I'll be back in a day or so with my findings.

PS - if it works I think I can fix up a runlevel 5 script that will start two
X servers, one with an XDM and the other starting a captive application.


Cheers

Timbo

r0gu3
11-13-02, 11:14 AM
Welll having multiple configs is a confusingly complicated way to do something that Xfree86 can do on its own...
have only one config and then have multiple card-entries (although they are the same card) then have multiple screen-entries and then have multiple layouts...

For example... I have a rather large XF86Config file since i change my hardware around once in a while..

r0gu3.codices.net/?XF86Config

I am working on a general solution to problems like this.. (an addition to Xfree86)

But if you have mutliple Xservers running right now you can't view them both at the same time...

If you really want something like this and have some time to mess around with this stuff then you can read about XGGI and some other stuff here (http://r0gu3.codices.net/) and here (http://www.ggi-project.org)

I hope this helps you...

And BTW: YES export works exactly like set in dos... but only when your shell is bash... if you shell is csh then your gonna wanna do a setenv
:)

- r0gu3

UncleLumpy
11-13-02, 12:12 PM
Hi r0gu3

Of course - you are right to point that out. Much cleaner.

I think what I am getting confused about is whether the Geforce2 MX dual head card can support 2 x-severs simultaneously - ie behave like 2 independant graphics cards?

Cheers

Timbo

bwkaz
11-13-02, 12:42 PM
I have never tried it, but I think that if you set "ConnectedMonitor" to "CRT", then it will know to output on the CRT head, and if "ConnectedMonitor" is "DFP", then it will know to ouput on the DVI head.

Although now that I think about it, it is possible that the head changes... so I'm not sure how you'd get around that.

:-/

And if the GF2 MX is CRT-CRT, then this isn't an option anyway...

r0gu3
11-13-02, 03:51 PM
Well the answer i believe your looking for bwkaz is "CRT2" (i am pretty sure...) although if i am wrong you can get around this with metamodes...

but back to the main question, to get it to look like multiple screens(or even xservers) there is no natural way to do this...

BUT your not out of luck :)
You CAN start up multiple instances of XGGI( or xnest for that matter) and force them into the right positions :)

- r0gu3

UncleLumpy
11-14-02, 04:40 AM
but back to the main question, to get it to look like multiple screens(or even xservers) there is no natural way to do this...

Hmm - thanks for that. It's a definative answer.
After getting Twinmode to work, and much playing around, I came to the same conclusion.

BUT your not out of luck
You CAN start up multiple instances of XGGI( or xnest for that matter) and force them into the right positions

Thta's true. Or for plan B in my case, get a second PCI graphics card. Or Plan C - use an old PC and an X terminal and run a remote X session.

Many thanks anyway :-)

Best

Timbo
_____________

JeffVolc
11-14-02, 07:57 AM
So, to sum it up....

A GeForce2 MX dualhead card CANNOT do dual independent? What about disabling Xinerama and running a window manager like blackbox? Would I have two seperate screens which just share the keyboard & mouse? XGGI looks pretty old... does it support a GeForce dualhead?

I didn't see any comments about the NV driver from Xfree86... does it support the second monitor? If it did then we could setup a single config with dual independent....

Anyone from Nvidia or Xfree86 have any input here?

Thanks for all the great discussion everyone.

Jeff

r0gu3
11-14-02, 02:24 PM
Well to answer the easy questions first:
1. no the nv driver can't run the second monitor...
2. the nvidia driver doesn't use multiple screens... and there in doesn't REALLY use xinerama, although it does export the xinerama information for the window managers...

And back to my point about XGGI and/or XNest...
You can use either of these utilities to setup a FAKE multiple screen setup... lemme explain... XGGI may be old (as in its based off the xfree86 3.x tree) BUT its not going to drive your video card directly, you still need to use nvidia's drivers to do that... so an example setup would be
#!/bin/bash
export DISPLAY=":0"
XFree86 $DISPLAY &
sleep 2
XGGI -with the right geometries and position :1 &
XGGI -with the right geometries and position :2 &
sleep 2
twm -display :1 &
twm -display :2

Then if you setup the geometries right you will have 2 seperate screens (actually seperate xservers) with the same mouse and keyboard... The tricky part is the placement of the XGGI windows... but you probably already have Xnest installed... That should work also, but i don't know if it can place the windows properly (i believe xggi can)

So basically if you didn't wanna run a window manager on the 2nd monitor, assuming thats :2, then you could just run mplayer like this...
DISPLAY=":2" mplayer -dvd 1 -fs
or what ever other movie player you want

See the reason XGGI and Xnest will work reguardless of age is because they are not only X servers, but they are(and XGGI can act as) clients as well...

If you need a little more explanation of any other questions just ask away :)

- r0gu3

JeffVolc
11-16-02, 08:55 AM
I tried XGGI, but get black screens. Anyone tried using XGGI with a Geforce Twin card and had success?

Do I comment out the twinview option in XF86Config-4?

Jeff

r0gu3
11-17-02, 02:23 PM
Well i think your misunderstanding me :)

you have to start Xfree86 normally, without a window manager... Then after its running export the correct display information for ggi (read the doc on www.ggi-project.org to see what i mean about display info) and then start multiple times and they will display INSIDE of Xfree86... kind of like Xnest does :)

- r0gu3

Tam
11-18-02, 04:03 PM
I suppose we are not the only one who wish they could use their NV dualheadcards just like two individual singlehead cards...
Is this support to be programmed in a near future? Would be a good idea, imho.

cu
Tam