RPi4 + Buster Lite + oF 0.11.0

Hi!
Some time ago I’ve managed to run oF 0.11.0 examples on Buster Lite running on RPi3. Here’s some details: RPi3 + Buster Lite + oF 0.11.0 = can't run example

Now, I’m trying to do the same on RPi4 but with no luck.
Steps:

  1. SD card with fresh 2020-02-13-raspbian-buster-lite.img
  2. sudo raspi-config > Advanced > Memory Split > 256
  3. sudo apt-get clean && sudo apt-get update && sudo apt-get dist-upgrade
  4. wget https://openframeworks.cc/versions/v0.11.0/of_v0.11.0_linuxarmv6l_release.tar.gz
  5. sudo mkdir openFrameworks && sudo tar vxfz of_v0.11.0_linuxarmv6l_release.tar.gz -C openFrameworks --strip-components 1
  6. sudo rm of_v0.11.0_linuxarmv6l_release.tar.gz
  7. cd openFrameworks/scripts/linux/debian && sudo ./install_dependencies.sh && sudo ./install_codecs.sh
  8. sudo nano openframeworks/libs/openFrameworksCompiled/project/linuxarmv6l/config.linuxarmv6l.default.mk
    #USE_PI_LEGACY = 0 //commenting this out
  9. cd && sudo make Release -C openFrameworks/libs/openFrameworksCompiled/project
  10. cd … && sudo nano config.make
    PROJECT_LDFLAGS += -latomic //add the flag
  11. sudo make

Compiled without issue, but when trying to run i get:

**pi@raspberrypi** : **~/openFrameworks/examples/3d/quaternionLatLongExample $** make run
VER ID IS 10
using legacy build
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): screenRect: 1920x1080
[notice ] ofAppEGLWindow: setupRPiNativeWindow(): windowRect: 1920x1080
[notice ] ofAppEGLWindow: createSurface(): setting up EGL Display
[notice ] ofAppEGLWindow: createSurface(): EGL Display correctly set 0x1
[notice ] ofAppEGLWindow: createSurface(): no current renderer selected
[notice ] ofAppEGLWindow: createSurface(): default renderer detected
[notice ] ofAppEGLWindow: createSurface(): surface created correctly
[notice ] ofAppEGLWindow: createSurface(): API bound correctly
[notice ] ofAppEGLWindow: createSurface(): -----EGL-----
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MAJOR = 1
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION_MINOR = 4
[notice ] ofAppEGLWindow: createSurface(): EGL_CLIENT_APIS = OpenGL_ES OpenVG
[notice ] ofAppEGLWindow: createSurface(): EGL_VENDOR = Broadcom
[notice ] ofAppEGLWindow: createSurface(): EGL_VERSION = 1.4
[notice ] ofAppEGLWindow: createSurface(): EGL_EXTENSIONS = EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_vg_parent_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_lock_surface
[notice ] ofAppEGLWindow: createSurface(): GL_RENDERER = VideoCore IV HW
[notice ] ofAppEGLWindow: createSurface(): GL_VERSION = OpenGL ES-CM 1.1
[notice ] ofAppEGLWindow: createSurface(): GL_VENDOR = Broadcom
[notice ] ofAppEGLWindow: createSurface(): -------------
[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/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.0/0003:1915:1001.0001/input/input0
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 0
[notice ] - ID_INPUT_KEYBOARD: 1
[notice ] - ID_INPUT_MOUSE:
[notice ] Got device
[notice ] - node: /dev/input/event0
[notice ] - sysname: event0
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.0/0003:1915:1001.0001/input/input0/event0
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 3392
[notice ] - ID_INPUT_KEYBOARD: 1
[notice ] - ID_INPUT_MOUSE:
[notice ] ofAppEGLWindow: addInput(): input device name = 123 COM Smart Control
[notice ] Got device
[notice ] - node:
[notice ] - sysname: input1
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.1/0003:1915:1001.0002/input/input1
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 0
[notice ] - ID_INPUT_KEYBOARD:
[notice ] - ID_INPUT_MOUSE: 1
[notice ] Got device
[notice ] - node: /dev/input/event1
[notice ] - sysname: event1
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.1/0003:1915:1001.0002/input/input1/event1
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 3393
[notice ] - ID_INPUT_KEYBOARD:
[notice ] - ID_INPUT_MOUSE: 1
[notice ] ofAppEGLWindow: addInput(): input device name = 123 COM Smart Control
[ error ] ofAppEGLWindow: ioctl GABS failed
[ error ] ofAppEGLWindow: ioctl GABS failed
[notice ] Got device
[notice ] - node: /dev/input/mouse0
[notice ] - sysname: mouse0
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.1/0003:1915:1001.0002/input/input1/mouse0
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 3360
[notice ] - ID_INPUT_KEYBOARD:
[notice ] - ID_INPUT_MOUSE: 1
[notice ] Got device
[notice ] - node:
[notice ] - sysname: input2
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.2/0003:1915:1001.0003/input/input2
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 0
[notice ] - ID_INPUT_KEYBOARD:
[notice ] - ID_INPUT_MOUSE:
[notice ] Got device
[notice ] - node: /dev/input/event2
[notice ] - sysname: event2
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.2/0003:1915:1001.0003/input/input2/event2
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 3394
[notice ] - ID_INPUT_KEYBOARD:
[notice ] - ID_INPUT_MOUSE:
[notice ] Got device
[notice ] - node:
[notice ] - sysname: input3
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.2/0003:1915:1001.0003/input/input3
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 0
[notice ] - ID_INPUT_KEYBOARD:
[notice ] - ID_INPUT_MOUSE:
[notice ] Got device
[notice ] - node: /dev/input/event3
[notice ] - sysname: event3
[notice ] - devpath: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.2/0003:1915:1001.0003/input/input3/event3
[notice ] - devtype:
[notice ] - driver:
[notice ] - devnum: 3395
[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:
[notice ] --- Input Device List ---:
[notice ] - /dev/input/event0
[notice ] - /dev/input/event1
[notice ] -------------------------:
[notice ] ofAppEGLWindow: setupPeripherals(): native event setup complete
make: *** [/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:184: run] Interrupt

…and I need to kill it since it just hangs there. Any help?

@mattc I think that is because the Rpi4 uses a different graphics driver than the Rpi3 so the legacy trick you did for the Rpi3 and 0.11.0 won’t work with Rpi4.

For Rpi4 and 0.11.0 you have to have USE_PI_LEGACY = 0 and then select the non legacy driver from raspi-conf

I think @jvcleave has been working on supporting EGL without the X window requirement that our current approach uses. If it works, I’m hoping to add that functionality into the current window approach.

Thank you for your post!
Here’s what I’ve done:

  1. USE_PI_LEGACY = 0 is back
  2. GL driver set to non-legacy
  3. sudo make clean and sudo make Release in the openFrameworks/libs/openFrameworksCompiled/project directory
  4. sudo make clean, sudo make, sudo make run in one of the examples.

Compiled, but not running. Throwing this:

VER ID IS 10
using newer build and GLFW window
[ error ] ofAppGLFWWindow: 65544: X11: The DISPLAY environment variable is missing
[ error ] ofAppGLFWWindow: couldn’t init GLFW
[ error ] ofAppGLFWWindow: 65537: The GLFW library is not initialized
Segmentation fault
make: *** [/home/pi/openFrameworks/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:184: run] Error 139

Hi @mattc

Are you running this headless? Or from the terminal?
You will need to be in an X environment for the GLFW windowing to work.

If you need to run it headless you can use the 3rd party library xvfb to launch apps without a monitor attached.

xvfb-run ./examples/graphics/polygonExample/bin/polygonExample

You might get one glfw error message but it does run the apps okay.
more about that here: https://github.com/openframeworks/openFrameworks/pull/6438#issuecomment-552217431

Not a headless setup. Just a lite system without X environment.

OF doesn’t seem to run without an X environment on RPI4+Buster out of the box.

If you do get it running in the Desktop environment, the performance with OF is not great
and in some cases worse than using an RPI3.

Hi, just got a Pi 4 and followed the setup guide on a freshly installed real-time raspbian lite distrib on which I was successful running pure data with a very low latency on a Pi 3 in the past, so I was hoping to use ofxPd on the Pi 4 with low latency for a new project invoving a multi touch DSI screen.

As you can imagine I encountered the same error and came across this thread while trying to figure out what was going on. From what I read, I have two options : either installing X11 on the real-time distrib, or patching a raspbian desktop distrib with a real-time kernel. I’m not a linux expert at all and have no idea of each solution’s complexity and relevance, so I would appreciate any advice or pointers.

Thanks !

EDIT : just came across this discussion, will give it a try and post back if I get some success