Rpi 4 / Raspbian Buster / openFrameworks

Are you running this from X11? Because it seems it’s failing to create a window.

[ error ] ofAppEGLWindow: createEGLWindow(): no native window type for this system, perhaps try X11?

The ofGstVideoUtils warning is just because there is no webcam connected to the RPI.

I get the same error

[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed:

and running from console

1 Like

I was executing it over SSH while my pi was running Raspbian Desktop. In that scenario, no window would open at all. However, when I run it locally by either double clicking the executable or running it from the console, a window appears but nothing is drawn in it. I have tried a few different examples and they all behave pretty much the same. Like @sandufi, I also get an indefinite stream of the following while the window is open. Hope that’s useful.

[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: �`�surface specified

Can you list the full console output? There should be going something wrong during initialization higher up.

You definitely need to launch from X11 with my branch as I patched out the RPI native window that you could launch from the console.

Sure. Here it is:

HOST_OS=Linux
checking pkg-config libraries:   cairo zlib gstreamer-app-1.0 gstreamer-1.0 gstreamer-video-1.0 gstreamer-base-1.0 libudev freetype2 fontconfig sndfile openal libcurl glfw3 rtaudio gtk+-3.0 gl glu glew 
with PKG_CONFIG_LIBDIR=
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0x1affe68
libEGL warning: DRI2: failed to authenticate
[notice ] ofAppEGLWindow: createSurface(): no current renderer selected
[notice ] ofAppEGLWindow: createSurface(): default renderer detected
[ error ] ofAppEGLWindow: createSurface(): no matching configs were found, num_configs: 0
[ error ] ofAppEGLWindow: setupPeripherals(): peripherals not supported on X11
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: @�P�surface specified

@ThomasColliers does changing

To:
PLATFORM_DEFINES += TARGET_LINUX

Get rid of the need for all those changes in your branch?

Theo

I’ve tried to compile OFW in a RPI3B+ to see if it runs in Raspbian Buster in RPI4 and I’ve got the following error

error while loading shared libraries: libboost_filesystem.so.1.62.0: cannot open shared object file: No such file or directory

Do you think it is possible to run this way?

I’m in the same step in your fork. things compile and run, no window is created and same message is repeated. here are my previous console messages.

make RunRelease
[ error ] ofAppEGLWindow: createEGLWindow(): no native window type for this system, perhaps try X11?
[warning] ofAppEGLWindow: getNativeDisplay(): window not initialized, returning NULL
[warning] ofAppEGLWindow: getNativeDisplay(): window not initialized, returning NULL
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0x19fa378
[ error ] ofAppEGLWindow: createSurface(): eglInitialize returned EGL_FALSE
[ error ] ofAppEGLWindow: setupOpenGL(): screen creation failed, window not inited
[notice ] ofAppEGLWindow: setupPeripherals(): peripheral setup complete
[notice ] ofAppEGLWindow: setupNativeUDev(): created udev object
[notice ] ofAppEGLWindow: setupNativeInput()
[notice ] Got device
[notice ]  - node: 
[notice ]  - sysname: input0
[notice ]  - devpath: /devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/input/input0
[notice ]  - devtype: 
[notice ]  - driver: 
[notice ]  - devnum: 0
[notice ]  - ID_INPUT_KEYBOARD: 
[notice ]  - ID_INPUT_MOUSE: 
[notice ] Got device
[notice ]  - node: /dev/input/event0
[notice ]  - sysname: event0
[notice ]  - devpath: /devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/input/input0/event0
[notice ]  - devtype: 
[notice ]  - driver: 
[notice ]  - devnum: 3392
[notice ]  - ID_INPUT_KEYBOARD: 
[notice ]  - ID_INPUT_MOUSE: 
[notice ] Got device
[notice ]  - node: /dev/input/mouse0
[notice ]  - sysname: mouse0
[notice ]  - devpath: /devices/platform/soc/fe204000.spi/spi_master/spi0/spi0.1/input/input0/mouse0
[notice ]  - devtype: 
[notice ]  - driver: 
[notice ]  - devnum: 3360
[notice ]  - ID_INPUT_KEYBOARD: 
[notice ]  - ID_INPUT_MOUSE: 
[notice ] Got device
[notice ]  - node: /dev/input/mice
[notice ]  - sysname: mice
[notice ]  - devpath: /devices/virtual/input/mice
[notice ]  - devtype: 
[notice ]  - driver: 
[notice ]  - devnum: 3391
[notice ]  - ID_INPUT_KEYBOARD: 
[notice ]  - ID_INPUT_MOUSE: 
[ error ] ofAppEGLWindow: setupNativeInput(): did not open mouse
[ error ] ofAppEGLWindow: setupKeyboard(): did not open keyboard
[notice ] --- Input Device List ---: 
[notice ] -------------------------: 
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: 
[notice ] ofAppEGLWindow: display(): eglSw

Any updates here? Looking to buy a Rpi 4 for a new project, but sounds like buying a Rpi 3 would be safer for now? It would be useful to update this page: https://openframeworks.cc/setup/raspberrypi/ with a note about compatibility, too.

1 Like

@ThomasColliers or anyone who has got this working, are you able to put together a Pull Request to the OF repo with changes needed to get the Pi 4 running? It would be good to get this in the next release even if it might involve adding some notes to the ReadMe for configuring the Pi drivers.

2 Likes

I would just love to have it running on RPI 4. none of the recipes worked for me until now.
Unfortunately I had to buy some more 3B+ to make it work for a project.

@ThomasColliers patch worked here. the problem was I was invoking from ssh. if I boot with Desktop and invoke program with keyboard (didnt have one before) it runs.

edit: fullscreen doesn’t work, always windowed, and pressing esc to quit only freezes and keeps the window.

Thanks all for this thread.

I worked in @ThomasColliers changes to a PR with a few tweaks.
It works for me in EGL and GLFW modes but only with the legacy GL driver disabled with raspi-conf

If you want to switch between GLFW and EGL use this define in the makefile.

Any testing on Rpi 3 or earlier would be handy as I only have a Rpi 4 to test with.

Thanks
Theo

4 Likes

Thanks for working on this @Theo!

Internet permitting, I’ll give Buster + this branch of OF a shot on my RPi3. Might not have extra microSD cards lying around but hopefully can figure all this out over the weekend.

2 Likes

Update, it works on the RPI3. Details on the PR.

2 Likes

Having some trouble installing this.

I’m using a pi4 with Buster. I downloaded this https://github.com/ofTheo/openFrameworks/tree/feature-rpi4

Ran ‘sudo ./install_dependencies.sh’ and got ‘command not found’

Am I missing something?

I’m also confused about ’ EGL and GLFW ', is that something that needs to be downloaded? In raspi-config i have ‘Legacy’ disabled and ‘Gl (Fake KMS)’ enabled

Where are you on the path when running the sudo command?

Unless you’re in openFrameworks/scripts/linux/debian, from where you can run sudo sh install_dependencies.sh, you’d have to do

sudo sh path/to/oF/scripts/linux/debian/install_dependencies.sh

You’re missing the sh and trying to run a bash script like an executable and maybe you’re on the wrong path as well.

EGL/GLFW isn’t something that needs to be downloaded, they are different windowing systems that OF uses for creating windows for the apps. GL Full KMS works as far as I know (Fake KMS might as well) and from the Github thread, GLFW has less issues than EGL at the moment IIRC which needs one of the makefile lines to be uncommented.

Also, if you’re installing from GitHub, don’t forget to run the download_libs scripts as well, otherwise OF will not compile.

Thanks! Adding ‘sh’ worked and I also installed ‘download_libs’.

None of the examples have config or make files. Is that normal?

When I add the config and make files to a project, and then try to compile the project i’m getting:

Makefile:13: /home/pi/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk: No such File or directory make: *** No rule to make target '/home/pi/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk'. Stop.

Also how exactly is EGL or GLFW enabled?

You also need to compile openFrameworks after you ave the dependencies and the libs. The makefiles can be generated with the project generator (which you need to pull with the git submodule command).

From the repository:

If you are working with the Git repository, the stable branch of the OF repository corresponds to the most recent release, with a few important differences:

  1. The release includes a simple openFrameworks project generator.
  2. This GitHub repository contains code and libs for all the platforms, but the releases are done on a per-platform basis.
  3. This GitHub repository has no project files for the different examples. They are generated automatically for each release using a tool in apps/projectGenerator/ .
  4. There are no external dependencies in this repository, you can download them using the download_libs.sh script for each platform in the particular platform folder inside scripts.

If you want to work with the openFrameworks GitHub repository, you need to download the external dependencies and you should use the project generator to create project files for all the code in examples/ . To generate the project files with the project generator enable the ‘Advanced Options’ in the settings tab, then use ‘Update Multiple’ to update the projects for the examples/ folder path in the repo.

To set up the project generator submodule within the OF repo, use the command git submodule init then git submodule update whilst inside the openFrameworks repo.

To compile OF, you need to run

make Release -C /home/pi/openFrameworks/libs/openFrameworksCompiled/project

The EGL/GLFW switching happens from the global makefile, which may have changed over the last 24 hours as @Theo is actively pushing changes to the repo to make usage seamless. I’d advice maybe waiting for OF0.11.0 to officially release with all instructions + makefiles etc. Things are rapidly changing to make everything seamless for the release and there are still bugs that are being ironed out.

Has anyone successfully make OF work on Rpi 4 / Buster?