ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
696 stars 159 forks source link

Segfault on RPi 3 #66

Closed HelloOO7 closed 5 years ago

HelloOO7 commented 6 years ago

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 commented 6 years ago

Can you copy-paste the whole gl4es output here?

Do you know how to make a gdb backtrace also?

HelloOO7 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

Ok, I think the wrong libs are loaded.

Can you try with latest commit cab03d4b53245932fb18454e68f4daafc92511b0 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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

     .***.     Wednesday,  1 August 2018,  1:20:21 pm UTC
     *****     Linux 4.14.52-v7+ armv7l GNU/Linux
     `***'     
      |*|      Filesystem      Size  Used Avail Use% Mounted on
      |*|      /dev/root       7.0G  6.0G  727M  90% /
    ..|*|..    Uptime.............: 0 days, 00h03m29s
  .*** * ***.  Memory.............: 673416kB (Free) / 949452kB (Total)
  *******@@**  Running Processes..: 123
  `*****@@**'  IP Address.........: 192.168.1.101
   `*******'   Temperature........: CPU: 53°C/127°F GPU: 52°C/125°F
     `"""'     The RetroPie Project, https://retropie.org.uk

pi@retropie:~ $ exitscreen openmw.loglsrm openmw.log lsexitLIBGL_ES=2 LIBGL_FB=3 LD_LIBRARY_PATH=/home/pi/code/gl4es/lib/ sudo openmwopenmwsudo openmwopenmw
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
[swscaler @ 0x6bb714b0] No accelerated colorspace conversion found from yuv420p to rgba.
[binkaudio_rdft @ 0x1b5edc0] Multiple frames in a packet.
Bus error
pi@retropie:~ $ fexit
exit

Script done on Wed 01 Aug 2018 13:20:52 UTC
ptitSeb commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

HelloOO7 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 https://github.com/ptitSeb/gl4es/issues/66#issuecomment-410470008 If you have "perf", running a sudo perf top in another terminal can, maybe, show what is slowing everything down.

HelloOO7 commented 6 years ago

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 commented 6 years ago

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

HelloOO7 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

HelloOO7 commented 6 years ago

So... I quick and dirtily replaced ld with gold (mv ld ld0; mv gold ld), should that work? Anyway, there's no additional output. And these issues only happen after I compile ffmpeg from source, before, when I used the prebuilt one, it compiled fine (but thrown the bus error etc.)... or at least it worked before I've compiled ffmpeg. There's also the possibility that in the meantime, OSG or OpenMW pushed some RPi-breaking commit. But that's unlikely.

ptitSeb commented 6 years ago

You can use that CFLAGS flags also: -fuse-ld=gold -fuse-linker-plugin for a cleaner way. Strange that linking with ffmpeg break so much things.

HelloOO7 commented 6 years ago

Now that's a mystery. I tried both gold and ld and even rand with -d to show maximum output but there's still nothing more than "ld returned with 1 exit status" with no further description. I'll try running with -i if it shows anything more but I'm not giving it much chances.

HelloOO7 commented 6 years ago

Well -i does nothing more.

This is my link.txt.

link.txt

I was paranoid enough to link lz everywhere I could but that only removed the previous error.

/usr/bin/ld: /usr/local/lib/libosgDB.so: undefined reference to symbol 'inflate$ //lib/arm-linux-gnueabihf/libz.so.1: error adding symbols: DSO missing from com$ collect2: error: ld returned 1 exit status

Now I just get the last line of it and the usual make stuff that comes after that. Can't believe how actually anything can mess make up like that.

ptitSeb commented 6 years ago

Strange. Try add -Wl,--verbose to have a more verbose output from ld/gold.

HelloOO7 commented 6 years ago

By the way do I have to recompile everything when I change the flags? F. e. rn my CFLAGS are -fuse-ld=gold -fuse-linker-plugin --verbose . Is it alright if I just run make with these flags?

Edit: Used these and there's no new output. Same goes for VERBOSE=1.

ptitSeb commented 6 years ago

You don't want --verbose as it will verbose gcc stuff, but -Wl,--verbose to verbose ld stuff.

If you change CFLAGS via ccmake or vias the flags.txt, it's fine, it will rebuild what is needed. But if you just change your env. variable, it will not change anything...

HelloOO7 commented 6 years ago

So I got it to build! Here's the log: openmw.log Tried neverball, but the RPi has some bad EGL in X11 and it just can't get the display, even with kika123's x11eglrpi.

ptitSeb commented 6 years ago

on that openmw log, there is not much to see. GL4ES seems quite happy and found some hardware, so no real clue to where the segfalt might come. You should use gdb to get a backtrace on the segfault.

About neverball, using LIBGL_FB=1 or LIBGL_FB=3 doesn't help?

HelloOO7 commented 6 years ago

Yeah, so openmw says: libswscale/arm/yuv2rgb_neon.S no such file or directory! What's interesting is that I found only one reference to this error, and guess where? In the thread for your port of Telegram to the Pandora So let's hope it's fixable the same way on the Pi. What did you do to FFmpeg to disable neon?

Anyway, here's the backtrace, if you still want it:

#0 0x01291000 in ff_yuv420p_to_rgba_neon () at libswscale/arm/yuv2rgbneon.S:279
#1 0x00000000 in ?? ()

On the topic of neverball and EGL, it's the same with FB1 as with 3 (which I am using for everything rn, because 0 never worked, but you probably already know that). What I noticed is, that gl4es uses libbrcmEGL.so instead of libEGL.so, which would be fine on anything but the RPi, as EGL in X11 is broken here and X11EGLRPi only patches the regular EGL library. Can I tell the program to use regular EGL when on X11 or should I backup brcmEGL and make a symlink to the regular one instead?

ptitSeb commented 6 years ago

Ah, that neon issue on ffmpeg. Mmmm, I'm not home yet, but I'll look at my build to how I have done. I remember I had first completly disabled NEON code, but ten found a way to re-activate NEON code and have it working. My error was a Bus Error IIRC, and I fixed by removing some align(XX) stuff, has it partly work for me (the align works on strutures you create using "new", but not for variable created on the stack, but the compiler still consider there are aligned and still issue optimized asm instruction that create BUS ERROR)...

About the EGL lib used, yeah, it tries first to find RPi EGL/GLES library, unless you force other libs. So if you want to use libEGL.so, just use LIBGL_EGL=libEGL.so. Same for the GLES library with LIBGL_GLES

HelloOO7 commented 6 years ago

Woah that's some next level C stuff. You still got it somewhere? 'Cause I'm not sure I can really start hacking FFmpeg without even knowing its structure, not to mention I've never done C before.

Anyway, let's just forget Neverball. The default EGL segfaults and I think we already talked about this one, then you replaced it with the BRCM one, which works (outside X).

I tried prototype instead. Built the odroid version, with changed cpu, fpu and remove -DODROID. It starts and initializes the engine, then segfaults. Log: prototype.log

ptitSeb commented 6 years ago

So here is my diff. I have spit it in 2 part.

First part add an new env. variable FFMPEG_NO_NEON to disable use of Neon. Just FFMPEG_NO_NEON=1 and it will not use neon (notes that FFMPEG_NO_NEON=0 also disable neon...).

diff --git a/libswscale/arm/swscale.c b/libswscale/arm/swscale.c
index 1ec360fe24..bc7146c948 100644
--- a/libswscale/arm/swscale.c
+++ b/libswscale/arm/swscale.c
@@ -33,7 +33,7 @@ av_cold void ff_sws_init_swscale_arm(SwsContext *c)
 {
     int cpu_flags = av_get_cpu_flags();

-    if (have_neon(cpu_flags)) {
+    if (have_neon(cpu_flags) && (getenv("FFMPEG_NO_NEON")==NULL)) {
         if (c->srcBpc == 8 && c->dstBpc <= 14) {
             c->hyScale = c->hcScale = ff_hscale_8_to_15_neon;
         }
diff --git a/libswscale/arm/swscale_unscaled.c b/libswscale/arm/swscale_unscaled.c
index e1597ab42d..6e50f21d40 100644
--- a/libswscale/arm/swscale_unscaled.c
+++ b/libswscale/arm/swscale_unscaled.c
@@ -175,6 +175,6 @@ static void get_unscaled_swscale_neon(SwsContext *c) {
 void ff_get_unscaled_swscale_arm(SwsContext *c)
 {
     int cpu_flags = av_get_cpu_flags();
-    if (have_neon(cpu_flags))
+    if (have_neon(cpu_flags) && (getenv("FFMPEG_NO_NEON")==NULL))
         get_unscaled_swscale_neon(c);
 }

That 2nd diff remove an optimisation in the assembly code, to avoid forcing the use of super-aligned fetch. It effectively fixed the use of Neon of my side. So prefer this patch, and use the 1st if this one doesn't work.

diff --git a/libswscale/arm/yuv2rgb_neon.S b/libswscale/arm/yuv2rgb_neon.S
index 10950e70b4..474465427d 100644
--- a/libswscale/arm/yuv2rgb_neon.S
+++ b/libswscale/arm/yuv2rgb_neon.S
@@ -75,8 +75,8 @@
     vzip.8              d7, d11                                        @ d7 = G1G2G3G4G5G6G7G8 d11 = G9G10G11G12G13G14G15G16
     vzip.8              d8, d12                                        @ d8 = B1B2B3B4B5B6B7B8 d12 = B9B10B11B12B13B14B15B16
     vzip.8              d9, d13                                        @ d9 = A1A2A3A4A5A6A7A8 d13 = A9A10A11A12A13A14A15A16
-    vst4.8              {q3, q4}, [\dst,:128]!
-    vst4.8              {q5, q6}, [\dst,:128]!
+    vst4.8              {q3, q4}, [\dst]!
+    vst4.8              {q5, q6}, [\dst]!
 .endm

 .macro process_1l_internal dst src ofmt
ptitSeb commented 6 years ago

Now, about that prototype log. I'm surprise to see a crash there...

Can you uncomment that line https://github.com/ptitSeb/gl4es/blob/master/src/gl/uniform.c#L6 and also add printf("m = %p\n"); just before line 226? That should hopefully gives a few more indication to what's is going on.

HelloOO7 commented 6 years ago

Welp, nice, I'll get to it tomorrow! Quick question, can I just run the diff, then pass the env var to openmw? Or is it that I'll have to recompile FFmpeg with the var active, then run the diff? Thanks, and good night (CEST).

ptitSeb commented 6 years ago

Well, try with just the 2nd diff first. If it still crashes at the same place, apply the 1st diff and then yes, just pass it to openmw to disable the use of neon.

HelloOO7 commented 6 years ago

Back with more info! Prototype is a really weird issue. Usually, it segfaults at launch. At times, it shows loading, then black screen, then segfaults. My last attempt resulted in a star-wars like text saying "something something prototype mark I something", then black screen, then a segfault. Here's the output from my last try:

GoUniformiv(0x307190[3], -1, 1, 1, 0x7efd6abc) =>(1...)
GoUniformiv(0x307190[3], -1, 1, 1, 0x7efd6abc) =>(2...)
GoUniformiv(0x307190[3], -1, 1, 1, 0x7efd6abc) =>(3...)
glGetError 0x505
GoUniformiv(0x70d408[9], 0, 1, 1, 0xd2db0) =>(0...)
m = 0x1

Thread 1 "prototype" received signal SIGSEGV, Segmentation fault.
GoUniformiv (glprogram=glprogram@entry=0x70d408, location=<optimized out>, 
    size=size@entry=1, count=7394312, count@entry=1, value=0xd2db0)
    at /home/pi/code/gl4es/src/gl/uniform.c:227
227     if(size != n_uniform(m->type) || !is_uniform_int(m->type)  || count>m->size) {
(gdb) backtrace
#0  GoUniformiv (glprogram=glprogram@entry=0x70d408, location=<optimized out>, 
    size=size@entry=1, count=7394312, count@entry=1, value=0xd2db0)
    at /home/pi/code/gl4es/src/gl/uniform.c:227
#1  0x76f67cc0 in GoUniformiv (glprogram=glprogram@entry=0x70d408, 
    location=<optimized out>, size=size@entry=1, count=count@entry=1, 
    value=0xd2db0) at /home/pi/code/gl4es/src/gl/uniform.c:254
#2  0x76ef26ec in realize_glenv (ispoint=ispoint@entry=0)
    at /home/pi/code/gl4es/src/gl/fpe.c:953
#3  0x76ef3b64 in fpe_glDrawArrays (mode=6, first=0, count=4)
    at /home/pi/code/gl4es/src/gl/fpe.c:515
#4  0x76f1b1cc in draw_renderlist (list=<optimized out>, list@entry=0x70c7a0)
    at /home/pi/code/gl4es/src/gl/listdraw.c:555
#5  0x76f0bb84 in flush () at /home/pi/code/gl4es/src/gl/gl.c:888
#6  0x76f4fdd0 in gl4es_glTexEnvf (param=8448, pname=8704, target=8960)
    at /home/pi/code/gl4es/src/gl/texenv.c:65
#7  gl4es_glTexEnvi (target=8960, pname=8704, param=<optimized out>)
    at /home/pi/code/gl4es/src/gl/texenv.c:610
#8  0x00051160 in PowerDroid::Draw (this=0x6e3210, interp=0.800181746)
    at PowerDroid.cpp:194
#9  0x00029724 in Engine::RenderEntities (interp=0.800181746, this=0x7efd91f8)
    at Game.cpp:365
#10 Engine::RenderGame (this=0x7efd91f8, interp=0.800181746) at Game.cpp:264
#11 0x0005bef4 in Engine::Pump (this=this@entry=0x7efd91f8) at Engine.cpp:332
---Type <return> to continue, or q <return> to quit---
#12 0x0005d2c4 in Engine::Engine (this=0x7efd91f8, width=2130554636, 
    height=2130554624, fscreen=<optimized out>, winName=0x6eeb0 "PROTOTYPE")
    at Engine.cpp:176
#13 0x00013e5c in main (argc=<optimized out>, argv=<optimized out>)
    at ProtoType.cpp:12

About OpenMW, what I've done was: Cloned FFmpeg from git Ran the 2nd patch with git apply -v (no errors) Compiled, make install'd Same bus error as before.

Same with the 1st patch, ran it, recompiled, openw FF_N_N=1 bus error.

2.log - 1st patch mw3.log -2nd patch

Logs if you still want them.

ptitSeb commented 6 years ago

For the 2nd patch, maybe you need to do something similar around line 279 of that .S file.

For the 1st patch, you need to use the dev env first. The command line should be something like FFMPEG_NO_NEON=1 ./openmw, is that what you are using?

About the crash in prototype, there is something wrong going on. The frame #0 :


    size=size@entry=1, count=7394312, count@entry=1, value=0xd2db0)
    at /home/pi/code/gl4es/src/gl/uniform.c:227```
that count=7394312 is way to large.

Can you make a run with `valgrind`, to check if there are some memory overwrite.
HelloOO7 commented 6 years ago

Here's the last few lines of the valgrind log for prototype:

glGetError 0x500
==1270== Conditional jump or move depends on uninitialised value(s)
==1270==    at 0x49014C8: glGetProgramiv (program.c:360)
==1270==    by 0x48B7C6B: fpe_program (fpe.c:280)
==1270==    by 0x48BA10F: realize_glenv (fpe.c:669)
==1270==    by 0x48BBC53: fpe_glDrawElements (fpe.c:522)
==1270==    by 0x48E2CCB: draw_renderlist (listdraw.c:527)
==1270==    by 0x48D3B83: flush (gl.c:888)
==1270==    by 0x48B0B9B: proxy_glEnable (enable.c:104)
==1270==    by 0x1B263: Engine::RenderIntro(float) (FrontEnd.cpp:741)
==1270==    by 0x5BEF3: Engine::Pump() (Engine.cpp:332)
==1270==    by 0x5D2C3: Engine::Engine(int, int, bool, char*) (Engine.cpp:176)
==1270==    by 0x13E5B: main (ProtoType.cpp:12)
==1270== 
GoUniformiv(0x9042db0[6], 0, 1, 1, 0x6817108) =>(0...)
==1270== Invalid read of size 4
==1270==    at 0x492BA6C: GoUniformiv.part.1 (uniform.c:225)
==1270==    by 0x48BA6EB: realize_glenv (fpe.c:953)
==1270==    by 0x48BBC53: fpe_glDrawElements (fpe.c:522)
==1270==    by 0x48E2CCB: draw_renderlist (listdraw.c:527)
==1270==    by 0x48D3B83: flush (gl.c:888)
==1270==    by 0x48B0B9B: proxy_glEnable (enable.c:104)
==1270==    by 0x1B263: Engine::RenderIntro(float) (FrontEnd.cpp:741)
==1270==    by 0x5BEF3: Engine::Pump() (Engine.cpp:332)
==1270==    by 0x5D2C3: Engine::Engine(int, int, bool, char*) (Engine.cpp:176)
==1270==    by 0x13E5B: main (ProtoType.cpp:12)
==1270==  Address 0x9043590 is 0 bytes after a block of size 16 alloc'd
==1270==    at 0x4847474: malloc (vg_replace_malloc.c:298)
==1270==    by 0x4849FE3: realloc (vg_replace_malloc.c:785)
==1270==    by 0x48FFD03: kh_resize_uniformlist (program.h:80)
==1270==    by 0x48FFD03: kh_put_uniformlist (program.h:80)
==1270==    by 0x48FFD03: glCreateProgram (program.c:122)
==1270==    by 0x48B7C07: fpe_program (fpe.c:276)
==1270==    by 0x48BA10F: realize_glenv (fpe.c:669)
==1270==    by 0x48BBC53: fpe_glDrawElements (fpe.c:522)
==1270==    by 0x48E2CCB: draw_renderlist (listdraw.c:527)
==1270==    by 0x48D3B83: flush (gl.c:888)
==1270==    by 0x48B0B9B: proxy_glEnable (enable.c:104)
==1270==    by 0x1B263: Engine::RenderIntro(float) (FrontEnd.cpp:741)
==1270==    by 0x5BEF3: Engine::Pump() (Engine.cpp:332)
==1270==    by 0x5D2C3: Engine::Engine(int, int, bool, char*) (Engine.cpp:176)
==1270== 
m = 0x1
==1270== Invalid read of size 4
==1270==    at 0x492BA7C: GoUniformiv.part.1 (uniform.c:227)
==1270==    by 0x48BA6EB: realize_glenv (fpe.c:953)
==1270==    by 0x48BBC53: fpe_glDrawElements (fpe.c:522)
==1270==    by 0x48E2CCB: draw_renderlist (listdraw.c:527)
==1270==    by 0x48D3B83: flush (gl.c:888)
==1270==    by 0x48B0B9B: proxy_glEnable (enable.c:104)
==1270==    by 0x1B263: Engine::RenderIntro(float) (FrontEnd.cpp:741)
==1270==    by 0x5BEF3: Engine::Pump() (Engine.cpp:332)
==1270==    by 0x5D2C3: Engine::Engine(int, int, bool, char*) (Engine.cpp:176)
==1270==    by 0x13E5B: main (ProtoType.cpp:12)
==1270==  Address 0xff5d5d65 is not stack'd, malloc'd or (recently) free'd
==1270== 
==1270== 
==1270== Process terminating with default action of signal 11 (SIGSEGV)
==1270==    at 0x4E64438: raise (raise.c:46)
==1270==    by 0x4E656AF: ??? (sigrestorer.S:64)
^C==1270== 
==1270== HEAP SUMMARY:
==1270==     in use at exit: 4,646,919 bytes in 4,091 blocks
==1270==   total heap usage: 22,429 allocs, 18,338 frees, 81,507,794 bytes allocated
==1270== 
==1270== LEAK SUMMARY:
==1270==    definitely lost: 24,651 bytes in 31 blocks
==1270==    indirectly lost: 1,360 bytes in 48 blocks
==1270==      possibly lost: 82,747 bytes in 2,135 blocks
==1270==    still reachable: 4,538,161 bytes in 1,877 blocks
==1270==         suppressed: 0 bytes in 0 blocks
==1270== Rerun with --leak-check=full to see details of leaked memory
==1270== 
==1270== For counts of detected and suppressed errors, rerun with: -v
==1270== Use --track-origins=yes to see where uninitialised values come from
==1270== ERROR SUMMARY: 14076 errors from 923 contexts (suppressed: 21 from 12)
Segmentation fault

For OpenMW, yeah, that's what I'm doing. Git apply, compile FFmpeg, make install, run openmw with the env variable. Or do I need to compile OSG and OpenMW again too?

ptitSeb commented 6 years ago

For OpenMW/OSG and ffpeg, it depends if you linked with the static or dynamic lib version. If it's the dynamic, you're safe. If it's the static, you need to re-link it (a "make" should detect the change and just relink).

Now, for the Prototype issue, I think there is something wrong with Shader Programs. Can you uncomment line 8 of src/gl/program.c so the link of the program split a few debug string? It seems there are no uniforms availbles, wich is wrong.

For the 1st valgrind error (the unitiliazed jump something), I'll try to commit something for that, but I'm unsure why you have this message either.