Problems with Multiple Monitors on Linux

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Crendgrim
Posts: 3
Joined: Mon May 30, 2011 11:49 am

Problems with Multiple Monitors on Linux

Post by Crendgrim »

Hello there! :)
I have, or rather SuperTuxKart has, got a problem with Irrlicht (current trunk version). I volunteered to ask here about it to unburden STK's developers a bit. :P
Okay, here we go: I'm on Linux (64bit) and have a two-screen setup. My main screen has got a resolution of 1920x1080px and my second screen one of 1280x1024.
SuperTuxKart uses the following code to discover possible screen sizes:

Code: Select all

...
        m_device = createDevice(video::EDT_NULL);
        
        video::IVideoModeList* modes = m_device->getVideoModeList();
        const int count = modes->getVideoModeCount();

        for(int i=0; i<count; i++)
        {
            // only consider 32-bit resolutions for now
            if (modes->getVideoModeDepth(i) >= 24)
            {
                const int w = modes->getVideoModeResolution(i).Width;
                const int h = modes->getVideoModeResolution(i).Height;
                if (h < MIN_SUPPORTED_HEIGHT || w < MIN_SUPPORTED_WIDTH) 
                    continue;

                VideoMode mode;
                mode.width = w;
                mode.height = h;
                m_modes.push_back( mode );
            }
        }
        m_device->closeDevice();
...
However, here Irrlicht only returns the size of 3200x1080px (so, across both screens).
Is anything wrong with STK's code or is this a Irrlicht bug?

Hopefully this is in the right section. If not, please move it. :)


Crend
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The values stored in the display list are what xrandr or xf86vm return. But if you use a xinerama desktop, that's what would be expected. After all there's no single monitor full screen mode with dual setup, and windowed mode can use anything up to the maximal desktop size.
If there are things to query those x11 extensions which return better values, we can easily add support for that. Maybe CuteAlien knows more, I think he has a multi monitor Linux setup.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Sorry, no. I'm long back to a single monitor setup (my graphic card was too weak for 2 monitors) and got no idea :-(
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Crendgrim
Posts: 3
Joined: Mon May 30, 2011 11:49 am

Post by Crendgrim »

So far, I wasn't able to get my screens' resolutions. I cannot imagine there's no way, though.
The best until now was to find which monitors are connected. Now I still have to discover how to get their resolutions.

Code: Select all

crendgrim@mylinux:~> nvidia-settings -q screens -V

1 X Screen on mylinux:0

    [0] mylinux:0.0 (GeForce GTS 250)

      Is connected to the following display devices:
        NUL (CRT-1: 0x00000002)
        Samsung SyncMaster (DFP-0: 0x00010000)

      Is connected to the following GPU:
        [0] mylinux:0[gpu:0] (GeForce GTS 250)

Crend
Crendgrim
Posts: 3
Joined: Mon May 30, 2011 11:49 am

Post by Crendgrim »

Okay, further investigation showed an incompatibility with the official nVidia graphic drivers for openSUSE.
It looks as if the graphics driver really only gives the complete screen size (3200x1080 px), while it does tell the Window Manager where the separate monitors are.
However, using the (open source) nouveau drivers on my fresh, clean installation, this problem seems to be gone (or, to be precise, it looks as if it's handled better by the KDE WindowManager itself).

So, thanks for all your help both here on the forums and on IRC. :)


Crend
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, that sounds at least not too bad :wink:
Post Reply