libGLX & SDL1.2 on Jetson Nano

I’m trying to get a stable build of SDL1.2 on ubuntu 18.04

When creating an OpenGL window I receive:

Program received signal SIGSEGV, Segmentation fault.
0x0000007fb7b7a670 in ?? () from /usr/lib/aarch64-linux-gnu/libGLX.so.0

Caused by the following calls:
X11_GL_GetProcAddress(this, “glXSwapIntervalSGI”);
X11_GL_GetProcAddress(this, “glXSwapIntervalMESA”);
X11_GL_GetProcAddress(this, “glXSwapIntervalEXT”);

To get a good build of SDL I have made some changes in SDL_x11gl.c around line 538:

//	this->gl_data->glXSwapIntervalSGI =
//		(int (*)(int)) X11_GL_GetProcAddress(this, "glXSwapIntervalSGI");
//	this->gl_data->glXSwapIntervalMESA =
//		(GLint (*)(unsigned)) X11_GL_GetProcAddress(this, "glXSwapIntervalMESA");
//	this->gl_data->glXSwapIntervalEXT =
//		(int (*)(Display*,GLXDrawable,int)) X11_GL_GetProcAddress(this, "glXSwapIntervalEXT");
this->gl_data->glXSwapIntervalSGI = NULL;
this->gl_data->glXSwapIntervalMESA = NULL;
this->gl_data->glXSwapIntervalEXT = NULL;

I’m interested if there is a better fix for this issue other than hacking the SDL sources. Help appreciated!

Hi,

Sorry that we don’t have experience with SDL and this is also out of our support scope.
Maybe others can share some experience.

Thanks.

Thanks for your reply.

Where does /usr/lib/aarch64-linux-gnu/libGLX.so.0 come from? Is there source available?

If I track down the exact calls to this library will that be of help in gaining assistance?

Here is the list of calls to libGLX.so…

glXGetProcAddress("glXChooseVisual")
glXGetProcAddress("glXCreateContext")
glXGetProcAddress("glXDestroyContext")
glXGetProcAddress("glXMakeCurrent")
glXGetProcAddress("glXSwapBuffers")
glXGetProcAddress("glXGetConfig")
glXGetProcAddress("glXQueryExtensionsString")
glXGetProcAddress("glXSwapIntervalSGI")
Segmentation fault (core dumped)

According to https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXGetProcAddress.xml unsupported functions should return NULL.

I am guessing here that libGLX.so does not support glXSwapIntervalSGI.

Interested in this, I’m trying to run kivy apps in the jetson nano with sdl2 and getting core dumped, full error I’m getting is:

dbus[1580]: arguments to dbus_message_new_method_Call() where incorrect, assertion “path != NULL” failed in file …/…/…/dbus/dbus-message.c line 1362.
This is normally a bug in some application using the D-Bus library.

D-Bus not built with -rdynamic so unable to print a backtrace.
Abroted (core dumped)

I think is related with this, if you gather extra information about how to solve it keep us updated!

SDL2 in repository is built against a different set of headers.

I do not think this is related to the issue above.

To get a working build of SDL2 see instructions here https://in-plus.biz/danboid/wtz5OHx7TGA-doom-3-bfg-and-hurrican-running-on-the-nvidia-jetson-nano.html

Summary below:

Building SDL2 Ubuntu packages from source
Build prep
sudo apt remove libsdl2* -y
sudo apt build-dep libsdl2-2.0-0
sudo apt install build-essential fakeroot devscripts
Downloading sources
Download the latest libsdl2 source files for the most current version of Ubuntu,
currently that is Disco Dingo, even though we are running 18.04 (Bionic).
Disco is using libsdl 2.0.9:
launchpad.net/ubuntu/+source/libsdl2/2.0.9+dfsg1-1ubuntu1
The source files you need will be called something like:
libsdl2_2.0.9+dfsg1.orig.tar.xz 
libsdl2_2.0.9+dfsg1-1ubuntu1.debian.tar.xz 
libsdl2_2.0.9+dfsg1-1ubuntu1.dsc
Download these files then, from the directory containing them, run:
dpkg-source -x libsdl2_2.0.9+dfsg1-1ubuntu1.dsc
cd libsdl2-2.0.9+dfsg1/
debuild -b -uc -us
This will build the binary .deb packages you can install with:
sudo dpkg -i package.deb
Be sure to install the -dev package as well as the regular libsdl2 .deb.

Thanks!
Managed to solve it with many other intermediate problems, still getting some errors and strange behavior but not directly related with this I think, needed to install some extra packages which doesn’t get installed when following this procedure but pretty easy to find in google following the traceback.