Re: X11 EGL on the Raspberry Pi
Mung: The code is now on the main Mesa tree 

Re: X11 EGL on the Raspberry Pi
Are there any docs on installing and replacing current mesa libs?
It seems to compile okay, but I am not sure the libs can be used as a drop in replacement?
It seems to compile okay, but I am not sure the libs can be used as a drop in replacement?
- hanzelpeter
- Posts: 75
- Joined: Mon Jul 09, 2012 11:56 am
Re: X11 EGL on the Raspberry Pi
I also check this. I think you need also kernel from https://github.com/anholt/linux/tree/vc4.
And mesa from git. But I didn't try to compile it.
Some one did? And what's the results?
And mesa from git. But I didn't try to compile it.
Some one did? And what's the results?
Re: X11 EGL on the Raspberry Pi
It requires KMS and kernel hooks?hanzelpeter wrote:I also check this. I think you need also kernel from https://github.com/anholt/linux/tree/vc4.
And mesa from git. But I didn't try to compile it.
Some one did? And what's the results?
What makes you think that kernel is required, have you any further information about requirements for running vc4 accel mesa on rpi, are there any documentations or links with information?.
I am newbie so know nothing about mesa compile and I get the feeling this is bleeding edge so I am probably not going to go any further unless I see docs.
I have probably just wasted another 5 hours of my life working out dependencies for compiling, I will maybe post a script so others save the time if they want to try from where I have got to. Should take 50Mb download from git of about 8 packages, 6 hours compile time on rpi model b+ clocked @1000mhz with extra swap on usb HD to get mesa libraries, I think the autogen.sh switches something like --with-gallium=vc4 --with-dri=swrast --disable-dri3 (that is probably incorrect but similar options?). I did not compile a kernel, where are relevant details for compile for vc4, I could not find any with google.
Will post simple script of commands to compile once I get back to the rpi if anyone shows interest.
Anyone have any ideas how long before this gets into raspbian?
- hanzelpeter
- Posts: 75
- Joined: Mon Jul 09, 2012 11:56 am
Re: X11 EGL on the Raspberry Pi
Just checking http://anholt.livejournal.com/
And also mesa mailing lists. And also other opengl stuff as intel, it needs KMS + buffer objects in kernel.
But I am not 100% sure.
And also mesa mailing lists. And also other opengl stuff as intel, it needs KMS + buffer objects in kernel.
But I am not 100% sure.
- hanzelpeter
- Posts: 75
- Joined: Mon Jul 09, 2012 11:56 am
Re: X11 EGL on the Raspberry Pi
e.g.
this:
http://cgit.freedesktop.org/mesa/mesa/t ... c3b0454df2
and from https://github.com/anholt/linux/commit/ ... 80f5742d16
this:
http://cgit.freedesktop.org/mesa/mesa/t ... c3b0454df2
Code: Select all
if (!(vc4_debug & VC4_DEBUG_NORAST)) {
int ret;
#ifndef USE_VC4_SIMULATOR
ret = drmIoctl(vc4->fd, DRM_IOCTL_VC4_SUBMIT_CL, &submit);
#else
ret = vc4_simulator_flush(vc4, &submit);
#endif
if (ret)
errx(1, "VC4 submit failed\n");
}
Code: Select all
static const struct drm_ioctl_desc vc4_drm_ioctls[] = {
+ DRM_IOCTL_DEF_DRV(VC4_SUBMIT_CL, vc4_submit_cl_ioctl, 0),
};
Re: X11 EGL on the Raspberry Pi
I think I will not bother trying to compile kernel as it will be waste of time until the patches get into mainline rpi foundation kernel (I want to make other patchsets on the kernel which maybe conflict)
If anyone else want to try kernel compile please try and post results here.
I have post below simple list of package I had to install to compile mesa, there maybe parts missing as I did not do this on a vanilla raspbian install, if you have any problems ask and I will try help(I am not an expert though).
I have made the script from copying commands in my bash history and added some shell loop for compiling, this may not work as it is untested, also copying of macros file maybe required first for autogen to complete. I have not tested this so you may need to read script and workout correct order of compile for dependencies that autogen throws.
If anyone else want to try kernel compile please try and post results here.
I have post below simple list of package I had to install to compile mesa, there maybe parts missing as I did not do this on a vanilla raspbian install, if you have any problems ask and I will try help(I am not an expert though).
I have made the script from copying commands in my bash history and added some shell loop for compiling, this may not work as it is untested, also copying of macros file maybe required first for autogen to complete. I have not tested this so you may need to read script and workout correct order of compile for dependencies that autogen throws.
Code: Select all
sudo apt-get install libtool automake libudev-dev x11proto-gl-dev bison flex
git clone http://anongit.freedesktop.org/git/mesa/mesa.git
git clone http://anongit.freedesktop.org/xorg/proto/dri2proto
git clone git://anongit.freedesktop.org/xcb/proto
git clone http://anongit.freedesktop.org/xorg/proto/dri3proto
git clone http://anongit.freedesktop.org/xorg/proto/presentproto
git clone git://anongit.freedesktop.org/xcb/libxcb
git clone git://git.freedesktop.org/git/xorg/lib/libxtrans
git clone git://git.freedesktop.org/git/xorg/proto/x11proto
git clone git://git.freedesktop.org/git/xorg/lib/libX11
git clone git://git.freedesktop.org/git/xorg/lib/libXext
git clone git://git.freedesktop.org/git/pixman
git clone git://git.freedesktop.org/git/xorg/proto/glproto
git clone git://anongit.freedesktop.org/xorg/util/macros
git clone git://anongit.freedesktop.org/xorg/lib/libxshmfence
for i in proto macros glproto presentproto x11proto dri2proto dri3proto libxtrans libxcb libXext libX11 libxshmfence pixman; do
cd "$i" ; ./autogen.sh ; sudo make install ; cd ..
done
sudo mv /usr/share/aclocal/xorg-macros.m4 /usr/share/aclocal/xorg-macros.m4.old
sudo cp macros/xorg-macros.m4 /usr/share/aclocal/xorg-macros.m4
cd mesa ; ./autogen.sh --with-gallium-drivers=vc4 --with-dri-drivers=swrast --disable-dri3; sudo make install
Re: X11 EGL on the Raspberry Pi
Forgive me for butting in to this thread.
I am looking to use the Rpi as a Marine Navigation computer. The only thing holding it back is lack of hardware accelerated graphics to make it useable.
I may have misunderstood (newbie) but would the driver that is being developed provide the Rpi with native HW Acceleration for OpenGL applications? In my case OpenCPN running under the standard Raspbian desktop.
Currently efforts to make HW Accelerated OpenCPN have been using glshim and glues libraries compiled for the Rpi. that do not work.
Any help or information appreciated.
Cheers
Spart
I am looking to use the Rpi as a Marine Navigation computer. The only thing holding it back is lack of hardware accelerated graphics to make it useable.
I may have misunderstood (newbie) but would the driver that is being developed provide the Rpi with native HW Acceleration for OpenGL applications? In my case OpenCPN running under the standard Raspbian desktop.
Currently efforts to make HW Accelerated OpenCPN have been using glshim and glues libraries compiled for the Rpi. that do not work.
Any help or information appreciated.
Cheers
Spart
Re: X11 EGL on the Raspberry Pi
Yes. Native OpenGL accelleration
- hanzelpeter
- Posts: 75
- Joined: Mon Jul 09, 2012 11:56 am
Re: X11 EGL on the Raspberry Pi
Hello,
I'm not very active around here, but this looks like a good place to ask my question.
I'm trying to get Juce cross-platform development framework to run on my Raspian Pi.
Before making I'm using the following g++
Here's what a few lines of the make log looks like (compiler / linker settings, having re-compiled Main & re-linked with verbose on)
{Anyone spot any obvious mistakes / ommissions / problems in that lot?}
So far almost all of the Demo code runs beautifully (have to disable JUCE_USE_XSHM and define JUCE_USE_XINERAMA=0 JUCE_UNIT_TESTS=0 ) - I'm compiling with the following extra compiler flags:
and linking with the following extra linker flags:
and link with external library
And almost all the demos work out of the box. The ones that don't are the OpenGL demos (teapot and 2D OpenGL)
I believe others on the Juce forum have said that they have had the demos work on other Linux environments... I'd like them all to work on The Pi!
When I try to run any of the OpenGL demos under gdb (which I'm *very* new to!) I get the following SIGSEGV
Am I missing libraries / using the right compiler / linker flags?
I was hoping to find a *very* simple X11 window with simple OpenGL content A "HelloWorld"- type app that I could prove works on my set-up - but so far haven't found anything.
I can supply more info - Or (to check it for yourself, I can provide a Juce Introjucerproject file so you can see exactly what I'm getting )
Any and all suggestions / advice appreciated .
I'm not very active around here, but this looks like a good place to ask my question.
I'm trying to get Juce cross-platform development framework to run on my Raspian Pi.
Before making I'm using the following g++
Code: Select all
export CONFIG="Debug";export TARGET_ARCH="-march=armv6 -mfpu=vfp -mfloat-abi=hard"
Code: Select all
Compiling Main.cpp
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14+rpi1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
COLLECT_GCC_OPTIONS='-D' 'LINUX=1' '-D' 'DEBUG=1' '-D' '_DEBUG=1' '-D' 'JUCE_USE_XINERAMA=0' '-D' 'JUCE_UNIT_TESTS=0' '-D' 'JUCER_LINUX_MAKE_7346DA2A=1' '-D' 'JUCE_APP_VERSION=3.0.0' '-D' 'JUCE_APP_VERSION_HEX=0x30000' '-I' '/usr/include' '-I' '/usr/include/freetype2' '-I' '../../JuceLibraryCode' '-I' '../../../../modules' '-march=armv6' '-mfpu=vfp' '-mfloat-abi=hard' '-g' '-ggdb' '-O0' '-I' '/opt/vc/include' '-I' '/opt/vc/include/interface/vcos/pthreads' '-I' '/opt/vc/include/interface/vmcs_host/linux' '-v' '-o' 'build/intermediate/Debug/Main_90ebc5c2.o' '-c' '-shared-libgcc'
/usr/lib/gcc/arm-linux-gnueabihf/4.6/cc1plus -quiet -v -I /usr/include -I /usr/include/freetype2 -I ../../JuceLibraryCode -I ../../../../modules -I /opt/vc/include -I /opt/vc/include/interface/vcos/pthreads -I /opt/vc/include/interface/vmcs_host/linux -imultilib . -imultiarch arm-linux-gnueabihf -D_GNU_SOURCE -D LINUX=1 -D DEBUG=1 -D _DEBUG=1 -D JUCE_USE_XINERAMA=0 -D JUCE_UNIT_TESTS=0 -D JUCER_LINUX_MAKE_7346DA2A=1 -D JUCE_APP_VERSION=3.0.0 -D JUCE_APP_VERSION_HEX=0x30000 ../../Source/Main.cpp -quiet -dumpbase Main.cpp -march=armv6 -mfpu=vfp -mfloat-abi=hard -auxbase-strip build/intermediate/Debug/Main_90ebc5c2.o -g -ggdb -O0 -version -o /tmp/ccguh1bI.s
GNU C++ (Debian 4.6.3-14+rpi1) version 4.6.3 (arm-linux-gnueabihf)
compiled by GNU C version 4.6.3, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=46 --param ggc-min-heapsize=31640
ignoring nonexistent directory "/usr/local/include/arm-linux-gnueabihf"
ignoring nonexistent directory "/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/include"
ignoring duplicate directory "/usr/include"
as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
/usr/include/freetype2
../../JuceLibraryCode
../../../../modules
/opt/vc/include
/opt/vc/include/interface/vcos/pthreads
/opt/vc/include/interface/vmcs_host/linux
/usr/include/c++/4.6
/usr/include/c++/4.6/arm-linux-gnueabihf/.
/usr/include/c++/4.6/backward
/usr/lib/gcc/arm-linux-gnueabihf/4.6/include
/usr/local/include
/usr/lib/gcc/arm-linux-gnueabihf/4.6/include-fixed
/usr/include/arm-linux-gnueabihf
/usr/include
End of search list.
GNU C++ (Debian 4.6.3-14+rpi1) version 4.6.3 (arm-linux-gnueabihf)
compiled by GNU C version 4.6.3, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=46 --param ggc-min-heapsize=31640
Compiler executable checksum: 64a5da90acce21afabe8e916f286e44e
In file included from ../../Source/../JuceLibraryCode/modules/juce_opengl/juce_opengl.h:4:0,
from ../../Source/../JuceLibraryCode/JuceHeader.h:30,
from ../../Source/JuceDemoHeader.h:29,
from ../../Source/Main.cpp:26:
../../Source/../JuceLibraryCode/modules/juce_opengl/../../../../../modules/juce_opengl/juce_opengl.h:121:92: note: #pragma message: "============================================================================="
../../Source/../JuceLibraryCode/modules/juce_opengl/../../../../../modules/juce_opengl/juce_opengl.h:123:46: note: #pragma message: "JUCE_GLSL_VERSION=" "\"\""
../../Source/../JuceLibraryCode/modules/juce_opengl/../../../../../modules/juce_opengl/juce_opengl.h:124:49: note: #pragma message: "JUCE_OPENGL_ES=" "JUCE_OPENGL_ES"
../../Source/../JuceLibraryCode/modules/juce_opengl/../../../../../modules/juce_opengl/juce_opengl.h:125:45: note: #pragma message: "JUCE_OPENGL3=" "JUCE_OPENGL3"
../../Source/../JuceLibraryCode/modules/juce_opengl/../../../../../modules/juce_opengl/juce_opengl.h:126:46: note: #pragma message: "JUCE_GLSL_VERSION=" "\"\""
../../Source/../JuceLibraryCode/modules/juce_opengl/../../../../../modules/juce_opengl/juce_opengl.h:128:92: note: #pragma message: "============================================================================="
COLLECT_GCC_OPTIONS='-D' 'LINUX=1' '-D' 'DEBUG=1' '-D' '_DEBUG=1' '-D' 'JUCE_USE_XINERAMA=0' '-D' 'JUCE_UNIT_TESTS=0' '-D' 'JUCER_LINUX_MAKE_7346DA2A=1' '-D' 'JUCE_APP_VERSION=3.0.0' '-D' 'JUCE_APP_VERSION_HEX=0x30000' '-I' '/usr/include' '-I' '/usr/include/freetype2' '-I' '../../JuceLibraryCode' '-I' '../../../../modules' '-march=armv6' '-mfpu=vfp' '-mfloat-abi=hard' '-g' '-ggdb' '-O0' '-I' '/opt/vc/include' '-I' '/opt/vc/include/interface/vcos/pthreads' '-I' '/opt/vc/include/interface/vmcs_host/linux' '-v' '-o' 'build/intermediate/Debug/Main_90ebc5c2.o' '-c' '-shared-libgcc'
as -march=armv6 -mfloat-abi=hard -mfpu=vfp -meabi=5 -o build/intermediate/Debug/Main_90ebc5c2.o /tmp/ccguh1bI.s
COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/
LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/
COLLECT_GCC_OPTIONS='-D' 'LINUX=1' '-D' 'DEBUG=1' '-D' '_DEBUG=1' '-D' 'JUCE_USE_XINERAMA=0' '-D' 'JUCE_UNIT_TESTS=0' '-D' 'JUCER_LINUX_MAKE_7346DA2A=1' '-D' 'JUCE_APP_VERSION=3.0.0' '-D' 'JUCE_APP_VERSION_HEX=0x30000' '-I' '/usr/include' '-I' '/usr/include/freetype2' '-I' '../../JuceLibraryCode' '-I' '../../../../modules' '-march=armv6' '-mfpu=vfp' '-mfloat-abi=hard' '-g' '-ggdb' '-O0' '-I' '/opt/vc/include' '-I' '/opt/vc/include/interface/vcos/pthreads' '-I' '/opt/vc/include/interface/vmcs_host/linux' '-v' '-o' 'build/intermediate/Debug/Main_90ebc5c2.o' '-c' '-shared-libgcc'
Linking JuceDemo
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14+rpi1' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14+rpi1)
COMPILER_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/
LIBRARY_PATH=/usr/lib/gcc/arm-linux-gnueabihf/4.6/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' 'build/JuceDemo' '-march=armv6' '-mfpu=vfp' '-mfloat-abi=hard' '-Lbuild' '-Lbuild' '-L/usr/lib/' '-L/usr/X11R6/lib/' '-L/opt/vc/lib' '-v' '-march=armv6' '-mfpu=vfp' '-mfloat-abi=hard' '-shared-libgcc'
/usr/lib/gcc/arm-linux-gnueabihf/4.6/collect2 --sysroot=/ --build-id --no-add-needed --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X --hash-style=both -m armelf_linux_eabi -o build/JuceDemo /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crt1.o /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crti.o /usr/lib/gcc/arm-linux-gnueabihf/4.6/crtbegin.o -Lbuild -Lbuild -L/usr/lib/ -L/usr/X11R6/lib/ -L/opt/vc/lib -L/usr/lib/gcc/arm-linux-gnueabihf/4.6 -L/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf -L/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../.. -L/lib/arm-linux-gnueabihf -L/usr/lib/arm-linux-gnueabihf build/intermediate/Debug/Main_90ebc5c2.o build/intermediate/Debug/MainWindow_499ac812.o build/intermediate/Debug/IntroScreen_73347059.o build/intermediate/Debug/AnimationDemo_9fc7e4e9.o build/intermediate/Debug/AudioLatencyDemo_78d49233.o build/intermediate/Debug/AudioPlaybackDemo_ea12adf6.o build/intermediate/Debug/AudioRecordingDemo_435914e6.o build/intermediate/Debug/AudioSettingsDemo_6d710bfe.o build/intermediate/Debug/AudioSynthesiserDemo_1b3666f6.o build/intermediate/Debug/Box2DDemo_51053c42.o build/intermediate/Debug/CameraDemo_a10f7e50.o build/intermediate/Debug/ChildProcessDemo_2c2b949e.o build/intermediate/Debug/CodeEditorDemo_d5c17a65.o build/intermediate/Debug/ComponentTransformsDemo_377f7889.o build/intermediate/Debug/CryptographyDemo_232d46d7.o build/intermediate/Debug/DialogsDemo_19d585d0.o build/intermediate/Debug/FontsDemo_6da1e5e9.o build/intermediate/Debug/GraphicsDemo_85142ef6.o build/intermediate/Debug/ImagesDemo_ecf13aa3.o build/intermediate/Debug/JavaScript_d6e42eb5.o build/intermediate/Debug/KeyMappingsDemo_cf05c709.o build/intermediate/Debug/LiveConstantDemo_e3b18a9b.o build/intermediate/Debug/LookAndFeelDemo_25c558a3.o build/intermediate/Debug/MDIDemo_c476c2d7.o build/intermediate/Debug/MidiDemo_75ebc30c.o build/intermediate/Debug/MultithreadingDemo_ff566eaa.o build/intermediate/Debug/MultiTouch_595f3a2e.o build/intermediate/Debug/NetworkingDemo_fbd1b19f.o build/intermediate/Debug/OpenGLDemo_fdac55da.o build/intermediate/Debug/OpenGLDemo2D_48eeadec.o build/intermediate/Debug/PropertiesDemo_8ff1a8de.o build/intermediate/Debug/SystemInfoDemo_984acd28.o build/intermediate/Debug/TimersAndEventsDemo_f2656547.o build/intermediate/Debug/UnitTestsDemo_5c21762.o build/intermediate/Debug/ValueTreesDemo_9657d84f.o build/intermediate/Debug/VideoDemo_b55a1560.o build/intermediate/Debug/WebBrowserDemo_3df2dbdf.o build/intermediate/Debug/WidgetsDemo_fb0454.o build/intermediate/Debug/WindowsDemo_e8cfa428.o build/intermediate/Debug/XMLandJSONDemo_5bc88df3.o build/intermediate/Debug/BinaryData_ce4232d4.o build/intermediate/Debug/juce_audio_basics_399a455e.o build/intermediate/Debug/juce_audio_devices_c1c9ba9c.o build/intermediate/Debug/juce_audio_formats_f04b043c.o build/intermediate/Debug/juce_audio_processors_eb9ae116.o build/intermediate/Debug/juce_audio_utils_cf18005c.o build/intermediate/Debug/juce_box2d_7c8de7fc.o build/intermediate/Debug/juce_core_1ee54a40.o build/intermediate/Debug/juce_cryptography_3b1f489a.o build/intermediate/Debug/juce_data_structures_84790dfc.o build/intermediate/Debug/juce_events_584896b4.o build/intermediate/Debug/juce_graphics_f9afc18.o build/intermediate/Debug/juce_gui_basics_90929794.o build/intermediate/Debug/juce_gui_extra_b81d9e1c.o build/intermediate/Debug/juce_opengl_1890bee0.o build/intermediate/Debug/juce_video_86a19d3c.o -lGL -lX11 -lXext -lXinerama -lasound -ldl -lfreetype -lpthread -lrt -lbcm_host -lX11 -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/arm-linux-gnueabihf/4.6/crtend.o /usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../arm-linux-gnueabihf/crtn.o
So far almost all of the Demo code runs beautifully (have to disable JUCE_USE_XSHM and define JUCE_USE_XINERAMA=0 JUCE_UNIT_TESTS=0 ) - I'm compiling with the following extra compiler flags:
Code: Select all
-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -lX11 -lEGL -lGLESv2 -lm -v
Code: Select all
-L/opt/vc/lib -lX11 -lEGL -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lpthread -lrt -v
Code: Select all
bcm_host
I believe others on the Juce forum have said that they have had the demos work on other Linux environments... I'd like them all to work on The Pi!
When I try to run any of the OpenGL demos under gdb (which I'm *very* new to!) I get the following SIGSEGV
Code: Select all
root@RaspiSigfox:/home/pi# cd /home/pi/devel/juce/extras/Demo/Builds/Linux/build/
root@RaspiSigfox:/home/pi/devel/juce/extras/Demo/Builds/Linux/build# sudo gdb ./JuceDemo
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/pi/devel/juce/extras/Demo/Builds/Linux/build/JuceDemo...done.
(gdb) run
Starting program: /home/pi/devel/juce/extras/Demo/Builds/Linux/build/JuceDemo
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
JUCE v3.0.8
[New Thread 0xb689b450 (LWP 2768)]
JUCE Assertion failure in juce_Component.cpp:737
[New Thread 0xb5bff450 (LWP 2770)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb5bff450 (LWP 2770)]
0xb6f7d5ec in glXCreateContext () from /usr/lib/arm-linux-gnueabihf/libGL.so.1
(gdb) back
#0 0xb6f7d5ec in glXCreateContext ()
from /usr/lib/arm-linux-gnueabihf/libGL.so.1
#1 0x0051c2cc in juce::OpenGLContext::NativeContext::initialiseOnRenderThread
(this=0x82aa40, context=...)
at ../../../../modules/juce_opengl/native/juce_OpenGL_linux.h:110
#2 0x0051ddc0 in juce::OpenGLContext::CachedImage::initialiseOnThread (
this=0x86e118)
at ../../../../modules/juce_opengl/opengl/juce_OpenGLContext.cpp:367
#3 0x0051dca0 in juce::OpenGLContext::CachedImage::run (this=0x86e118)
at ../../../../modules/juce_opengl/opengl/juce_OpenGLContext.cpp:334
#4 0x0020dfa4 in juce::Thread::threadEntryPoint (this=0x86e120)
at ../../../../modules/juce_core/threads/juce_Thread.cpp:101
#5 0x0020e00c in juce::juce_threadEntryPoint (userData=0x86e120)
at ../../../../modules/juce_core/threads/juce_Thread.cpp:113
#6 0x0022ec50 in juce::threadEntryProc (userData=0x86e120)
at ../../../../modules/juce_core/native/juce_posix_SharedCode.h:843
#7 0xb6cc5bfc in start_thread () from /lib/arm-linux-gnueabihf/libpthread.so.0
#8 0xb6a5c968 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
#9 0xb6a5c968 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
I was hoping to find a *very* simple X11 window with simple OpenGL content A "HelloWorld"- type app that I could prove works on my set-up - but so far haven't found anything.
I can supply more info - Or (to check it for yourself, I can provide a Juce Introjucerproject file so you can see exactly what I'm getting )
Any and all suggestions / advice appreciated .
Re: X11 EGL on the Raspberry Pi
As already mentioned , the Pi only supports
software rendering for OpenGL , and we hope Eric Anholts
work will change that. As the Pis CPU is not that strong ,
you will be lucky to get a framerate of 1 f/s without his
work.
You can either investigate modifying Juces OpenGL ES backend
for the Pi (should literally be two lines) or try glshim , an
OpenGL to OpenGL ES wrapper.
ghans
software rendering for OpenGL , and we hope Eric Anholts
work will change that. As the Pis CPU is not that strong ,
you will be lucky to get a framerate of 1 f/s without his
work.
You can either investigate modifying Juces OpenGL ES backend
for the Pi (should literally be two lines) or try glshim , an
OpenGL to OpenGL ES wrapper.
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Re: X11 EGL on the Raspberry Pi
Thanks for the pronpt response, [ghans] 
)?
glshim, I assume would just mean building https://github.com/lunixbochs/glshim, and adding it to the list of libraries to link with. (Correct me, if I'm wrong) I'll give that a go, now. But I didn't understand the backend.
Thanks again

I hadn't realised that. I'd seen the OpenGl demos in the /opt/vc/src/hello_pi demos and assumed it was rendered natively, by broadcom's chip. Just seeing this (Pi Forum:OpenGL capabilities) for the first time.ghans wrote:As already mentioned , the Pi only supports software rendering for OpenGL , and we hope Eric Anholts
work will change that. As the Pis CPU is not that strong ,you will be lucky to get a framerate of 1 f/s without his
work.
Could you please explain that a little more (Assume I'm a complete Linux/OpenGL Noob, and you won't be far wrong!ghans wrote:You can either investigate modifying Juces OpenGL ES backend for the Pi (should literally be two lines) or try glshim , an OpenGL to OpenGL ES wrapper.

glshim, I assume would just mean building https://github.com/lunixbochs/glshim, and adding it to the list of libraries to link with. (Correct me, if I'm wrong) I'll give that a go, now. But I didn't understand the backend.
Thanks again
Re: X11 EGL on the Raspberry Pi
Is this description correct (copy some files, and add an export)?
I successfully built lib/libGL.so.1 and libGLU.so.1 and copied them to a & enabled them but no joy. Can anyone suggest something I can use to check that they're installed correctly/are working (I did notice a test app in one of the source trees, but haven't tried yet... I will, but don't hold much hope at the moment)
I successfully built lib/libGL.so.1 and libGLU.so.1 and copied them to a & enabled them but no joy. Can anyone suggest something I can use to check that they're installed correctly/are working (I did notice a test app in one of the source trees, but haven't tried yet... I will, but don't hold much hope at the moment)
Re: X11 EGL on the Raspberry Pi
GLshim is a pile of .... for serious use.Dub wrote:Is this description correct (copy some files, and add an export)?
I successfully built lib/libGL.so.1 and libGLU.so.1 and copied them to a & enabled them but no joy. Can anyone suggest something I can use to check that they're installed correctly/are working (I did notice a test app in one of the source trees, but haven't tried yet... I will, but don't hold much hope at the moment)
(GL1.4 only AND doesn't handle windowing support, fullscreen only)
Anholt driver can be tried with the custom mesa/kernel/X11 DDX but is still crashy.
Re: X11 EGL on the Raspberry Pi
I wonder if shaders could be used for conversion from RGBA to RGB565 as I now think vc4 does not implement the RGB565 format.
something like the following from https://www.opengl.org/discussion_board ... HORT_5_6_5
and some links:
http://www.khronos.org/message_boards/s ... conversion
something like the following from https://www.opengl.org/discussion_board ... HORT_5_6_5
Code: Select all
glReadPixels(x,y,w,h,GL_RGB,GL_UNSIGNED_SHORT_5_6_5,frame_buffer);
/// shader code
/** GRAY16 to RGB conversion
* data transfered as GL_LUMINANCE_ALPHA then convert back to GRAY16
* high byte weight as : 255*256/65535
* ([0~1] denormalize to [0~255],shift to high byte,normalize to [0~1])
* low byte weight as : 255/65535 (similar)
* */
#define COMPOSE_WEIGHT \
"const vec2 compose_weight = vec2(0.996109, 0.003891);\n"
#if GST_GL_HAVE_OPENGL
static const char *frag_AYUV_opengl = {
"uniform sampler2D tex;\n"
"uniform vec2 tex_scale0;\n"
"uniform vec2 tex_scale1;\n"
"uniform vec2 tex_scale2;\n"
YUV_TO_RGB_COEFFICIENTS
"void main(void) {\n"
" float r,g,b;\n"
" vec3 yuv;\n"
" yuv = texture2D(tex, gl_TexCoord[0].xy * tex_scale0).gba;\n"
" yuv += offset;\n"
" r = dot(yuv, rcoeff);\n"
" g = dot(yuv, gcoeff);\n"
" b = dot(yuv, bcoeff);\n"
" gl_FragColor=vec4(r,g,b,1.0);\n"
"}"
};
/** GRAY16 to RGB conversion
* data transfered as GL_LUMINANCE_ALPHA then convert back to GRAY16
* high byte weight as : 255*256/65535
* ([0~1] denormalize to [0~255],shift to high byte,normalize to [0~1])
* low byte weight as : 255/65535 (similar)
* */
static const char *frag_COMPOSE_gles2 = {
"precision mediump float;\n"
"varying vec2 v_texcoord;\n"
"uniform sampler2D tex;\n"
"uniform vec2 tex_scale0;\n"
"uniform vec2 tex_scale1;\n"
"uniform vec2 tex_scale2;\n"
COMPOSE_WEIGHT
"void main(void)\n"
"{\n"
" vec4 t = texture2D(tex, v_texcoord * tex_scale0);\n"
" float value = dot(t.%c%c, compose_weight);"
" gl_FragColor = vec4(value, value, value, 1.0);\n"
"}"
};
static const char *frag_AYUV_gles2 = {
"precision mediump float;\n"
"varying vec2 v_texcoord;\n"
"uniform sampler2D tex;\n"
"uniform vec2 tex_scale0;\n"
"uniform vec2 tex_scale1;\n"
"uniform vec2 tex_scale2;\n"
YUV_TO_RGB_COEFFICIENTS
"void main(void) {\n"
" float r,g,b;\n"
" vec3 yuv;\n"
" yuv = texture2D(tex,v_texcoord * tex_scale0).gba;\n"
" yuv += offset;\n"
" r = dot(yuv, rcoeff);\n"
" g = dot(yuv, gcoeff);\n"
" b = dot(yuv, bcoeff);\n"
" gl_FragColor=vec4(r,g,b,1.0);\n"
"}"
};
http://www.khronos.org/message_boards/s ... conversion
Re: X11 EGL on the Raspberry Pi
How so? http://www.broadcom.com/docs/support/vi ... G100-R.pdfmung wrote:I now think vc4 does not implement the RGB565 format.
Re: X11 EGL on the Raspberry Pi
But glshim does have x11 windowing support on another ARM board with Mali-400 GPU. And also on an x86 laptop with NVIDIA GPU and a custom Mesa build (OpenGL ES enabled, OpenGL disabled).mimi123 wrote: GLshim is a pile of .... for serious use.
(GL1.4 only AND doesn't handle windowing support, fullscreen only)
Re: X11 EGL on the Raspberry Pi
It's an Allwinner A10 based device with Mali 400 MP1 GPU (Allwinner A20 has an upgraded Mali 400 MP2 with twice more pixel processors). A sample youtube video is available here - Qt5 Cinematic Experience on Allwinner A10 (Mele A2000 TV box) using X11 driversmung wrote:Is the a beaglebone or has someone created a mali expansion board?ssvb wrote:You normally expect 200fps or more for the simple OpenGL ES stuff. Zero copy buffer swaps make a big difference - http://ssvb.github.io/images/2013-02-01 ... ration.pngNot that poor. 20fps in a 1024*768 window with XPutImage.
In addition, some people may prefer perfect 60Hz vsync without tearing, which is also not really possible with XPutImage.
VC4 is better. The advantage can be observed on shader heavy workloads with fog and other effects, such as this particular Qt5 demo (where the FPS does not go higher than 50 on Mali 400 MP1). But something as simple as just a rotating cube can easily run at hundreds of FPS.all the things I have read suggest that the vc4 gpu is far better than the mali 400, why such high frame rates and the pi still has no support?
Now that the Mesa driver development is sponsored by Broadcom, the chances are that the 3D driver is going to be properly implemented and integrated

Re: X11 EGL on the Raspberry Pi
@Dub
Could you start a new thread ? Perhaps you could even
cross-post to the JUCE forums (if they allow such things ).
ghans
Could you start a new thread ? Perhaps you could even
cross-post to the JUCE forums (if they allow such things ).
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Re: X11 EGL on the Raspberry Pi
Now, that thread is useless as Eric Anholt's driver is much more adapted.
Re: X11 EGL on the Raspberry Pi
I am not sure what you are refering to, I think last submission to the anholt mesa git repo was over a month ago?mimi123 wrote:Now, that thread is useless as Eric Anholt's driver is much more adapted.
I imagine most developers in early developments have fairly large time frame between updating git, I don't really know about such things though.
What exactly do you mean by 'adapted', is this some obfuscatyed hint?
Will there be some upgrade to raspbian soon?
I doubt I will be looking at any of this stuff for a few months now as I have serious problems with a laptop and backup harddrive bought from pcworld that failed about 3 weeks outside the 1 year guarantee period (important note, make sure you backup your backups!). Anyways as side note I am probably going to have to take pcworld to small claims court and will be starting a flame against that evil money grabbing retail store, please boycott them if you get the chance!.
Re: X11 EGL on the Raspberry Pi
http://cgit.freedesktop.org/mesa/mesa/l ... grep&q=vc4
It's now mainlined! don't try to use the OLD tree any more!
It's now mainlined! don't try to use the OLD tree any more!
-
- Posts: 20
- Joined: Sun Nov 27, 2016 6:21 am
Re: X11 EGL on the Raspberry Pi
I just made this work again for Raspberry PI 3 Model B
It is a nice simple way to get OpenGLES2.0 running inside
a window when running PIXEL on RPI 3 Model B
https://github.com/PaulHaeberli/pi-eglonx
It is a nice simple way to get OpenGLES2.0 running inside
a window when running PIXEL on RPI 3 Model B
https://github.com/PaulHaeberli/pi-eglonx