Quantcast
Channel: arm - openFrameworks
Viewing all 147 articles
Browse latest View live

RasPi 4, failed to load driver: vc4

$
0
0

@okyeron wrote:

I’m getting the following when running my oF app on Raspberry Pi 4 - with a fresh install of oF 0.11.0

libGL error: failed to create dri screen
libGL error: failed to load driver: vc4
libGL error: failed to create dri screen
libGL error: failed to load driver: vc4

/boot/config.txt has dtoverlay=vc4-fkms-v3d set for pi4

FWIW - everything seems to be working OK, but the same app on my pi3b+ runs with much less CPU. Pi4 seems to use way more CPU - esp. when I have an fbo.
(both have dtoverlay=vc4-fkms-v3d)

Any ideas?

Posts: 7

Participants: 2

Read full topic


4K camera for RaspberryPi 4

$
0
0

@info.kevinjackson wrote:

Introducing e-CAM130_CURB, Ultra HD 4K 13MP MIPI CSI-2 Camera for Raspberry Pi 4. This Raspberry Pi High Resolution camera is based on 1/3.2” AR1335 CMOS image sensor from ON Semiconductor® and has a dedicated, high-performance Image Signal Processor (ISP) that performs all the Auto functions like auto white balance, auto exposure control in addition to complete image signal processing pipeline that provides best-in-class images and video and the optional MJPEG compression.

Posts: 1

Participants: 1

Read full topic

0.11.0 + Buster(RPI4) + CLI (no X!).. is it possible or not?

$
0
0

@Intruder wrote:

Hello,

Sorry for creating another topic on this subject, but after spending hours reading old topics and trying to compile it on my RPI4 it’s still not clear to me:

Q: Is it possible to run OF applications on RPI4 (Buster) in CLI mode without XWindows ?

I did manage to compile OF “using legacy build”, but at the end when I run polygonExample, I do get (* failed to add service already in use?" after setting up EGL Dispaly message.

NB: I’ve developed in past years numerous applications with OF running on RPis as complete standalone systems. The goal was to get the maximum performance out of the hardware (RPI) and to avoid any additional layers. Having Xwindows running makes little sense for me, as it takes additional resources and makes it very difficult to manage remotely using just command prompt.

Posts: 5

Participants: 3

Read full topic

ofGLProgrammableRenderer error on Pi

$
0
0

@okyeron wrote:

Trying to compile examples/gl/pointsAsTexturesExample on RasPI 4 (Buster) I’m running into this error which looks like it has come up before in older versions

(I’m running oF 0.11.0)

error: could not convert ‘ofGLProgrammableRenderer::TYPE’ from ‘const string’ {aka ‘const std::__cxx11::basic_string<char>’} to ‘std::shared_ptr<ofBaseRenderer>’
  ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);

is this expected or normal on PI4?

Searching around on GitHub for any clues, I came across this example with a different way of setting the renderer:

What’s the correct approach here?

Posts: 2

Participants: 1

Read full topic

PingPong Buffer Shader Problem in ofxShader

$
0
0

@floftus wrote:

Hi there,

I’m trying to get this slitscan shader by patriciogonzalezvivo to work on my rpi3b+:


In this example the ping pong buffers are handled in the ofApp.cpp file and the shader code is in the setup function via STRINGIFY.
I tried to get this working using STRINGIFY but had no luck.

So, I’m now trying to use the feedback technique from ofxShader where the ping pong buffers are handled in the .frag file.
I’ve already used this technique to get a shadertoy feedback shader and it worked completely fine.
(https://www.shadertoy.com/view/4lV3RG)

From what I can tell, I’ve written the code for the slitscan shader the same way as I did with the shadertoy shader but I’m getting nowhere and have run out of ways to troubleshoot this problem.

Does anyone have any thoughts on what might be going wrong? I’m happy to share my code if that will help.

I’ve read quite a bit on the forum about getting shaders working on the rpi and think I’m following most of the advice but I must be going wrong somewhere…

Posts: 1

Participants: 1

Read full topic

Sound issues on RPi4, oF 0.11.1, Lite system

$
0
0

@mattc wrote:

Hi!
Straight to the point:

  1. RPi4, 8GB of RAM, clean installation of RaspberryOS Lite (2021-01-11);
  2. enabled SSH, memory split set to 512, audio set to jack, GL driver set to Fake KMS;
  3. apt-get update && apt-get dist-upgrade && apt-get install xorg
  4. Downloaded oF 0.11.1, installed dependencies and codecs, compiled the framework;
  5. Compiled example sound/audioOutputExample - it works OK (including audio).
  6. Compiled example sound/soundPlayerExample - it starts but no sound.
    When app is running logs will show this line each second the app is running:
    AL lib: (EE) ALCplaybackAlsa_mixerProc: Wait timeout... buffer size too low?

When testing with aplay bin/data/sounds/beat.wav and sudo aplay bin/data/sounds/beat.wav - sound works.
When testing with speaker-test and sudo speaker-test - sound works.

Any tips?

Posts: 1

Participants: 1

Read full topic

PS3eye and Rpi4

$
0
0

Hey,

I am building an ofx project for the first time on a Rpi and im struggling to make ofxCvPiCam work. Im pretty sure it is to do with the src code files as theyre not the usual ofApp naming. I am using a ps3eye as well.

Much appreciated if someone could point me in the right direction.

Thanks

5 posts - 2 participants

Read full topic

Running addressable LED strip and rpi4

$
0
0

Im looking for the GPIO pin address in the code that controls the input for the LED’s, its probaby obvious but could someone point it out. I want to connect my strip to the pi but have no idea which pin is being used.

I would like to control an array of LED’s using this addon ofxGPIO by @kashim .

#include "ofMain.h"
#include "ofAppNoWindow.h"
#include "ofxGPIO.h"

class ofApp : public ofBaseApp
{
        public:
		LED apa;
		vector<ofColor> colors;
		int numLed;
		int brightness;
    
        void create_palett()
        {
            for(int i = 0; i < numLed; i++) {
                colors.push_back(ofColor(
                                         (int)ofRandom(0,255),
                                         (int)ofRandom(0,255),
                                         (int)ofRandom(0,255)
                                         ));
            }
        }

        void gen_palett()
        {
            for(int i = 0; i < numLed; i++) {
                colors[i] = ofColor(
                              (int)ofRandom(0,255),
                              (int)ofRandom(0,255),
                              (int)ofRandom(0,255)
                              );
            }
        }

		void setup()
		{
			brightness = 5;
			numLed     = 95;
			create_palett();
			apa.setupAPA102();
		}

		void update(){
			gen_palett();
			apa.setAPA102(numLed,colors,brightness);
			usleep(100000);
            //cycling from blackout up to max brightness
            if(brightness<31) brightness++;
            else brightness=0;
		}
		
		void exit(){
			ofLog()<<"Exit";
			apa.clearAPA102(numLed+5);
			ofExit(0);
		}

		
};

int main( ){
        ofAppNoWindow w;
	ofSetupOpenGL(&w,0,0, OF_WINDOW);
	ofRunApp( new ofApp() );
}

2 posts - 2 participants

Read full topic


Rpi Crontab autostart - not working

$
0
0

Ive been skimming through previous posts and googling but ive yet to resolve why this simple startup script isnt working for me.

Is this line correct as its not executing my program?

  • my file has permissions

Copied this:

@reboot sleep 10 && cd /home/pi/openFrameworks/apps/myApps/<yourAppFile>/bin && ./<yourAppName>

Here’s mine:

@reboot sleep 10 && cd /home/pi/openFrameworks/apps/myApps/mvp_draft_6/bin && ./mvp_draft_6

6 posts - 3 participants

Read full topic

GStreamer v1.18 + RPi = rpicamsrc

$
0
0

I managed to get GStreamer v1.18 built on the RPi and it includes this new rpicamsrc. I’m wondering how I could use this in OF? Do I need to setup a custom GStreamer Pipeline?

I’m trying to get streaming from one pi to another working.

1 post - 1 participant

Read full topic

Raspberry Pi and ofxAruco

$
0
0

OF11.0
RP3B (Buster)
Pi camera v2.1

Hi all,
I’m trying to merge @arturo’s ofxAruco and @jvcleave’s ofxOMXcamera to be able to do some marker tracking using the Raspberry Pi.

After a lot of collisions between the Pi’s libraries and all the addons, I finally managed to make it compile without errors but I still do not get the Aruco marker (it works on laptop and using the PS3eye on the Pi with the same code).

The problem seems to be that when I try to replace the videoGrabber object for the OMXvideoGrabber there seem to be a few conflicts.

Are there any suggestions for how to get the Pi camera data into the aruco.getBoards() function? here is the relevant code that compiles without detecting the marker:

ofApp.h:

ofxOMXVideoGrabber videoGrabber;

ofApp.cpp:

ofxOMXCameraSettings settings;
	settings.sensorWidth					= 1280;
	settings.sensorHeight				= 720;
	settings.enablePixels = true;

	
	
	videoGrabber.setup(settings);
	filterCollection.setup();
    
	
    aruco.setup("intrinsics.int", settings.sensorWidth, settings.sensorHeight, boardName, markerSize);
    aruco.getBoardImage(board.getPixels());
    board.update();
    
    showMarkers = true;
    //    showBoard = true;
    showBoardImage = false;
    
    ofEnableAlphaBlending();
}

//--------------------------------------------------------------
void ofApp::update()
{
    //videoGrabber.onUpdate();
    if(videoGrabber.isFrameNew()){
        aruco.detectBoards(videoGrabber.getPixels());
    }
}


//--------------------------------------------------------------
void ofApp::draw(){
    ofSetColor(255);
    
	
    videoGrabber.draw(0, 0);

Thanks in advance

2 posts - 1 participant

Read full topic

Of working on rockchip boards

$
0
0

Hello

I was able to make oF works in rockchip boards with mali gpu driver with minor changes using EGL window, i dont know if this interest someone but maybe will be cool to make it part of oF release to get more sbc compatibles.

i tested a 3288 model but will test soon other that support rockchip inference engine so can get neural models accelerated on those boards, what is cool imo

2 posts - 2 participants

Read full topic

OMX Camera & raspberryPi 3B+

$
0
0

Hello,

I have the following setup:

  • raspberryPi 3B+
  • raspberryPi camera + ofxOMXCamera addon
  • raspbian stretch
  • openFrameworks 0.10.1

I’m grabbing the camera image as a texture and display it on a screen connected via hdmi using the following code where cam_texture is of type ofTexture :

void update(){
if (cam.isFrameNew())
    {
        cam_texture = cam.getTextureReference();
    }
}

void draw(){
    cam_texture.drawSubsection(0, 0, cam_draw_width, cam_draw_width, 420, 0, 1080, 1080); 
}

This works fine as long as i start my OF program via command line over ssh, but when i start it from a local command line or script the camera image won’t be shown.
I have no clue what causes this issue and how to fix it so any help is appreciated!
merci

1 post - 1 participant

Read full topic

ofxDOF in Rpi4 Raspberry

$
0
0

Hi! I just managed to run shaders in raspberry 4 by changing the version to gles 2 in the main.cpp. Now I am trying to run a depth of field effect in the Rpi with the ofxDOF addon. Anybody knows how to do it, as the addon will not run in raspberry.

I got this error

/home/pi/openFrameworks/addons/ofxDOF/src/ofxDOF.cpp:25:61: error: ‘GL_TEXTURE_RECTANGLE_ARB’ was not declared in this scope
     dofBuffersSettings.textureTarget = ofGetUsingArbTex() ? GL_TEXTURE_RECTANGLE_ARB : GL_TEXTURE_2D;
 ^~~~~~~~~~~~~~~~~~~~~~~~
/home/pi/openFrameworks/addons/ofxDOF/src/ofxDOF.cpp:25:61: note: suggested alternative: ‘GL_TEXTURE_EXTERNAL_OES’
     dofBuffersSettings.textureTarget = ofGetUsingArbTex() ? GL_TEXTURE_RECTANGLE_ARB : GL_TEXTURE_2D;
 ^~~~~~~~~~~~~~~~~~~~~~~~
 GL_TEXTURE_EXTERNAL_OES

So I went to the ofxDOF.cpp and changed GL_TEXTURE_RECTANGLE_ARB by GL_TEXTURE_EXTERNAL_OES, and it compiled, but it reports several errors on the shader:

[ error ] ofShader: GL_VERTEX_SHADER shader reports:
0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.00 ES, 3.00 ES, and 3.10 ES

[ error ] ofShader: GL_VERTEX_SHADER, offending line 10 :
	    8	
	    9	// App uniforms and attributes
	   10	out vec4 vColor;
	   11	out vec2 vTexCoord;
	   12	

[ error ] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader failed to compile
[ error ] ofShader: GL_FRAGMENT_SHADER shader reports:
0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.00 ES, 3.00 ES, and 3.10 ES

[ error ] ofShader: GL_FRAGMENT_SHADER, offending line 10 :
	    8	uniform sampler2DRect range;
	    9	uniform vec2 sampleOffset;
	   10	uniform float focalDistance;
	   11	uniform float focalRange;
	   12	

[ error ] ofShader: checkProgramLinkStatus(): program failed to link
[ error ] ofShader: ofShader: program reports:
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
[ error ] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader failed to compile
[ error ] ofShader: GL_VERTEX_SHADER shader reports:
0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.00 ES, 3.00 ES, and 3.10 ES

[ error ] ofShader: GL_VERTEX_SHADER, offending line 10 :
	    8	in vec2 texcoord;
	    9	
	   10	// App uniforms and attributes
	   11	out vec4 vColor;
	   12	out vec2 vTexCoord;

[ error ] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader failed to compile
[ error ] ofShader: GL_FRAGMENT_SHADER shader reports:
0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.00 ES, 3.00 ES, and 3.10 ES

[ error ] ofShader: GL_FRAGMENT_SHADER, offending line 10 :
	    8	uniform float focalRange;
	    9	
	   10	in vec4 vColor;
	   11	in vec2 vTexCoord;
	   12	

[ error ] ofShader: checkProgramLinkStatus(): program failed to link
[ error ] ofShader: ofShader: program reports:
error: linking with uncompiled/unspecialized shadererror: linking with uncompiled/unspecialized shader
[ error ] ofFbo: getDepthTexture(): frame buffer object 1 not allocated with depthStencilAsTexture

If anybody knows what should I do to make it work, would be very cool. :slight_smile:

2 posts - 2 participants

Read full topic

Raspberry Pi (RPi) best practices

$
0
0

Hi All,
I’ve just started a new home project and I’m coming across some compile/running issues when following the instructions for getting started on the (raspberry pi | openFrameworks) page, due partly to the page being a little dated, and me using a RPi Zero W.
Rather than focus on the problem I have at hand which I can probably fix by searching the forum, I thought it might be good to widen out the idea and try and get a discussion going on what are the best practices for getting the best performance out of the hardware…

My thought is that if you have this device RPi-XX, what are the steps to follow to get the best performance?

Things I think it would need to cover should include:

OS: Stretch / Buster / RaspberryPi OS (or other)
oF version: a specific version say 0.10.0 or latest currently 0.11.2
Window system: EGL / GLFW
GL type: GL / GLES
Specific Addons: eg ofxRPI4Window
Changes to oF: eg what to change if the shader examples in the distro are the wrong GL/GLES version

Personally (because I have these to hand :wink: ) I’d like to cover at least these commonly used RPi models: Zero/ZeroW, 3A+, 3B+ and 4B.

Not sure what the final outcome would be, perhaps a Wiki page or feeding directly back to the oF guys with updates to the RPi setup page with model specific guides?

Perhaps this thread is a good starting point, and if people post what they have found to work well covering the 6 topics listed above. I’d be happy to set aside some of my time to test combinations with the hardware I have, and get notes written up, and do some benchmarking.
If there are specific example apps that people think would work well for benchmarks let me know, I think a geometry heavy app and shader example would be an ideal starting point.

1 post - 1 participant

Read full topic


Errors building ofxTextureRecorder example

$
0
0

I’m trying to build the example that comes with the ofxTextureRecorder add on a Raspberry Pi 3 but I get the following errors:
‘GL_DYNAMIC_READ’ was not declared in this scope
‘GL_QUERY_RESULT’ was not declared in this scope
‘GST_QUERY_CAST’ was not declared in this scope
‘GL_READ_ONLY’ was not declared in this scope
‘GL_TIME_ELAPSED’ was not declared in this scope
‘glBeginQuery’ was not declared in this scope
‘glEndQuery’ was not declared in this scope
‘glGenQueries’ was not declared in this scope
‘glGetQueryObjectuiv’ was not declared in this scope
‘ofBufferObject’ had no member named ‘unmap’
‘const class ofTexture’ has no member named ‘copyTo’

The example builds fine on my laptop running Ubuntu Studio 21.04.

I’ve tried to locate the macro and function definitions and on my laptop I found them in /usr/include/GL and GLES. On my Pi these files are in /opt/vc/include but they don’t contain these macros or functions.

What I need is a way to record the output of an app which is a rectangle and some strings, and ofxTextureRecorder seems like one solution. If someone has an alternative or can help with the errors above I’d be grateful.

1 post - 1 participant

Read full topic

Grabbing the screen in a thread?

$
0
0

I’m trying to capture the output of a simple OF program on a Raspberry Pi 3. I’ve looked in here and found a few different approaches, but none seems to work on this hardware, so I tried to grab the screen every time something changes, and later on I would put all the saved images together to a movie file with ffmpeg. Doing this in the main thread stalls the program until an image is saved, making the program not responsive at all (the program receives input from a keyboard and displays the output as strings).
I’m trying to do this with threads, following the third example from ofBook (ofBook - Threads). Here’s my class definition in threadedClass.h (please bear with me, my C++ knowledge is next to nothing):

class ImageSaver: public ofThread {
	public:
		ImageSaver() {
		this->saved = true;
		}

		void save(int width, int height, int ndx) {
			this->width = width;
			this->height = height;
			this->index = ndx;
			this->imgName = ofToString(index) + ".jpg";
			this->saved = false;
			startThread();
		}

		bool saved;

	private:
		void threadedFunction() {
			img.grabScreen(0, 0, width, height);
			img.saveImage(imgName);
			this->saved = true;
		}

		ofImage img;
		string imgName;
		int index;
		int width;
		int height;
};

Here’s how I import it in ofApp.h:

vector<unique_ptr<ImageSaver>> imgSavers;

And here’s how I’m trying to save the output in ofApp.cpp, whenever input is received from the keyboard:

frameCounter++;
if (captureScreen) {
	foundAvailableThread = false;
	for (int i = 0; i < imgSavers.size(); i++) {
		if (imgSavers[i].saved) {
			imgSaves[i].save(width, height, frameCounter);
			foundAvailableThread = true;
			break;
		}
	}
	if (!foundAvailableThread) {
		imgSavers.push_back(move(unique_ptr<ImageSaver>(new ImageSaver)));
	        imgSavers.back()->save(width, height, frameCounter);
	}
	captureScreen = false;
}

The above code is happening in draw() because the keyboard input is received via OSC instead of keyPressed() or keyRelease().

The program compiles and projects the text written with the keyboard fine. It also saves .jpg images with the frame number in bin/data, but they’re all black. I read in the ofBook chapter that all GL operations have to happen in the main thread, because openGL is single-threaded, but I guess there must be a way to do this, since addons like ofxVideoRecorder are threaded (though its code is too complicated for me to understand).

Any help appreciated.

1 post - 1 participant

Read full topic

How to run a HD video in RBPi4 and Debian-buster?

$
0
0

I’ve been testing for days different configurations, searching for a solution of playing HD video with good framerate in Rasberry. I managed to run RBPi 3 +B and ofxOMXPlayer. However, now I would need to resolve it using RBPi 4.
Is it possible to run at 60fps a FullHD short video? ofxOMXPplayer doesn’t run in RBPi 4 that’s confirmed. But there is not another way? like changing the pixel format in the video player?

1 post - 1 participant

Read full topic

64 bit on Raspberry Pi 4?

Playing Video on RPi4

$
0
0

Hi!

I tried upgrading a presentation program based on OpenFrameworks. It was running on a RPi2 projecting images and video with some text on a 1024x768 screen. The idea was to move from this to a RPi4 on a HD television (1920x1080). Unfortunately I can’t get video to work.

The original version used ofxOMXPlayer to display the video which worked well. I changed it to the build in ofVideoPlayer but nothing is shown.

The videos play fine using omxplayer, gstreamer and vlc. But not at all in OpenFrameworks. Is there anything that can be done to play a video and draw some text in front of it on a RPi4 using the latest OpenFrameworks?

Thanks!

Kees-Jan

10 posts - 3 participants

Read full topic

Viewing all 147 articles
Browse latest View live