"Couldn't find matching GLX visual"
#11
(10-14-2014, 06:12 PM)derhass link Wrote:The error messages you get are not missing packages, but either a problem with the source code itself, or your compiler being to old. I remember kp added some C11-isms to the code, so you will need a fairly recent gcc to built it, but I forgot which version you exactly will need. If that is actually the issue, I think we should add a compiler version check to the SConstruct file.
I recommend using the newest stable gcc offered by the distribution.  Versions down to 4.7 work for me with my regular build.  gcc 4.6 used to work if you bypassed a bogus warning that was fixed in gcc 4.7; it warns about needing parentheses in an expression that is already fully parenthesized.  However, gcc 4.6 seems not to understand the construct that TheObserver reported.  I remember that call site because I had to use the brace syntax since vms_vector has no user-defined constructors.  It broke in ff37e54087217ae676fa719ef57ecd4ae277009e, which was published Thu Oct 2 03:02:34 2014.

We have lots of compiler checks in scons already to identify supported features.

(10-15-2014, 12:24 AM)TheObserver link Wrote:This is the compiler that installs with still-officially-supported Ubuntu 12.04 derivatives - it's not bleeding-edge but it's new enough...
Clearly not new enough. Smile  Is Ubuntu 12.04 really unable to install gcc-4.7?  I can fix this if I have to, but it makes the code ugly just to support a compiler that is already dead upstream.
(10-15-2014, 12:24 AM)TheObserver link Wrote:(I *really hope* the newer developments of dxx don't get pushed into incompatibility with "slightly old" systems for no good reason! I don't want to be locked out of everything fun because I don't constantly upgrade.  Sad )
They won't.  They will be pushed into incompatibility for a very good reason. Wink

On that topic, the oldest supported version is determined in part by what people test on, so if people stop using a given compiler and it breaks, no one will know and it won't be fixed.  Please do report problems even if you are on an old environment.
Reply
#12
Well, thanks for helping me look into this, all. I'm not proficient with code at all,  compiling and making things is about the extent of my abilities. Here's what I got fro apitrace on a re-built D2X with opengl enabled:

(Note: I changed screen resolution in the software version which is why it's giving me the same error for a different video mode this time...)

Code:
$ ~/utils/apitrace-master/build/apitrace trace d2x-rebirth
apitrace: loaded into ~/Jeux/d2x-rebirth-src/d2x-rebirth_v0.58.1-src/d2x-rebirth

Type d2x-rebirth -help' for a list of command-line options.

D2X-Rebirth v0.58.1  Oct 16 2014 12:48:22
This is a MODIFIED version of Descent 2, based on Full Version v1.2.
Copyright (C) 1994-1996 Parallax Software Corporation
DESCENT is a trademark of Interplay Productions, Inc.
Copyright (C) 1999 Peter Hawkins, 2002 Bradley Bell, 2005-2011 Christian Beckhaeuser

Using SDL_mixer library
sdl-joystick: found 0 joysticks
apitrace: redirecting dlopen("libGL.so.1", 0x102)
apitrace: tracing to /home/jay/Jeux/d2x-rebirth-src/d2x-rebirth_v0.58.1-src/d2x-rebirth.trace
apitrace: warning: glXChooseVisual: unknown key 0x0022, interpreting value as int
apitrace: redirecting dlopen("libGL.so.1", 0x102)

Error: Could not set 832x624x32 opengl video mode: Couldn't find matching GLX visual

$ ~/utils/apitrace-master/build/apitrace dump d2x-rebirth.trace
0 glXChooseVisual(dpy = 0x30d8630, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3, GLX_BLUE_SIZE, 2, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_SAMPLE_BUFFERS, 1, GLX_SAMPLES, 4, GLX_X_VISUAL_TYPE, 32771, 0}) = NULL
1 glXChooseVisual(dpy = 0x30d8630, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3, GLX_BLUE_SIZE, 2, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_SAMPLE_BUFFERS, 1, GLX_SAMPLES, 4, 0}) = NULL

I did find a ppa with updated Mesa drivers (10.4) but installing it will basically hose the whole system (i.e. delete KDE-base) so it's not going to happen. I'm just trying to get this working on what I have...
Reply
#13
gcc 4.6 can build unification again as of d462cd11df3c623364e7b6c1b007ed01b5d3a272.  I added an explicit temporary to work around gcc 4.6's brace initialization problem.  The optimizer will probably delete the extra copies so that there is no runtime performance hit.
Reply
#14
(10-16-2014, 12:02 AM)TheObserver link Wrote:
Code:
$ ~/utils/apitrace-master/build/apitrace dump d2x-rebirth.trace
0 glXChooseVisual(dpy = 0x30d8630, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3, GLX_BLUE_SIZE, 2, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_SAMPLE_BUFFERS, 1, GLX_SAMPLES, 4, GLX_X_VISUAL_TYPE, 32771, 0}) = NULL
1 glXChooseVisual(dpy = 0x30d8630, screen = 0, attribList = {GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3, GLX_BLUE_SIZE, 2, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 16, GLX_SAMPLE_BUFFERS, 1, GLX_SAMPLES, 4, 0}) = NULL
Interesting. It seems to request a multisample visual. I don't know if your driver does support this. IIRC, it should just ignore it if it cannot supply it, but it is worth a try: Do you have a line
Code:
Multisample=1
in your ~/.d2x-rebirth/descent.cfg ? If so, try setting that to 0.

(10-16-2014, 12:02 AM)TheObserver link Wrote:I did find a ppa with updated Mesa drivers (10.4) but installing it will basically hose the whole system (i.e. delete KDE-base) so it's not going to happen. I'm just trying to get this working on what I have...
Yeah, I wouldn't recommend doing that.
"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint Exupéry
Reply
#15
Woo! It works! Turned off multisampling and it fired right up!

I guess that was the fault... Everything else seems to work great, tried it in both 16bpp and 32 and all texture filtering options. Even 1280x1024 with everything maxed out works (albeit at 15fps.)

Problem solved!

...EXCEPT, the windows version has had multi-sampling enabled this whole time, and it works fine. Maybe Wine is using some other method to set the video mode?

Whatever, I don't care, I'm just happy to have a GL build that works. I'm going to try building an 'svn' binary from the Unification source (thanks KP!), will post back here if that works out.

(Also still having the ALSA buffer problem, but that is definitely an issue with my system config!)
Reply
#16
It's a Git version, not a Subversion version. Wink

The unification branch is under active development.  I am happy to have people testing it.  It's usually stable, but it's deliberately not able to communicate with released builds.  However, if you and a friend both use a build from the unification branch, then you can play together.
Reply
#17
(10-17-2014, 12:15 AM)TheObserver link Wrote:Woo! It works! Turned off multisampling and it fired right up!
Cool Smile

(10-17-2014, 12:15 AM)TheObserver link Wrote:...EXCEPT, the windows version has had multi-sampling enabled this whole time, and it works fine. Maybe Wine is using some other method to set the video mode?
Well, the windows version of the game (or of the SDL lib actually) will use wgl to choose a pixel format and create the GL context. Now wine will implement that on top of glX.
I don't know what exactly wine will do in this case, but it might as well ignore the multisampling request when it is unable to get a suitable visual.

Actually, apitrace should also work with wine, so you can just try that, and the first few lines of the trace should reveal what attributes actually are used. I would be quite surprised
if wine actually got a multisampling visual, while the native libSDL failed to do so, but I wouldn't deem that impossible, either...
"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove." -- Antoine de Saint Exupéry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)