Bug 1177 - libnewt.so: undefined symbol: bcm_host_init" when Screen is initialized before OpenGL, commonly seen on Raspberry Pi using Processing 3
Summary: libnewt.so: undefined symbol: bcm_host_init" when Screen is initialized befor...
Status: RESOLVED FIXED
Alias: None
Product: Newt
Classification: JogAmp
Component: embedded (show other bugs)
Version: 2.3.2
Hardware: embedded_arm all
: --- enhancement
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2015-07-17 14:47 CEST by Xerxes Rånby
Modified: 2015-09-27 01:30 CEST (History)
0 users

See Also:
Type: ---
SCM Refs:
5667e4320443289a1c0bd02f54bf466bfc2c5895
Workaround: ---


Attachments
commit-5667e43-Fix1177.patch (1.25 KB, patch)
2015-07-17 14:51 CEST, Xerxes Rånby
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.