Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault on RPi 3 #66

Closed
HelloOO7 opened this issue Aug 4, 2018 · 119 comments
Closed

Segfault on RPi 3 #66

HelloOO7 opened this issue Aug 4, 2018 · 119 comments

Comments

@HelloOO7
Copy link

HelloOO7 commented Aug 4, 2018

Hey,
I've compiled latest gl4es with -DBCMHOST=1 on my RPi 3 and tried running OpenMW and Minecraft. Both loaded the libraries (libGL: Initializin gl4es... etc...) and failed with Segmentation fault, even though they haven't launched at all (I ran OpenMW with only --help, to check if it runs). I'm unsure if the SDL that came with my distro (RetroPie) was compiled with OpenGL support, so I tested glxgears and the same thing happened (Segfault with no window or anything appearing).

I've tested both GLES1 and 2 backends.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 4, 2018

Can you copy-paste the whole gl4es output here?

Do you know how to make a gdb backtrace also?

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 4, 2018

@ptitSeb


LIBGL: Initializing gl4es
LIBGL: v1.0.9 built on Aug 1 2018 08:11:24 (the date and time is messed up)
LIBGL: Using GLES 2.0 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libGLESv2.so
LIBGL:loaded: libEGL.so
LIBGL: Using GLES 2.0 backend
Segmentation fault

(It's not a copy paste, I've rewritten it here, because I'm too lazy to log outside X11)

Yeah, I KINDA know how to use gdb, but I haven't yet figured out how to use the environment variable LD_LIBRARY_PATH in there.

Edit: Figured it out. Here:


LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 08:11:24
LIBGL: Using GLES 1.1 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libGLESv1_CM.so
LIBGL:loaded: libEGL.so
LIBGL: Using GLES 1.1 backend
[New Thread 0x70ef92b0 (LWP 10667)]

Thread 1 "openmw" received signal SIGSEGV, Segmentation fault.
__GI_strstr (haystack_start=haystack_start@entry=0x0, 
    needle_start=0x74ee4a4c "GL_APPLE_texture_2D_limited_npot") at strstr.c:63
63	strstr.c: No such file or directory.
(gdb) backtrace
#0  __GI_strstr (haystack_start=haystack_start@entry=0x0, 
    needle_start=0x74ee4a4c "GL_APPLE_texture_2D_limited_npot") at strstr.c:63
#1  0x74ebfb80 in GetHardwareExtensions (notest=notest@entry=0)
    at /home/pi/code/gl4es/src/glx/hardext.c:137
#2  0x74e0b0d8 in initialize_gl4es () at /home/pi/code/gl4es/src/gl/init.c:145
#3  0x76fdee30 in call_init (l=<optimized out>, argc=argc@entry=1, 
    argv=argv@entry=0x7efff104, env=env@entry=0x7efff10c) at dl-init.c:72
#4  0x76fdef8c in call_init (env=<optimized out>, argv=<optimized out>, 
    argc=<optimized out>, l=<optimized out>) at dl-init.c:30
#5  _dl_init (main_map=0x76fff960, argc=1, argv=0x7efff104, env=0x7efff10c)
    at dl-init.c:120
#6  0x76fcea24 in _dl_start_user () from /lib/ld-linux-armhf.so.3
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 4, 2018

It looks like GLES is not really initialized (gl4es try to check the extension availble but the extension string is NULL.
I don't really understand how the extension string can be NULL if the context has been created without error.
You can try with LIBGL_NOTEST=1 to disable that hardware testing, but I doubt it'll go farther.

Also, some I find strange is that libEGL.so and libGLESv2.so (or libGLESv1_CM.so) are loaded, I was expecting more libbrcmEGL and libbrcmGLESv2 to be loaded (but now thta I look in the loader code in src/gl/loader.c, I see the brcm are the last try, so I'm guessing that could be the issue). Can you confirm you have the brcm variant of the lib on your system?

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 4, 2018

Tested glxgears with NOTEST, it gets a bit further:

Starting program: /usr/bin/glxgears 
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 08:11:24
LIBGL: Using GLES 1.1 backend
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libGLESv1_CM.so
LIBGL:loaded: libEGL.so
LIBGL: Hardware test disabled, nothing activated...
LIBGL: Targeting OpenGL 1.5
LIBGL: Current folder is:/usr/local/share/games/openmw
[New Thread 0x7674b450 (LWP 12772)]
[New Thread 0x75dff450 (LWP 12773)]
[New Thread 0x755ff450 (LWP 12774)]
[New Thread 0x74dff450 (LWP 12775)]
Getting an X11 EGL Display.
Getting window information...
Window Location: 0,0 
 Window Dimensions 300 x 300 
 Bit depth : 24 
EGL Surface Created
LIBGL: ERROR: EGL Error detected: EGL_BAD_MATCH (0x0)
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  73 (X_GetImage)
  Serial number of failed request:  17
  Current serial number in output stream:  17
[Thread 0x74dff450 (LWP 12775) exited]
[Thread 0x755ff450 (LWP 12774) exited]
[Thread 0x75dff450 (LWP 12773) exited]
[Thread 0x76ff49d0 (LWP 12769) exited]
[Inferior 1 (process 12769) exited with code 01]

OpenMW actually launches (!!), but I never used it from CLI before and the documentation is horrible, so I can't actually run the game. If you have any experiences of how to link the bsa archive (it seems it can't find some textures contained in those), please let me know, so I can test it too. Though this probably doesn't belong here.

And yes, the libs you mentioned are in /opt/vc/lib.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 4, 2018

Ok, I think the wrong libs are loaded.

Can you try with latest commit cab03d4 it should makes the brcm version of EGL and GLES load first, and should fix all issues. The LIBGL_NOTEST=1 will not be needed anymore, and glxgears should show the gears (both in GLES 1.1 and GLES 2.0)

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 4, 2018

Nope, something's still odd. Also, GLES1 doesn't use the brcm libs as they were deprecated (I believe, in Raspbian Stretch), so only 2 does something for now.

Log:

pi@retropie:~/code/gl4es $ LIBGL_ES=2 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ glxgears
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 11:11:47
LIBGL: Using GLES 2.0 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libbrcmGLESv2.so
LIBGL:loaded: libbrcmEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Hardware Limited NPOT detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 8
LIBGL: Max texture size: 2048
LIBGL: Max Varying Vector: 8
LIBGL: Texture Units: 4(8), Max lights: 8, Max planes: 6
glGetError 0x500
LIBGL: Hardware vendor is Broadcom
LIBGL: Targeting OpenGL 2.0
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: Current folder is:/home/pi/code/gl4es
LIBGL: Unable to create EGL display.
Error: glXCreateContext failed
pi@retropie:~/code/gl4es $ LIBGL_ES=1 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ glxgears
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 11:11:47
LIBGL: Using GLES 1.1 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libGLESv1_CM.so
LIBGL:loaded: libEGL.so
LIBGL: Using GLES 1.1 backend
Segmentation fault

GDB for ES1 is still the same,

[New Thread 0x7674b450 (LWP 2624)]

Thread 1 "glxgears" received signal SIGSEGV, Segmentation fault.
__GI_strstr (haystack_start=haystack_start@entry=0x0, 
    needle_start=0x76e84a34 "GL_APPLE_texture_2D_limited_npot") at strstr.c:63
63	strstr.c: No such file or directory.
(gdb) 

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 4, 2018

Ok, the ES1.1 is stilll using regulat EGL/GLES1. I guess libbrcmGLESv1_CM.so doesn't exist, and is named slightly differently?

For ES2.0, the right libs are loaded, but it seems it cannot create EGL context correctly.
Try to use LIBGL_FB=3 to test glxgears. It's the slowest mode, but it may work better.
You can also try LIBGL_FB=1 (but it will probably be fullscreen only).

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 4, 2018

Yeah, I said that the ES1 libraries are no longer distributed, anyway, FB3 gives some real nice results:

pi@retropie:~/code/gl4es $ LIBGL_FB=3 LIBGL_ES=2 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ glxgears
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 11:11:47
LIBGL: using pbuffer
LIBGL: Using GLES 2.0 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libbrcmGLESv2.so
LIBGL:loaded: libbrcmEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Hardware Limited NPOT detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 8
LIBGL: Max texture size: 2048
LIBGL: Max Varying Vector: 8
LIBGL: Texture Units: 4(8), Max lights: 8, Max planes: 6
glGetError 0x500
LIBGL: Hardware vendor is Broadcom
LIBGL: Targeting OpenGL 2.0
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: Current folder is:/home/pi/code/gl4es
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
945 frames in 5.0 seconds = 188.857 FPS
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
      after 4582 requests (4580 known processed) with 0 events remaining.
pi@retropie:~/code/gl4es $ LIBGL_FB=1 LIBGL_ES=2 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ glxgears
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 11:11:47
LIBGL: framebuffer output enabled
LIBGL: Using GLES 2.0 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libbrcmGLESv2.so
LIBGL:loaded: libbrcmEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Hardware Limited NPOT detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 8
LIBGL: Max texture size: 2048
LIBGL: Max Varying Vector: 8
LIBGL: Texture Units: 4(8), Max lights: 8, Max planes: 6
glGetError 0x500
LIBGL: Hardware vendor is Broadcom
LIBGL: Targeting OpenGL 2.0
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: glXMakeCurrent FBO workaround enabled
LIBGL: Current folder is:/home/pi/code/gl4es
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
300 frames in 5.0 seconds = 59.846 FPS
XIO:  fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0"
      after 17 requests (15 known processed) with 0 events remaini

(It's the output of both 3 and 1)

So that's glxgears somehow worked around. Any instructions on how to get OpenMW running? Everything I can find uses the GUI/launcher, not the source-compiled CLI. Yeah, I know it's a bit off-issue-topic, but it should push the tests forward. I'll try Minecraft in the meantime.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 4, 2018

Ah yes, I somehow didn't read the part about ES1.1 beeing deprecated. Maybe you can build with default to ES2.0 then, using -DDEFAULT_ES2=1 in the cmake call (I should better document that one).

So FB=3 is 3x faster than FB=1? Interesting.

Now, about OpenMW, I used only the qt launcher on my side (on the Pandora, that is also ARM and using gl4es for OpenMW, with qt built for GLES2 and OpenMW built for GL using gl4es). I don't know what kind of command line argument should be used. Why don't you build the launcher?

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 4, 2018

Can't. There's some bad conflicting declaration between freeglut, which uses GLES and Qt4, which uses GL. I could probably solve it by compiling Qt4 manually, but I'll probaby just copy over a config from my PC. Currently I'm trying to get MC working too, but I have to change a few scripts to work with my Java, so that'll take some time. I'll call it a day for today and get some sleep. I'll try to keep you informed with the test results here.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 4, 2018

You should have freeglut compiled against OpenGL and Qt4 compiled against GLES2. That had worked for me. Qt4 should work with gl4es and so OpenGL now, but I haven't tested it yet.

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 5, 2018

Hello again, here's Minecraft (no difference between FB 3 and 1 AFAIK):

pi@retropie:~/Minecraft $ LIBGL_ES=2 LIBGL_FB=1 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ ./runOptifine1_12_1.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   743  100   585  100   158   1264    341 --:--:-- --:--:-- --:--:--  1266
todays access token = 4353b6a69dba43d897b569f8d11e7638
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    75  100    63  100    12    196     37 --:--:-- --:--:-- --:--:--   196
MINECRAFT_UUID=5f55110171074765b2f579395cd3d879
Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
[13:23:49] [main/INFO]: Loading tweak class name optifine.OptiFineTweaker
[13:23:49] [main/INFO]: Using primary tweak class name optifine.OptiFineTweaker
[13:23:49] [main/INFO]: Calling tweak class optifine.OptiFineTweaker
OptiFineTweaker: acceptOptions
OptiFineTweaker: injectIntoClassLoader
OptiFine ClassTransformer
OptiFine URL: file:/home/pi/.minecraft/libraries/optifine/OptiFine/1.12.1_HD_U_C5/OptiFine-1.12.1_HD_U_C5.jar
OptiFine ZIP file: /home/pi/.minecraft/libraries/optifine/OptiFine/1.12.1_HD_U_C5/OptiFine-1.12.1_HD_U_C5.jar
OptiFineTweaker: getLaunchArguments
OptiFineTweaker: getLaunchTarget
[13:23:50] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[13:23:53] [main/INFO]: Setting user: cendarehor
[13:24:01] [main/INFO]: [OptiFine] *** Reflector Forge ***
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.Attributes
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: mods.betterfoliage.client.BetterFoliageClient
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.asm.transformers.BlamingTransformer
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.event.world.ChunkWatchEvent$UnWatch
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.relauncher.CoreModManager
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.DimensionManager
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Pre
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Post
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.EntityViewRenderEvent$CameraSetup
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.EntityViewRenderEvent$FogColors
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.EntityViewRenderEvent$RenderFogEvent
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.eventhandler.Event
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.eventhandler.EventBus
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.eventhandler.Event$Result
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.property.ExtendedBlockState
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.FMLClientHandler
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.FMLCommonHandler
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: anh.getWaterColorMultiplier
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.addDestroyEffects
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.addHitEffects
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.canCreatureSpawn
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.canRenderInLayer
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.doesSideBlockRendering
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getBedDirection
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getExtendedState
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getFogColor
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getLightOpacity
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getLightValue
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getSoundType
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.hasTileEntity
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isAir
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isBed
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isBedFoot
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isSideSolid
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: and.isSideSolid
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: vg.canRiderInteract
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Field not present: vg.captureDrops
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Field not present: vg.capturedDrops
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: vg.shouldRenderInPass
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: vg.shouldRiderSit
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.event.ForgeEventFactory
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.ForgeHooks
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.ForgeHooksClient
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Field not present: ain.delegate
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.getDurabilityForDisplay
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.getRGBDurabilityForDisplay
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.isShield
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.onEntitySwing
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.shouldCauseReequipAnimation
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.showDurabilityBar
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: bwa.handleItemState
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: agv.hasOverlay
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: bhy.setKeyConflictContext
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: bhy.setKeyModifierAndCode
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: bhy.getKeyModifier
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.ForgeModContainer
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: bvv.parseFromReader
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: uz.shouldRenderHUD
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: uz.renderHUDEffect
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: va.isCurativeItem
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.canRenderBreaking
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.getRenderBoundingBox
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.hasFastRenderer
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.shouldRenderInPass
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ceb$b.preDraw
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: ceb$b.postDraw
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: amu.countEntities
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: amu.getPerWorldStorage
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: amu.initCapabilities
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aym.getCloudRenderer
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aym.getSkyRenderer
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Method not present: aym.getWeatherRenderer
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.GuiModList
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.property.IExtendedBlockState
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.IModel
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.IRenderHandler
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.ItemModelMesherForge
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.settings.KeyConflictContext
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.settings.KeyModifier
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.pipeline.LightUtil
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.MinecraftForge
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.MinecraftForgeClient
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.ModelLoader
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.gui.NotificationModUpdateScreen
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderBlockOverlayEvent$OverlayType
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.registry.RenderingRegistry
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderItemInFrameEvent
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Pre
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Post
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Specials$Pre
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Specials$Post
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.ScreenshotEvent
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.SplashProgress
[13:24:01] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.event.world.WorldEvent$Load
[13:24:01] [main/INFO]: [OptiFine] *** Reflector Vanilla ***
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 11:11:47
LIBGL: framebuffer output enabled
LIBGL: Using GLES 2.0 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libbrcmGLESv2.so
LIBGL:loaded: libbrcmEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Hardware Limited NPOT detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 8
LIBGL: Max texture size: 2048
LIBGL: Max Varying Vector: 8
LIBGL: Texture Units: 4(8), Max lights: 8, Max planes: 6
glGetError 0x500
LIBGL: Hardware vendor is Broadcom
LIBGL: Targeting OpenGL 2.0
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: glXMakeCurrent FBO workaround enabled
LIBGL: Current folder is:/home/pi/Minecraft
glX stub: glXGetCurrentReadDrawable
glX stub: glXSelectEvent
glX stub: glXGetSelectedEvent
glXGetProcAddress: glXEnumerateVideoDevicesNV not found.
glXGetProcAddress: glXBindVideoCaptureDeviceNV not found.
Illegal instruction

I got OpenMW to launch, but no luck with displaying anything except a cursor so far:

Script started on Wed 01 Aug 2018 13:20:20 UTC

  �[m��[31m   .***.     �[m��[32mWednesday,  1 August 2018,  1:20:21 pm UTC
  �[m��[31m   ***�[1m�[37m*�[m��[31m*     �[m��[32mLinux 4.14.52-v7+ armv7l GNU/Linux
  �[m��[31m   `***'     
  �[1m�[37m    |*|      �[m��[33mFilesystem      Size  Used Avail Use% Mounted on
  �[1m�[37m    |*|      �[m��[37m/dev/root       7.0G  6.0G  727M  90% /
  �[1m�[31m  ..�[1m�[37m|*|�[1m�[31m..    �[m��[31mUptime.............: 0 days, 00h03m29s
  �[1m�[31m.*** �[1m�[37m*�[1m�[31m ***.  �[m��[31mMemory.............: 673416kB (Free) / 949452kB (Total)
  �[1m�[31m*******�[m��[32m@@�[1m�[31m**  �[m��[31mRunning Processes..: 123
  �[m��[31m`*�[1m�[31m****�[1m�[33m@@�[1m�[31m*�[m��[31m*'  �[m��[31mIP Address.........: 192.168.1.101
  �[m��[31m `*******'   Temperature........: CPU: 53°C/127°F GPU: 52°C/125°F
  �[m��[31m   `"""'     �[m��[37mThe RetroPie Project, https://retropie.org.uk

�[01;32mpi@retropie�[00m:�[01;34m~ $�[00m exit����screen openmw.log�����������������ls�[K��rm openmw.log ��������������ls�[K��exit����LIBGL_ES=2 LIBGL_FB=3 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ sudo openmw������������[5Popenmw������sudo openmw������������[5Popenmw
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 11:11:47
LIBGL: using pbuffer
LIBGL: Using GLES 2.0 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libbrcmGLESv2.so
LIBGL:loaded: libbrcmEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Hardware Limited NPOT detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 8
LIBGL: Max texture size: 2048
LIBGL: Max Varying Vector: 8
LIBGL: Texture Units: 4(8), Max lights: 8, Max planes: 6
glGetError 0x500
LIBGL: Hardware vendor is Broadcom
LIBGL: Targeting OpenGL 2.0
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: Current folder is:/home/pi
Loading config file: /home/pi/.config/openmw/openmw.cfg... done.
Loading config file: /usr/local/etc/openmw/openmw.cfg... done.
OpenMW version 0.44.0
Revision: 452a706047
Using default (English) font encoding.
OSG version: 3.4.0
Loading settings file: /usr/local/etc/openmw/settings-default.cfg
Loading settings file: /home/pi/.config/openmw/settings.cfg
Error: Failed to read window icon, no png readerwriter found
Adding BSA archive /media/usb0/Data Files/Morrowind.bsa
Adding BSA archive /media/usb0/Data Files/Tribunal.bsa
Adding BSA archive /media/usb0/Data Files/Bloodmoon.bsa
Adding data directory /media/usb0/Data Files
Failed to create pbuffer, failing back to normal graphics window.
Error: Unable to open display ":0.0".
Failed to create graphics context for image decompression
Using default cursor.
Failed to create pbuffer, failing back to normal graphics window.
Error: Unable to open display ":0.0".
Failed to create graphics context for image decompression
Using default cursor.
Failed to create pbuffer, failing back to normal graphics window.
Error: Unable to open display ":0.0".
Failed to create graphics context for image decompression
Using default cursor.
Failed to create pbuffer, failing back to normal graphics window.
Error: Unable to open display ":0.0".
Failed to create graphics context for image decompression
Using default cursor.
Failed to create pbuffer, failing back to normal graphics window.
Error: Unable to open display ":0.0".
Failed to create graphics context for image decompression
Using default cursor.
Failed to create pbuffer, failing back to normal graphics window.
Error: Unable to open display ":0.0".
Failed to create graphics context for image decompression
Using default cursor.
Initializing OpenAL...
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Opened "ALSA Default"
  ALC Version: 1.1
  ALC Extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFTX_device_clock ALC_SOFT_HRTF ALC_SOFT_loopback ALC_SOFT_pause_device
  Vendor: OpenAL Community
  Renderer: OpenAL Soft
  Version: 1.1 ALSOFT 1.17.2
  Extensions: AL_EXT_ALAW AL_EXT_BFORMAT AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_BFORMAT AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_block_alignment AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFT_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_MSADPCM AL_SOFT_source_latency AL_SOFT_source_length
HRTF disabled
Allocated 256 sound sources
Low-pass filter supported
EAX Reverb supported
Enumerated output devices:
  ALSA Default
  bcm2835 ALSA, bcm2835 ALSA (CARD=ALSA,DEV=0)
  bcm2835 ALSA, bcm2835 IEC958/HDMI (CARD=ALSA,DEV=1)
Enumerated HRTF names:
  default-44100.mhr
  default-48000.mhr
Input #0, bink, from 'video\bethesda logo.bik':
  Duration: 00:00:16.00, start: 0.000000, bitrate: 2324 kb/s
    Stream #0:0[0x0]: Video: binkvideo (BIKi / 0x694B4942), yuv420p, 640x480, 30.06 fps, 30.06 tbr, 30.06 tbn, 30.06 tbc
    Stream #0:1[0x0]: Audio: binkaudio_rdft, 44100 Hz, stereo, flt
�[1;34m[swscaler @ 0x6bb714b0] �[0m�[0;33mNo accelerated colorspace conversion found from yuv420p to rgba.
�[0m�[0;36m[binkaudio_rdft @ 0x1b5edc0] �[0m�[0;33mMultiple frames in a packet.
�[0mBus error
�[01;32mpi@retropie�[00m:�[01;34m~ $�[00m f��[Kexit
exit

Script done on Wed 01 Aug 2018 13:20:52 UTC

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 5, 2018

For Minecraft: yeah, gl4es was interfering with Java JVM. I have just pushed a change that should fix the "Illegal Instruction" issue.

For OpenMW, I'm unsure what is going on. I see that it's unable to open any GL Context. That's a bit strange. How was built OSG? Is it the regular OSG, built with GL1 and GL2 atleast?
To have more detail, you can uncomment line #37 of src/glx/glx.c (the //#define DEBUG) to allow more debug printf in the GLX Context creation.

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 5, 2018

OpenMW: Yeah, now that I think about it, it probably wasn't. I got the openscenegraph-3.4 package from the regular Raspbian repo. I checked the source for it on my PC and found this line in rules:
-DOPENGL_gl_LIBRARY:STRING=/usr/lib/arm-linux-gnueabi$(ARM_FP_SUFFIX)/libGLESv2.so
This probably isn't right, is it? I'm now trying to compile OSG manually, any tips on the flags I should use or can I just cmake .? Also, do I need to recompile OpenMW after OSG's done?

Minecraft:

pi@retropie:~/Minecraft $ LIBGL_ES=2 LIBGL_FB=3 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ ./runOptifine1_12_1.sh 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   743  100   585  100   158   1062    286 --:--:-- --:--:-- --:--:--  1061
todays access token = 0a55b7060af74970bf0c240aa948b74b
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    75  100    63  100    12    209     39 --:--:-- --:--:-- --:--:--   210
MINECRAFT_UUID=5f55110171074765b2f579395cd3d879
Java HotSpot(TM) Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
[13:58:54] [main/INFO]: Loading tweak class name optifine.OptiFineTweaker
[13:58:54] [main/INFO]: Using primary tweak class name optifine.OptiFineTweaker
[13:58:54] [main/INFO]: Calling tweak class optifine.OptiFineTweaker
OptiFineTweaker: acceptOptions
OptiFineTweaker: injectIntoClassLoader
OptiFine ClassTransformer
OptiFine URL: file:/home/pi/.minecraft/libraries/optifine/OptiFine/1.12.1_HD_U_C5/OptiFine-1.12.1_HD_U_C5.jar
OptiFine ZIP file: /home/pi/.minecraft/libraries/optifine/OptiFine/1.12.1_HD_U_C5/OptiFine-1.12.1_HD_U_C5.jar
OptiFineTweaker: getLaunchArguments
OptiFineTweaker: getLaunchTarget
[13:58:55] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main}
[13:58:57] [main/INFO]: Setting user: cendarehor
[13:59:05] [main/INFO]: [OptiFine] *** Reflector Forge ***
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.Attributes
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: mods.betterfoliage.client.BetterFoliageClient
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.asm.transformers.BlamingTransformer
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.event.world.ChunkWatchEvent$UnWatch
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.relauncher.CoreModManager
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.DimensionManager
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Pre
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.GuiScreenEvent$DrawScreenEvent$Post
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.EntityViewRenderEvent$CameraSetup
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.EntityViewRenderEvent$FogColors
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.EntityViewRenderEvent$RenderFogEvent
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.eventhandler.Event
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.eventhandler.EventBus
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.eventhandler.Event$Result
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.property.ExtendedBlockState
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.FMLClientHandler
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.common.FMLCommonHandler
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: anh.getWaterColorMultiplier
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.addDestroyEffects
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.addHitEffects
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.canCreatureSpawn
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.canRenderInLayer
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.doesSideBlockRendering
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getBedDirection
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getExtendedState
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getFogColor
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getLightOpacity
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getLightValue
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.getSoundType
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.hasTileEntity
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isAir
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isBed
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isBedFoot
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: aow.isSideSolid
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: and.isSideSolid
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: vg.canRiderInteract
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Field not present: vg.captureDrops
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Field not present: vg.capturedDrops
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: vg.shouldRenderInPass
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Method not present: vg.shouldRiderSit
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.event.ForgeEventFactory
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.ForgeHooks
[13:59:05] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.ForgeHooksClient
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Field not present: ain.delegate
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.getDurabilityForDisplay
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.getRGBDurabilityForDisplay
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.isShield
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.onEntitySwing
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.shouldCauseReequipAnimation
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ain.showDurabilityBar
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: bwa.handleItemState
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: agv.hasOverlay
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: bhy.setKeyConflictContext
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: bhy.setKeyModifierAndCode
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: bhy.getKeyModifier
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.ForgeModContainer
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: bvv.parseFromReader
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: uz.shouldRenderHUD
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: uz.renderHUDEffect
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: va.isCurativeItem
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.canRenderBreaking
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.getRenderBoundingBox
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.hasFastRenderer
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: avj.shouldRenderInPass
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ceb$b.preDraw
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: ceb$b.postDraw
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: amu.countEntities
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: amu.getPerWorldStorage
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: amu.initCapabilities
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: aym.getCloudRenderer
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: aym.getSkyRenderer
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Method not present: aym.getWeatherRenderer
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.GuiModList
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.property.IExtendedBlockState
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.IModel
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.IRenderHandler
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.ItemModelMesherForge
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.settings.KeyConflictContext
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.settings.KeyModifier
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.pipeline.LightUtil
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.common.MinecraftForge
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.MinecraftForgeClient
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.model.ModelLoader
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.gui.NotificationModUpdateScreen
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderBlockOverlayEvent$OverlayType
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.registry.RenderingRegistry
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderItemInFrameEvent
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Pre
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Post
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Specials$Pre
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.RenderLivingEvent$Specials$Post
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.client.event.ScreenshotEvent
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.fml.client.SplashProgress
[13:59:06] [main/INFO]: [OptiFine] (Reflector) Class not present: net.minecraftforge.event.world.WorldEvent$Load
[13:59:06] [main/INFO]: [OptiFine] *** Reflector Vanilla ***
LIBGL: Initialising gl4es
LIBGL: v1.0.9 built on Aug  1 2018 13:49:31
LIBGL: using pbuffer
LIBGL: Using GLES 2.0 backend
LIBGL:loaded: libbcm_host.so
LIBGL:loaded: libvcos.so
LIBGL:loaded: libbrcmGLESv2.so
LIBGL:loaded: libbrcmEGL.so
LIBGL: Using GLES 2.0 backend
LIBGL: Hardware Limited NPOT detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Max vertex attrib: 8
LIBGL: Max texture size: 2048
LIBGL: Max Varying Vector: 8
LIBGL: Texture Units: 4(8), Max lights: 8, Max planes: 6
glGetError 0x500
LIBGL: Hardware vendor is Broadcom
LIBGL: Targeting OpenGL 2.0
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: Current folder is:/home/pi/Minecraft
[13:59:07] [main/INFO]: LWJGL Version: 2.9.4
glXQueryVersion(0x2cfd3240, 0x762952c8, 0x762952cc)
glXQueryExtensionString(0x2cfd3240, 0)
glXChooseFBConfig(0x2cfd3240, 0, 0x76294e88, 0x76294e80)
FBConfig doubleBufferMode=1
FBConfig redBits=9
FBConfig redBits=10
FBConfig redBits=11
glXGetFBConfigAttrib(0x2cfd3240, 0x2cdfe840, 0x8013, 0x762952f8) => 0x0001
glXChooseFBConfig(0x2cfd3240, 0, 0x76295270, 0x7629526c)
glXChooseFBConfig(0x2cfd3240, 0, 0x76295228, 0x76295224)
glXGetVisualFromFBConfig(0x2cfd3240, 0x2cdfea10)
glXCreateWindow(0x2cfd3240, 0x2cdfe928, 37748738, (nil))
glXQueryVersion(0x2cfd3240, 0x76295308, 0x7629530c)
glXQueryExtensionString(0x2cfd3240, 0)
glXChooseFBConfig(0x2cfd3240, 0, 0x76295308, 0x76295304)
glXGetFBConfigAttrib(0x2cfd3240, 0x2cdfeaf8, 0x8011, 0x76295338) => 0x0001
glXCreateNewContext(0x2cfd3240, 0x2cdfeaf8, 32788, (nil), 1), drawableType=0x01
glXCreateContextAttribsARB(0x2cfd3240, 0x2cdfeaf8, (nil), 1) config is RGBA:0000, depth=16, stencil=8, drawable=1
 => return 0x2cffbb30 (context->shared=(nil))
glXMakeContextCurrent(0x2cfd3240, 2400002, 2400002, 0x2cffbb30)
glXMakeCurrent(0x2cfd3240, 0x2400002, 0x2cffbb30), isPBuffer(drawable)=0, context->drawable=(nil), context->eglSurface=(nil)((nil)), context->doublebuff=0
XGetGeometry gives 854x480 for drawable 0x2400002
LIBGL: eglMakeCurrent(0x1, 0x2, 0x2, 0x3)
 => True
glXSwapInterval(0)
glXSwapBuffers(0x2cfd3240, 0x2400002)

Nice, looks like we are getting somewhere

[13:59:07] [main/INFO]: [OptiFine] 
[13:59:07] [main/INFO]: [OptiFine] OptiFine_1.12.1_HD_U_C5
[13:59:07] [main/INFO]: [OptiFine] Build: 20170807-181132
[13:59:07] [main/INFO]: [OptiFine] OS: Linux (arm) version 4.14.52-v7+
[13:59:07] [main/INFO]: [OptiFine] Java: 1.8.0_65, Oracle Corporation
[13:59:07] [main/INFO]: [OptiFine] VM: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
[13:59:07] [main/INFO]: [OptiFine] LWJGL: 2.9.4
[13:59:07] [main/INFO]: [OptiFine] OpenGL: GL4ES wrapper, version 2.0 gl4es wrapper 1.0.9, ptitSeb
[13:59:07] [main/INFO]: [OptiFine] OpenGL Version: 2.0.0
[13:59:07] [main/INFO]: [OptiFine] OpenGL Fancy fog: Not available (GL_NV_fog_distance)
[13:59:07] [main/INFO]: [OptiFine] OpenGL Occlussion culling: Not available (GL_ARB_occlusion_query)
[13:59:07] [main/INFO]: [OptiFine] Maximum texture size: 65536x65536
glXSwapInterval(1)
glXSwapBuffers(0x2cfd3240, 0x2400002)
[13:59:07] [Thread-3/INFO]: [OptiFine] Checking for new version

OHMYGOD YESS (window appears)

Segmentation fault

Oh... alright.

I guess this doesn't tell you much, any idea how to attach GDB to Minecraft's JVM? Can't seem to find its PID, ps shows only bash and ps.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 5, 2018

For OpenMW:
For buildng OSG, I used ccmake (the curse gui of cmake) to select manually what I want (basicaly, GL1 and GL2 at least, and no GLES backend).
You shouldn't need to rebuild OpenMW after that (but OSG is already quite a beast to build).

For MineCraft:
Maybe the segfault is also part of Java JVM mecanism? Try to comment line #393 of src/glx/glx.c and see if it goes farther or if there is still a SEGFAULT...

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 5, 2018

For MineCraft:
Don't bother with the line to comment, latest commit removed the installation of the Signal Handler by default on RPi (it will still be installed if using LIBGL_XREFRESH=1 or LIBGL_STACKTRACE=1).

@HelloOO7
Copy link
Author

HelloOO7 commented Aug 5, 2018

Alright, I'll check the changes once I get home, I'm currently away for ~10 days. Please don't close this issue until then.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 5, 2018

Don't worry, I wont close it yet (and I'm also in holiday for around 2 weeks).

@HelloOO7
Copy link
Author

Hey, so good news, Minecraft just got in-game!
The performance is about 5fps in the main menu and a bit less in-game on both FB1 and FB3, though FB1 has some heavy graphical glitches (f.e. the menu landscape is tucked in a corner). The log is pretty much normal with some occassional GLgetError 500;

OpenMW... welll... nothing has changed since recompiling OSG (and OpenMW too since it could not find the old libs). The log's the same as before except that instead of using OSG3.4 it uses 3.7. I'll try to get some more debug info for it and also check out the precompiled version on the Debian archives, as well as try using the RPi GL drivers (that is, if they work outside X11) tomorrow.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 19, 2018

Ah good.
About the glitches with FB1 and Minecraft menu, yeah, that's sort of expected. The FB1 mode use direct FrameBuffer Rendering, and it seems to cannot use any double buffering. Because the menu use an intermediate rendering and a glReadBuffer to read the result, that ntermediary image is shown (because no backbuffer is availble), so you see the heavy blinking. There is no such glitch in-game...

5fps is not super good :( , maybe there is still something wrong, I was expecting it to go faster than that on RPi3.
Don't expect better result on OpenMW if you get it to work, as it's pretty intensive for both CPU & GPU too.

No idea for now why OpenMW would not work. I'll have to retry on my side, to check current gl4es version don't have issues with it (but probably not before end next week).

@HelloOO7
Copy link
Author

Hello again, testing OpenMW with the GL driver yields no better results than with gl4es. Good news is, I got some more info on the bus error:

Thread 12 "openmw" received signal SIGBUS, Bus error.
[Switching to Thread 0x68b132b0 (LWP 1565)]
0x751b384c in ?? () from /usr/lib/arm-linux-gnueabihf/libswscale.so.4

The precompiled version is a dependency hell, for my OSG and other libs that I compiled are in /usr/local, not in /usr, and dpkg won't let me install openmw until I get the .deb versions of them, which are out of date for ARM, so it won't accept those either.

I could not find any doc on how MC should run, but my guess it that FB3 is just slower than 0..? Any clues as to why the default FB does not work?

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 20, 2018

For OpenMW, I built it all from scratch on the Pandora, including all dependancies (basically OSG and ffmpeg, I also have many built of Qt4 and qt5). Yeah, that's a lot of dependancies :(

For MC, I think I have seen video of it running at around 20 ~ 25 fps on Pi3. FB3 maybe slower than FB0, but not always. I have seen cases where it is fast. FB1 should also be fast. No ideas why FB0 doesn't work. I guess some bad interaction between X11 and EGL driver. It seems X11 is slow on RPi, especially 3D stuff.

Now, I have just retried OpenMW on the Pandora using latest gl4es. I used LIBGL_ES=2 LIBGL_MIPMAP=5 LIBGL_SHRINK=11
and LIBGL_FB=1.
I too have the error at the beggining where it tries to create the mouse cursor. And when the OpenMW window is created but is not the one with the focus... I Alt-TAB to it and after that, all is fine, games boot and and I have picture. Game start, and looks fine.

@HelloOO7
Copy link
Author

I searched for a bit about OpenMW and it seems that the SWscaler bus error was encountered in different cases, but always on RPi. I'll try recompiling FFmpeg from source.

Testing MC with the GL driver gets me around CINEMATIC EXPERIENCE 24 FPS. Considering GL4ES is a translator, 5 FPS seems about right. I exaggerated a bit about the framerate though, it's more like 1-2FPS. What surprises me is that the Pandora's HW isn't THAT good and it still is playable. I have a feeling that it might be running over a SW renderer or something (the F3 MC info says that the GPU is GL4ES though).

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 20, 2018

I would expect the speed to be on par with the GL driver. It's a translator but there are some optimizations that make gl4es not really slow (I have done test on a Linux x64 running on a VBox VM, and gl4es is sometimes faster than the built in driver).
But I agree, there is something wrong... Still it seems to be using Broadcom hardware (if the LIBGL: printf at the beggining are still the same as the one in post #66 (comment)
If you have "perf", running a sudo perf top in another terminal can, maybe, show what is slowing everything down.

@HelloOO7
Copy link
Author

A quick MC update while compiling FFmpeg, MC actually works pretty good. The problem was that the game spawned me underwater where the performance was terrible, then when I respawned on a beach, I got around 10 FPS. Perf didn't show anything suspicious. Was about to take a screenshot and...
That's when my Pi started making weird sounds and drawing messed up picture. After a hard reboot, it's back up and running.
Now it freezes after a while with "Wait timeout... buffer size too low".

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 20, 2018

Temperature issue? Then the freeze left some MC data corrupted?

@HelloOO7
Copy link
Author

Oh my bad, I probably worded it wrong. Yeah, the crash is definitely because of temperature, but the freeze occurs after a few minutes of playing. I'll test some more to see if it's actually GL4ES's issue, but rn I'm busy compiling FFmpeg. In the meantime, if you know some confirmed working GL4ES-compatible program that I can test, I'll get right to it.

@ptitSeb
Copy link
Owner

ptitSeb commented Aug 20, 2018

From debian repo, you can try "neverball", it should work fine.
Also TORCS runs (but use LIBGL_BATCH=10 for better performances). From my github account, stuntcarremake, Protoype and TreadMarks all works and and not too heavy graphically (and data are included).

@HelloOO7
Copy link
Author

HelloOO7 commented Sep 6, 2018

Progress report: I'm still stuck with ffmpeg. After compiling it from source and recompiling OSG, openmw compiles fine but fails at 100% when linking the executable with completely unrelated error.
(solved it by linking -lz in openmw's link.txt). Now there's another problem - ld returns exit status 1. And that's literally all it says. In VERBOSE=1. No details on the error and no previous errors present (I recompiled on clean install). Neverball segfaults too btw. Will get some backtrace when I solve OpenMW.

@ptitSeb
Copy link
Owner

ptitSeb commented Sep 6, 2018

try using gold instead of ld, it may help you find the issue (or it may just work)

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 19, 2018

Ah, ooops, I have left some Pandora specific code in this one. I'll check later.

Prototype still doesn't start? Odd. Any interesting things in the log?

@HelloOO7
Copy link
Author

Nope, nothing new.

Here's TreadMarks btw, backtrace included.
treadmarks.log

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 20, 2018

Ok, there was an issue with LIBGL_FB=3 (among other things).

It should be fixed now with comit db24e29

@HelloOO7
Copy link
Author

Treadmarks now launches!
There's some big mess going on. Everything TM related is shaking left and right, up and down (literally). It doesn't run that bad but attempting to do anything in the menu crashed my X server.
Here's the log.
treadmarks2.fb3.log

I tested FB1 and there's a shader compilation error and a segfault. Unfortunately, I wasn't able to get a backtrace of that one, as running in gdb keeps TM running after the segfault, which, as FB1 is fullscreen, completely locks me out of my Pi (although something tells me I could work around it with SSH). Anyway, here's the output produced without BT:
treadmarks2.fb1.log

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 20, 2018

I'm not sure of what is happening here. It seems the window dimensions changed and trigger the need to resize the underlying EGL Surface...

I think commit c5b9be0 may fix the issue with LIBGL_FB=3.
For LIBGL_FB=1, it's another story.

@HelloOO7
Copy link
Author

Nothing has changed, unfortunately. It's also worth noting that the shakes of the window and the game/intro are independent. The window title and buttons are constantly moving left-right, the taskbar icon up-down and the game in random directions.

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 20, 2018

Ï don't understand. Do you mean the game window is moving across the screen by itself?

Also, are you using X11 or Wayland?

@HelloOO7
Copy link
Author

Yep. The window itself stays in a place but the right border is constantly moving left and right, causing the control buttons and window title to shake.

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 20, 2018

That's super odd! I don't change Window geometry in gl4es.
Are you using plain X11 or some XWayland stuff?

@HelloOO7
Copy link
Author

I'm using plain LXDE if I am not mistaken. Installed with apt install lxde xinit .

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 20, 2018

So, it's either my XGetGeometry that goes wrong (but why), or the XPutImage that overwrite some X11 memory?
Can you run with valgrind to it (I don't remember if it runs on your side)?

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 20, 2018

To check if the repeated XgetGeometry disturb it, in src/glx/glx.c go line 2464 and change

        XGetGeometry(dpy, drawable, &root, &x, &y, &width, &height, &border, &depth);
        if(width!=Width || height!=Height /*|| depth!=Depth*/) {

with

        //XGetGeometry(dpy, drawable, &root, &x, &y, &width, &height, &border, &depth);
        if(0/*width!=Width || height!=Height || depth!=Depth*/) {

@HelloOO7
Copy link
Author

The shakes now happen only for a short period of time, then they stop. The problem is that now there's no picture. There is just the window frame, quiet and transparent. By the way, I got it to launch nicely in command line with (insert gl4es env vars here) xinit ./TM. I wasn't able to get in-game as is has "lost connection to the X server" just when the map loaded.

@ptitSeb
Copy link
Owner

ptitSeb commented Oct 21, 2018

It would be good to have DEBUG info on glx.c, to see the size of the PBuffer it creates, and try to understand what is happening.

@HelloOO7
Copy link
Author

So here's the log with the DEBUG define uncommented in glx.c:
treadmarks.debug.log

It's not complete as most of the lines before was just -> 0xsomething SPAM. The pbuffer swap lines appeared just when I terminated the program, although the window was shaking all the time.

Here's a run with valgrind:
treadmarks.valgrind.log

I also had to terminate that one. Again, incomplete but much longer than the first one.

@jdonald
Copy link
Contributor

jdonald commented Dec 24, 2018

I think I've caught up on the 107 comments, and this looks like the right place to post more Raspberry Pi gl4es crash logs.

Minecraft: Cannot get it to start. Whether LIBGL_FB=1 or 3, LWJGL throws an exception with "No unique GLX 1.3 config matches peer info": minecraft_config_mismatch.txt

For this run I turned on #define DEBUG as suggested above, in case that helps.

I saw above that @HelloOO7 may have gotten Minecraft to launch at some point, but then withdrew that statement as it might have actually been using the system libGL.so with swrast?

Yamagi Quake 2: Raspbian users are now using the OpenGL 1.3 build because the opengl_es branch is more than 6 years old. When I run with LIBGL_FB=3 it launches but crawls at about 2 fps (compared to ~40 fps with the Mesa VC4 driver) on this Pi 3B+. Here's a log with the stack trace on LIBGL_FB=1 or 2:
yquake2_fpe_failed.txt. I added LIBGL_LOGSHADERERROR as recommended for an FPE error, but perhaps the shader problem is a side-effect after something else fails early?

From what I've read, if LIBGL_FB=3 runs while 1 and 2 fail, that suggests the application requires GL inside a window. However, I've got vid_fullscreen "1" in the yq config file and it does render fullscreen with the Mesa driver. Suggestions?

@ptitSeb
Copy link
Owner

ptitSeb commented Dec 24, 2018

For Minecraft, I think it's something in my glx stuffs in gl4es. I need to investigate and see what lwjgl expect (I haven't tested minecraft latelly, I may have broken it).

For yquake2, I assume no eglContext has been created, and so shader doesn't compile because of that. Is there some error at the launch of the game, with some GLX error when creating the context?

@ptitSeb
Copy link
Owner

ptitSeb commented Dec 24, 2018

@jdonald : can you try again minecraft with lastet commit 5b01037 hopefully it solved the lwjgl issue.

@jdonald
Copy link
Contributor

jdonald commented Dec 24, 2018

The Minecraft error looks about the same with 5b01037 + DEBUG logging, attached: minecraft_5b01037.txt I notice the GLXFBConfigID in there says not 0 or 1, but 4.

yquake2 appears to successfully create the context in both the LIBGL_FB=1 and 3 cases, and even creates a surface. I replaced all 8- or 7-git hex numbers with 0xXXXXXXXX and ran a diff:
yquake2_fb1_fb3.diff.txt. You can see differences like "framebuffer output" vs pbuffer, "glXMakeCurrent FBO workaround enabled" in the failing case. I'm not sure what else to look for. The glDestroyContext line reports fbcontext_count=1 in the failing case vs 0 when it launches. Original logs: yquake2_fb1_orig.txt yquake2_fb3_orig.txt

@ptitSeb
Copy link
Owner

ptitSeb commented Dec 24, 2018

The minecraft issue should be fixed (for good) with 87f9dc6
It should go further now...

For yquake2, I'm unsure. that it works for LIBGL_FB=3 means there isn't anything wrong with FPE and all, but that the context created is somehow not compatible with GLES Shaders. Can you have the Link error message or that message is not readable?

@jdonald
Copy link
Contributor

jdonald commented Dec 24, 2018

Awesome to see Minecraft running now. I'm using OptiFine with dozens of fancy effects disabled, and with the default window size performance is quite satisfactory. It's about 50 fps on scenes where the Mesa VC4 driver achieves 60 fps. The case where gl4es really shines is 1080p full screen, where Mesa's performance drops by half while gl4es retains about the same framerate. I recall minecraft-pi also has such a pronounced effect comparing full screen brcmEGL to Mesa EGL.

One difference that largely affects playability is losing the 2D desktop mouse cursor, necessary for navigating the player's inventory. Any suggestions to deal with this? I have the same issue with Minetest and imagine many desktop GL programs have some point-and-click element. So far the one hack I have is to restore some window transparency and set the desktop background to a solid color, but this is a hack which leaves everything tinted.

yquake2: Sorry I forgot to run the last batch with LIBGL_LOGSHADERERROR. I'm not sure why the error code didn't show in the earlier yquake2_fpe_failed.txt, but after printing the vertex and fragment shaders it now says:

Error is:
glGetError 0x502

@ptitSeb
Copy link
Owner

ptitSeb commented Dec 25, 2018

Glad to see Minecraft running. And faster and Mesa/CV4 in FullHD? Nice!

About the mouse cursor, I don't know well RPi architecture, but DispmanX has a Z info for each layer, I guess if the mouse cursor could be, somehow, drawn alone on a dispmanX layer, with transparency, on top of all other layer, it would solve that issue. No idea if mouse cursor is drawn alone or just handled by X11 in the same layer has X11 windows.

For yquake2, it still doesn't make sense. The context doesn't seems valid, so I assume the deletion / recreation of the context I see in the log is not working correctly. I need to analyse that.

@jdonald
Copy link
Contributor

jdonald commented Dec 26, 2018

Good idea. I see Qt implements its cursor as a DispmanX overlay in its Pi-specific code. The first option I considered was modifying the Java code to use org.lwjgl.input.Cursor. Hypothetically if Minecraft 1.13+ can eventually run on a Pi, with LWJGL3 + GLFW this would likely be easiest by LD_PRELOAD to intercept glfwEnable/Disable(GLFW_MOUSE_CURSOR). Neither of these two would generalize to other games (like Minetest) so the DispmanX overlay remains the best in theory.

As I was setting up more debug logs, yquake2 started working on one of my Pi devices. I investigated further, and it turns out I just needed to run sudo raspi-config to give the GPU 128 MB or more for the yquake2 crashes to cease. At this point Minetest also no longer crashed beyond its initial selection dialog.

yquake2 in LIBGL_FB=1 plays a bit choppy, often down to 15 fps for normal scenes. There's a lot of variation e.g. it goes up to 60 fps when facing a corner wall. Overall might still be of use to Retropie users who practically cannot practically use the open-source driver.

Minetest gets past its launch dialog, slow as expected (<5 fps) because it's also slow with the Mesa GL driver. If I set use_shaders = false in the config the world colors looks okay but when shaders are turned on (the default) everything comes out red.

@ptitSeb
Copy link
Owner

ptitSeb commented Dec 26, 2018

Ah, so a simple GPU Memory issue! Interresting. For yquake2, try uisng "LIBGL_BATCH=5" or 10, because this engine send fragmented draw commend, BATCH could help.

Minetest, I haven't tested lately. there is an issue with shader? But there isn't any shader compile error?

@jdonald
Copy link
Contributor

jdonald commented Dec 26, 2018

yquake2: Ahh yes I remember seeing LIBGL_BATCH in the first 107 comments but needed to be reminded. Using LIBGL_BATCH=5 makes everything much more responsive, often achieving 60 fps in combat. From there, I see no difference in framerate going from 5 vs 10.

Batching also makes a big difference for extremetuxracer: somewhat playable at low resolutions (requires LIBGL_FB=3).

Minetest: with use_shaders = true, it shows no shader errors in the output even with LIBGL_LOGSHADERERROR=1. The terrain just appears very red and the player's weapon in hand comes with a black billboard.

@ptitSeb
Copy link
Owner

ptitSeb commented Dec 27, 2018

It's true that this issue is bit long now.

I guess this one can now closed, as the original Segfault is solved, and the residual issue was about GPU Memory, that needed to be boosted a bit.

I propose we close this issue (@jdonald @HelloOO7 are you ok?) and you can open a new one for the Minetest shaders.

@HelloOO7
Copy link
Author

Fine by me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants