Bug 1177

Summary: libnewt.so: undefined symbol: bcm_host_init" when Screen is initialized before OpenGL, commonly seen on Raspberry Pi using Processing 3
Product: [JogAmp] Newt Reporter: Xerxes Rånby <xerxes>
Component: embeddedAssignee: Sven Gothel <sgothel>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: ---    
Version: 2.3.2   
Hardware: embedded_arm   
OS: all   
Type: --- SCM Refs:
5667e4320443289a1c0bd02f54bf466bfc2c5895
Workaround: ---
Attachments: commit-5667e43-Fix1177.patch

Description Xerxes Rånby 2015-07-17 14:47:11 CEST
Processing 3 codebase initializes the NEWT Screen before OpenGL
https://github.com/processing/processing/blob/master/core/src/processing/opengl/PSurfaceJOGL.java#L100-L123

On Raspberry Pi NEWT initialization of
display = NewtFactory.createDisplay(null);
fail with the error
"symbol lookup error: ../path/to/processing_sketch/libnewt.so: undefined symbol: bcm_host_init"
Comment 1 Xerxes Rånby 2015-07-17 14:51:51 CEST
Created attachment 707 [details]
commit-5667e43-Fix1177.patch

Fixes the issue by adding a
GLProfile.initSingleton() to bcm/vc/iv/DisplayDriver static initialization
this will preload libEGL and indirect load libbcm_host.so that contain the missing symbol.

ldd /opt/vc/lib/libEGL.so
libbcm_host.so => /opt/vc/lib/libbcm_host.so (0x76eb4000)

as discussed on IRC:
http://jogamp.org/log/irc/jogamp_20150716145123.html#l542
Comment 2 Xerxes Rånby 2015-07-17 22:40:55 CEST
commit 5667e4320443289a1c0bd02f54bf466bfc2c5895

    bcm/vc/iv/DisplayDriver depend on libEGL, pre-load it using GLProfile

    Fixes libnewt.so: undefined symbol: bcm_host_init"
    when the NEWT Screen is initialized before OpenGL ES.