Bug#793111: OpenGL ES2 support does not work with OpenGL support enabled
Prof. Dr. Gundolf Kiefer
gundolf.kiefer at hs-augsburg.de
Mon Sep 21 10:18:30 UTC 2015
On Fri, 18 Sep 2015 20:49:21 +0100
"Manuel A. Fernandez Montecelo" <manuel.montezelo at gmail.com> wrote:
> Control: tags -1 + moreinfo
>
>
> 2015-07-21 12:22 Prof. Dr. Gundolf Kiefer:
> >Package: libsdl2 (source package)
> >Version: 2.0.2+dfsg1-6
> >
> >It appears that in the present version (2.0.2) of libSDL2,
> >hardware acceleration based on OpenGL ES2 does not to work properly if
> >both OpenGL and OpenGL ES2 support are compiled in at the same time.
> >
> >I am using libSDL2 on an embedded Linux board (Cubietruck, A20 SoC,
> >Mali 400 GPU), running under Debian Jessie, architecture 'armhf'.
> >
> >With the stock Debian package, the renderer 'opengles2' is available,
> >i.e. reported by 'SDL_GetNumRenderDrivers'/'SDL_GetRenderDriverInfo',
> >but not functional on my system. When selected manually, 'SDL_CreateRenderer'
> >fails with the SDL error "GLX is not supported".
>
> How do you select it manually, in code or with environment variables?
In code. The invokation is
sdlRenderer = SDL_CreateRenderer (sdlWindow, 1, 0);
after
SDL_GetRenderDriverInfo (1, &renInfo);
returned the string "opengles2" in the field 'SDL_RendererInfo
renInfo.name'.
> Also, do you have any implementation of the relevant package installed,
> like "libgles2-mesa:armhf" (there are specific packages for some cards)?
Of course. Also, I tried to enforce the loading of the correct
driver using LD_PRELOAD/LD_LIBRARY_PATH, without success. On the other
hand, after compiling the Debian package with the option
'--disable-video-opengl', everything worked out-of-the-box on the same
machine and same installation.
(For completeness: I used the Mali 400 driver from
https://github.com/linux-sunxi/sunxi-mali.git, but this should not
matter in this case.)
Could the issue perhaps be related to conflicting GL and GLES2 headers?
From src/video/SDL_video.c:42:
...
/* GL and GLES2 headers conflict on Linux 32 bits */
#if SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL
#include "SDL_opengles2.h"
#endif /* SDL_VIDEO_OPENGL_ES2 && !SDL_VIDEO_OPENGL */
...
>
> Maybe the problem is that the support is there, but when it wants to
> load the library to do the actual rendering it doesn't, and emits that
> error (or tries that first and defaults to GLX and also fails -- not
> sure).
>
>
> >If I rebuild the package with the only additional configuration option
> >'--disable-video-opengl', it works fine.
> >
> >diff -p libsdl2-2.0.2+dfsg1/debian/rules libsdl2-2.0.2+dfsg1-gk1/debian/rules
> >*** libsdl2-2.0.2+dfsg1/debian/rules Thu Nov 27 18:53:32 2014
> >--- libsdl2-2.0.2+dfsg1-gk1/debian/rules Fri Jul 3 17:11:37 2015
> >*************** confflags = --disable-rpath --enable-sdl
> >*** 9,14 ****
> >--- 9,15 ----
> > --disable-nas --disable-esd --disable-arts \
> > --disable-alsa-shared --disable-pulseaudio-shared \
> > --disable-x11-shared --disable-video-directfb \
> >+ --disable-video-opengl \
> > --enable-video-opengles \
> > --enable-video-wayland --disable-wayland-shared
> >
> >
> >I am not too familiar with the libSDL2 code, and I am not sure if this
> >issue can easily be solved upstream. For the time being, I suggest to provide
> >two alternative binary packages with EITHER OpenGL or OpenGL ES2
> >enabled and the other disabled.
>
> SDL libraries had that in the past with audio drivers, and actually it
> is quite a hassle.
>
> If the driver GLX does not work in armhf, maybe it's better to disable
> it altogether.
>
>
> Cheers.
---------------------------------------------------------------
Prof. Dr. Gundolf Kiefer
Effiziente Eingebettete Systeme - Efficient Embedded Systems
Fakultät für Informatik - Faculty of Computer Science
Hochschule Augsburg - University of Applied Sciences
http://www.hs-augsburg.de/~kiefer
---------------------------------------------------------------
More information about the Pkg-sdl-maintainers
mailing list