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

ofFbo on Raspberry

$
0
0

@simonblackmore wrote:

Hi all,

I am just trying to port an app from my mac to a Raspberry 3.

Just discovered that ofFbo doesnt work for me. And I am not sure whether this is because ofFbo doesnt work or how I am using it.

Works fine on my Mac.

Cheers

// I have this function
void ofApp::drawPixel(int x, int y) {
rgbFbo.begin();
ofFill();
ofSetColor(colour_r, colour_g, colour_b, 255);
ofDrawRectangle(signal, sy, x, y);
//ofDrawRectangle(signal, sy, x, y);
rgbFbo.end();
}

And then this in draw.

rgbFbo.draw(0,0);

Posts: 6

Participants: 4

Read full topic


Audio Crackling in Raspberry Pi 3B

$
0
0

@cuinjune wrote:

Hi, I use ofxPd to play sound on RPi and it works but I hear audio crackling time to time. It happens even I increase the audio buffer size.

I would like to ask if there’s a way to improve the audio performance in RPi.

If I call ofSoundStreamListDevices(), it shows the following:

[Unkown API: 0] hw:bcm2835 ALSA, 0 [in:0 out:2]
[Unkown API: 1] hw:bcm2835 ALSA, 0 [in:0 out:8]
[Unkown API: 2] hw:bcm2835 ALSA, 0 [in:0 out:8]
[Unkown API: 3] default [in:32 out:32]

Should I use other driver than ALSA? Any advice would be appreciated!

Posts: 3

Participants: 2

Read full topic

RPi3 + Buster Lite + oF 0.11.0 = can't run example

$
0
0

@mattc wrote:

I’m having a hard time making the OF working with my HW & SW config. Both OF and example compiles without a problem, but I can not run the example.
Here’s my setup from the very beginning:

1. SD card with 2019-09-26-raspbian-buster-lite.img

2. Booting with RPi 3B

3. sudo raspi-config
	Advanced > Expand Filesystem
	Advanced > Memory Split > 256
	Advanced > GL Driver > GL Driver Fake KMS
	Interfacing > SSH > enable

4. reboot

5. sudo nano /boot/config.txt //I'm using small 7-inch HDMI screen
	hdmi_group=2
	hdmi_mode=87
	hdmi_cvt=800 480 60 6 0 0 0
	hdmi_drive=1

6. sudo nano /etc/dhcpcd.conf //settings static IP

7. reboot

8. sudo apt-get clean && sudo apt-get update && sudo apt-get dist-upgrade

9. wget https://openframeworks.cc/versions/v0.11.0/of_v0.11.0_linuxarmv6l_release.tar.gz

10. sudo mkdir openFrameworks && sudo tar vxfz of_v0.11.0_linuxarmv6l_release.tar.gz -C openFrameworks --strip-components 1

11. sudo rm of_v0.11.0_linuxarmv6l_release.tar.gz 

12. cd openFrameworks/scripts/linux/debian

13. sudo ./install_dependencies.sh && sudo ./install_codecs.sh && sudo apt-get clean

14. cd && sudo make Release -C openFrameworks/libs/openFrameworksCompiled/project

15. cd /openFrameworks/examples/3d/quaternionLatLongExample/src/

16. sudo nano main.cpp //making sure to use display resolution and full screen
	ofSetupOpenGL(800,480, OF_FULLSCREEN);

17. cd .. && sudo make && sudo make run

Here’s the output when trying to run example:

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

Since I’m using Lite system and the log shows error related to X11, I also tired adding this

sudo apt-get install xutils

…but with no effect.

Any help would be appreciated!

Posts: 19

Participants: 4

Read full topic

OF slow on RPi4?

$
0
0

@Bencilari wrote:

Hi all!
I’ve downloaded and installed latest OF release (0.11) on my raspberry pi 4 (model b). Everything seems fine, but it seems quite slow… The simple example graphics/poligonExample show ~40FPS. If run full screen, with

ofSetupOpenGL(1024,768, OF_FULLSCREEN);

the FPS it’s only half of this (~20).

It’s ok, or something is wrong?

Posts: 14

Participants: 5

Read full topic

"libbrcmEGL.so: error adding symbols: DSO missing from command line" linker error when trying to use pi camera

$
0
0

@bendylegs wrote:

I get this when trying to compile either my camera depender project or the ofxOMXCamera example-wrapper

Linking bin/example-wrapper for linuxarmv6l
g++ -o bin/example-wrapper obj/linuxarmv6l/Release/src/main.o obj/linuxarmv6l/Release/src/ofApp.o …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/OMXCameraController.o …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/VideoEngine.o …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/RPiVideoGrabber.o …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/PhotoEngine.o …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/VideoRecorder.o …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/ofxOMXPhotoGrabber.o …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/ofxOMXVideoGrabber.o …/…/…/libs/openFrameworksCompiled/lib/linuxarmv6l/libopenFrameworks.a -Wl,-rpath=./libs:./bin/libs -Wl,–as-needed -Wl,–gc-sections -pthread -latomic -L/opt/vc/lib …/…/…/libs/kiss/lib/linuxarmv6l/libkiss.a …/…/…/libs/tess2/lib/linuxarmv6l/libtess2.a -lz -lgstapp-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -ludev -lfontconfig -lfreetype -lsndfile -lopenal -lcurl -lglfw -lrtaudio -lasound -lpulse-simple -lpulse -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lmpg123 -lGLEW -lGLU -lGL -lfreeimage -lboost_filesystem -lboost_system -lpugixml -luriparser -lXinerama -lglfw -lGLESv2 -lGLESv1_CM -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpcre -lrt -lX11 -ldl
/usr/bin/ld: …/…/…/addons/obj/linuxarmv6l/Release/ofxOMXCamera/src/ofxOMXPhotoGrabber.o: undefined reference to symbol ‘eglCreateImageKHR’
/usr/bin/ld: //opt/vc/lib/libbrcmEGL.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** […/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:405: bin/example-wrapper] Error 1
make[1]: Leaving directory ‘/home/pi/of_v20191209/addons/ofxOMXCamera/example-wrapper’
make: *** […/…/…/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:129: Release] Error 2

“undefined reference to symbol ‘eglCreateImageKHR’” seems significant and has cropped up before here OF v20180313 armv6l on Raspberry Pi 3 + ofxPiMapper + ofxKinect

Posts: 3

Participants: 1

Read full topic

Midi controller on raspbian lowers brightness

$
0
0

@andrei_j wrote:

I am working on a project in raspbian stretch on a raspberry pi 3b that uses either a PiCapturesd1 or a usb camera for taking video input and using a usb midi controller via ofxMidi to control an oF + shaders code to alter the video stream. when the oF project starts running it is at full brightness but as soon as i touch or move anything on the midi controller the total brightness range becomes lowered by about 1/2. When i’m running it windowed on the desktop nothing changes about the brightness values anywhere else but in the oF window. I have tried several powered usb hubs for the midi controller and the behavior is the same as if it is plugged directly into the pi. The behavior is also the same whether it is through HDMI or composite output. has anyone noticed anything like this before? I am confused by the fact that the rest of the raspberry pi video output is unchanged and only the oF window, I feel like if it was just a power draw issue then everything on the desktop would be affected? There are no lightning bolts appearing at any point and the power supply for the pi i am using is 5v 2.5a

Posts: 1

Participants: 1

Read full topic

Arm video tearing

$
0
0

@coding wrote:

I had an app with lots of video tearing on raspberry3b+ with raspbian 10, of 11.
Vertical sync enabled, 30 & 60fps. Lots of tearing. Then I sudo raspi-config, disable the video compositor, gl driver full dkms, reboot, and tearing is gone. This is not obvious, thought I’d share. Also, apparently Mesa has some issues with these arm drivers, and sometimes I got a harmless Draw call returned invalid argument. Expect corruption.

Posts: 1

Participants: 1

Read full topic

Slowdown when using TCPServer on Raspberry Pi4 / buster

$
0
0

@Bencilari wrote:

I’m experimenting a strange behavior with TCPserver under RaspberryPi4/buster. When there’s a client connected, the FSP drop from 60 to ~25. When the client disconnect, FPS get back to full rate. Same program tested with linux (ubuntu/fedora) but not on raspberry runs fine.
Here’s some code snippets:

void ofApp::update(){
  checkNetworkMessage(TCPserver);
  ...
}

The function is:

void ofApp::checkNetworkMessage(ofxTCPServer &_TCPServer){
  string msg = "";
  for(int i=0; i < _TCPServer.getLastID(); i++){
      if(_TCPServer.isClientConnected(i)){
          msg = _TCPServer.receive(i);
          if(msg != "") {
              ofLogVerbose() << msg << " received";
              ofSendMessage(msg);
            }
        }
    }
}

Probably a thread to check for network messages should be a preferable solution, but i’m expecting something like one message/minute…
Any hints?

Thanks!

Posts: 1

Participants: 1

Read full topic


Error building 0.11 examples on Raspberry Pi - Patchbox OS (Stretch) - cannot find -lGLESv1_CM

$
0
0

@Miles wrote:

Hi there,

I’m using the Patchbox OS which is a modified stretch distribution and whilst trying to build OpenFrameworks examples I get the error below.

I’m using the Patchbox distribution as it provides loads of assistance with audio that I wasn’t able to sort out with Buster, although on Buster I was able to compile OpenFrameworks projects. I want to stick with Patchbox if possible.

The error states “cannot find -lGLESv1_CM”

Any help and advice would be great. Thanks!!

Linking bin/colorExample for linuxarmv6l
g++ -o bin/colorExample  obj/linuxarmv6l/Release/src/ofApp.o obj/linuxarmv6l/Release/src/main.o   /home/patch/openFrameworks/libs/openFrameworksCompiled/lib/linuxarmv6l/libopenFrameworks.a   -Wl,-rpath=./libs:./bin/libs -Wl,--as-needed -Wl,--gc-sections -pthread -latomic -L/opt/vc/lib /home/patch/openFrameworks/libs/kiss/lib/linuxarmv6l/libkiss.a /home/patch/openFrameworks/libs/tess2/lib/linuxarmv6l/libtess2.a   -lz -lgstapp-1.0 -lgstvideo-1.0 -lgstbase-1.0 -lgstreamer-1.0 -ludev -lfontconfig -lfreetype -lsndfile -lopenal -lcurl -lglfw -lrtaudio -lasound -lpulse-simple -lpulse -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lGLEW -lGLU -lGL -lfreeimage -lboost_filesystem -lboost_system -lpugixml -luriparser -lXinerama -lglfw -lGLESv2 -lGLESv1_CM -lEGL -lopenmaxil -lbcm_host -lvcos -lvchiq_arm -lpcre -lrt -lX11 -ldl
/usr/bin/ld: cannot find -lGLESv1_CM
collect2: error: ld returned 1 exit status

Posts: 2

Participants: 1

Read full topic

Routing audio into an ofxPd application on raspberry pi

$
0
0

@Miles wrote:

Heyo!

I’ve got my ofxPd applications running on raspberry pi, now I’m trying to route audio from other applications into an ofxPd application.

I have Patchage installed, but my application won’t show up in there, so when my application attempts to load I get an RtApiALSA error. Am I barking up the right tree here, or should I be using another approach?

Many thanks!

Posts: 1

Participants: 1

Read full topic

Of 0.11 -not working on pi!

$
0
0

@steeley wrote:

running on a pi3 b+ with Buster lite fresh install - I have used previous OFs with lite versions and all is ok.
OF seems to compile ok, and I’ve followed the usual instructions but cannot get any window!
I’ve followed instructions to go back to old type of window as I assumed that was the issue…
compiling the polygonExample I just get:
[notice ] ofAppEGLWindow: display(): eglSwapBuffers failed: or could not be initialised.

How can I get this working? can’t go back to old versions /old OS.

TIA

Posts: 3

Participants: 2

Read full topic

Trying to understand the RPI4/Buster situation in OF 11

$
0
0

@jvcleave wrote:

First issue, from
https://openframeworks.cc/setup/raspberrypi/raspberry-pi-getting-started/


    Select 7 Advanced Options and hit Enter
        Select GL Driver and hit Enter
        Select either GL Driver Fake KMS or GL Driver Full KMS or from the options and hit Enter

I believe this conflicts with the previous paragraph


    Select 3 Boot Options
    Select B1 Console or B2 Console Autologin

The above advice will result in

pi@RPI4:~/OF_11/openFrameworks/apps/myApps/emptyExample/bin $ ./emptyExample 
[ error ] ofAppGLFWWindow: 65544: X11: Failed to open display :0
[ error ] ofAppGLFWWindow: couldn't init GLFW
[ error ] ofAppGLFWWindow: 65537: The GLFW library is not initialized
[notice ] 
emptyExample: /build/glfw3-UExs5r/glfw3-3.2.1/src/window.c:412: glfwWindowShouldClose: Assertion `window != NULL' failed.
[verbose] ofSignalHandler: Aborted
emptyExample: /build/glfw3-UExs5r/glfw3-3.2.1/src/window.c:421: glfwSetWindowShouldClose: Assertion `window != NULL' failed.
Aborted

Main issue/Question

Should ofGetEGLDisplay/ofGetEGLContext work with the below?

I have things setup as

Driver: GL (Fake KMS) OpenGL desktop driver with fake KMS
Boot Options: Desktop AutoLogin

Single file sample code:

#include "ofMain.h"


class ofApp : public ofBaseApp{
	public:
		void setup()
		{
			ofLog() << glGetString(GL_VERSION);
		}

		void update() { }
		
		bool hasProbed = false;
		
		void draw()
		{
		
			if (!hasProbed)
			{
				bool hasDisplay = false;
				bool hasContext = false;
				ofAppGLFWWindow* winptr = static_cast<ofAppGLFWWindow*>(ofGetWindowPtr());
				GLFWwindow* glfwWindow = winptr->getGLFWWindow();
				EGLContext eglDisplay = ofGetEGLDisplay();


				if (eglDisplay == EGL_NO_DISPLAY)
				{
					ofLog() << "EGL_NO_DISPLAY";
				}else
				{
					hasDisplay = true;
				}

				EGLContext eglContext = ofGetEGLContext();
				if (eglContext == EGL_NO_CONTEXT)
				{
					ofLog() << "EGL_NO_CONTEXT";
				}else
				{
					hasContext = true;
				}	
				hasProbed = true;
				ofLog() << "hasDisplay: " << hasDisplay;
				ofLog() << "hasContext: " << hasContext;
				
				auto x11Window = ofGetWindowPtr()->getX11Window();
				if(x11Window)
				{
					ofLog() << "HAS X11 WINDOW";
				}
			}
			
		}
};

int main( )
{

	bool isTARGET_OPENGLES = false;
	bool isTARGET_LINUX = false;
	
	#if defined(TARGET_OPENGLES)
		isTARGET_OPENGLES = true;
	#endif
	
	
	#if defined(TARGET_LINUX)
		isTARGET_LINUX = true;
	#endif
	
	ofSetLogLevel(OF_LOG_VERBOSE);
	
	ofLog() << "isTARGET_OPENGLES: " << isTARGET_OPENGLES;
	ofLog() << "isTARGET_LINUX: " << isTARGET_LINUX;
#if 1
    ofGLESWindowSettings settings;
	settings.setSize(1280, 720);
    settings.setGLESVersion(2);
    ofCreateWindow(settings);
    ofRunApp( new ofApp());
#else
	ofSetupOpenGL(1280, 720, OF_WINDOW);
	ofRunApp( new ofApp());	
#endif
}

Using the default ofSetupOpenGL path I get a blank X11 window and the following

[notice ] isTARGET_OPENGLES: 1
[notice ] isTARGET_LINUX: 1
[verbose] GL Version:OpenGL ES-CM 1.1 Mesa 19.2.0-rc1
[notice ] OpenGL ES-CM 1.1 Mesa 19.2.0-rc1
[notice ] EGL_NO_DISPLAY
[notice ] EGL_NO_CONTEXT
[notice ] hasDisplay: 0
[notice ] hasContext: 0

If I switch to using ofGLESWindowSettings I get

[notice ] isTARGET_OPENGLES: 1
[notice ] isTARGET_LINUX: 1
[verbose] GL Version:OpenGL ES 3.0 Mesa 19.2.0-rc1
[verbose] ofShader: checkAndCreateProgram(): creating GLSL program
[verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled
[verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled
[verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to program 1
[verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 1
[verbose] ofShader: checkProgramLinkStatus(): program 1 linked
[notice ] OpenGL ES 3.0 Mesa 19.2.0-rc1
[notice ] EGL_NO_DISPLAY
[notice ] EGL_NO_CONTEXT
[notice ] hasDisplay: 0
[notice ] hasContext: 0

Posts: 6

Participants: 2

Read full topic

Having an issue on raspberry Pi with painting program

$
0
0

@wednesdayayay wrote:

so I’ve been trying to get a larger painting program working on the raspberry Pi and I was using a different method in the past (FBO) but at the time that wasn’t working like I wanted it to regarding coloring so I switched to this method using setbackgroundauto

this program works perfectly on my computer (mac 10.14.6)

but seems to not work like I want it to regarding painting onto the screen
so I boiled it down to its simplest form in order to post on here

again when I run this on my computer it works as I would expect a circle gets painted onto the screen when I pressed the mouse left button
and when I press the right button it clears that painting

//--------------------------------------------------------------

**void** ofApp::setup(){

ofSetBackgroundAuto( **false** );

ofBackground(25,100,0);

}

//--------------------------------------------------------------

void ofApp::draw(){
 if (ofGetMousePressed(OF_MOUSE_BUTTON_RIGHT))
     {
         ofBackground(25, 100, 0);
     }
     
     if (ofGetMousePressed(OF_MOUSE_BUTTON_LEFT))
         {
             ofDrawCircle (mouseX,
                           mouseY,
                           35);
         }
      }

when I run this on my RPI instead of drawing onto the screen when I press the mouse button it shows a black background

any help would be greatly appreciated
while the larger drawing program partially works on the Pi getting the painting aspect working is pretty key

Posts: 3

Participants: 1

Read full topic

ofxTCPServer slow on raspberry pi 3

$
0
0

@bendylegs wrote:

As soon as I put the below in to either my update or draw loop my frame rate halves. I can send and receive fine on the client end but the pi that acts as the server experiences a drastic slow down in framerate. Top indicates low cpu use so I’m stumped…


if( !initialised ) return;
	//cout << "tcp draw called" << endl;
	for ( int i = 0; i < TCPServer.getLastID(); i++ ) {
		if(TCPServer.isClientConnected(i)) {

    		std::string str = TCPServer.receive(i); // will end with delimiter, so make sure client is sending it
    		if( str.length() > 0 ){
    			ofLog(OF_LOG_NOTICE) << "received  " << str << " on TCPServer from " << i;

				auto payload = ofJson::parse(str);

				DataPacket packet;

				packet.numbersInt.push_back( payload["screen"] );
				packet.numbersFloat.push_back( payload["x"] );
				packet.numbersFloat.push_back( payload["y"] );
				packet.numbersFloat.push_back( payload["vx"] );
				packet.numbersFloat.push_back( payload["vy"] );

				ofNotifyEvent( newDataEvent, packet, this );
    		} else {
    			ofLog(OF_LOG_NOTICE) << "!! received empty?? " << str << " on TCPServer from " << i;
    		}

The slow down isn’t immediate but occurs in the first few seconds then stays.

I get a lot of empty strings received which I guess just indicates the connection is still open? I’d assumed I should leave it open as I send things fairly regularly.

Context I’m sending a load of boids between screens and using OSC/UDP too many packets went missing over time and I was loosing birds.

Posts: 1

Participants: 1

Read full topic

Video alpha mask painting outside of shape issue

$
0
0

@wednesdayayay wrote:

@arturo any help would be greatly appreciated!

so I’m getting some mixed results with a program I’m trying to write where a shape is used as an alpha mask for incoming video via webcam that then gets painted onto the screen through a second FBO that will ultimately run as a standalone on the raspberry Pi (3b,3b+)

I’m doing my main programming on my macbook and then transferring over the files to run on the RPI

in the main.cpp in wanting to run at SD as I will be outputting via the composite output

 ofSetupOpenGL( 640,480, OF_FULLSCREEN);

ofapp.cpp

#include "ofApp.h"

//--------------------------------------------------------------
void ofApp::setup(){
    
   
    
    
    
    vidGrabber.setDeviceID(0);
    vidGrabber.setDesiredFrameRate(30);
    
    ofSetVerticalSync(true);
    
    
    ofBackground(0,0,0);
    
    vidGrabber.initGrabber(ofGetWidth(), ofGetHeight());
    paint.allocate(ofGetWidth(), ofGetHeight());
    fbo.allocate(ofGetWidth(), ofGetHeight());
    vidGrabber.getTexture().setAlphaMask(fbo.getTexture());
    
    
    paint.begin();
    ofClear(255);
    paint.end();
    
    
    ofSetCircleResolution(100);
    
    
   
}

//--------------------------------------------------------------
void ofApp::update(){
    
    
    vidGrabber.update();
    if(ofGetMousePressed(OF_MOUSE_BUTTON_RIGHT))
    {
        paint.begin();
        ofClear(255);
        paint.end();
    }
    
}

//--------------------------------------------------------------
void ofApp::draw(){
    
    
    fbo.begin();
    ofClear(0,0,0,0);
    ofSetColor(255,255);
    ofDrawCircle(mouseX, mouseY, 55);
    fbo.end();
    
    
    
    paint.begin();
    vidGrabber.draw(0, 0);
    paint.end();
    
    
    paint.draw(0,0);
}


these are declared in .h

    ofFbo fbo;
    ofFbo paint;
    ofVideoGrabber vidGrabber;

so in this picture you can see when I’m running at fullscreen
the bottom right corner is not set all the way to the edge of the screen in both the X and Y directions

however if I change


    vidGrabber.draw(0, 0);

to


    vidGrabber.draw(0, 0,ofGetScreenWidth(),ofGetScreenHeight());


I get this result
the camera image now fills the screen
but there are artifacts at the edge of the shape that show through to the background

in addition the mouse now acts strangely as when in the top left corner the circle is centered on the mouse cursor but in the bottom right corner it is no longer in alignment. I think this has to do with the ofgetW&H being set by the 640,480 in the main.cpp but then getting stretched in the final paint.draw to the screen W&H. I’m less worried about the mouse (although it is a bit annoying)

the first image has the look I want as you don’t see the edges of the shapes but the second allows for actual full screen (all of this has been when using mac so far)

now when I load this onto the raspberry Pi
it gives me the same edge artifacts that I’m getting in the second picture no matter what I change
and when in full screen it only shows black with the mouse cursor unless

vidGrabber.initGrabber(ofGetWidth(), ofGetHeight());

is changed to

vidGrabber.initGrabber(640,480);

I’m testing on a projector right now with the RPI and I believe it is not actually filling the screen too
I’m feeling kind of stuck here
I feel like there is a solution to instead of paint.draw add a third FBO to mix paint and the original image in some way I tried that on the computer with ofblendmode ADD and got feedback that turned the screen white eventually

something like if you comment out the paint.draw(); gives a neat effects but is not what I’m looking for I’m sure I’m just not familiar enough with all this to understand what I’m doing wrong


    bucket.begin();
    
    vidGrabber.draw(0,0,ofGetScreenWidth(),ofGetScreenHeight());
    
    ofEnableBlendMode(OF_BLENDMODE_ADD);
    
    //paint.draw(0, 0,ofGetScreenWidth(),ofGetScreenHeight());
    paint.draw(0, 0,ofGetScreenWidth(),ofGetScreenHeight());
    ofDisableBlendMode();
    bucket.end();
    bucket.draw(0,0);

help on any front would be greatly appreciated again I really just want a full screen version of what is happening in the first picture nice clean edges

Posts: 1

Participants: 1

Read full topic


Boost errors when compiling OF 0.11 on RPi 3 B V1.2

$
0
0

@batchku wrote:

I’m following the Getting Started instructions to build OF 0.11 on a Raspberry Pi 3 B (v1.2) and am running into many Boost related errors during compilation. Anyone know the cause?

 BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
 ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: error: expected ‘>’ before numeric constant
 BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
 ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: error: expected unqualified-id before ‘)’ token
 BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
 ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/boost/mpl/aux_/na_spec.hpp:27,
                 from /usr/include/boost/mpl/or.hpp:24,
                 from /usr/include/boost/iterator/interoperable.hpp:11,
                 from /usr/include/boost/iterator/iterator_facade.hpp:11,
                 from /usr/include/boost/filesystem/path.hpp:28,
                 from /usr/include/boost/filesystem.hpp:16,
                 from /home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworks/utils/ofFileUtils.h:20,
                 from /home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworks/utils/ofLog.h:4,
                 from /home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworks/utils/ofThread.cpp:2:
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: error: ‘BOOST_MPL_PP_AUX_ENUM_FUNC’ was not declared in this scope
 BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
 ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: error: ‘BOOST_PP_REPEAT’ was not declared in this scope
 BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
 ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: note: suggested alternative: ‘BOOST_PP_EAT’
In file included from /usr/include/boost/mpl/or.hpp:24,
                 from /usr/include/boost/iterator/interoperable.hpp:11,
                 from /usr/include/boost/iterator/iterator_facade.hpp:11,
                 from /usr/include/boost/filesystem/path.hpp:28,
                 from /usr/include/boost/filesystem.hpp:16,
                 from /home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworks/utils/ofFileUtils.h:20,
                 from /home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworks/utils/ofLog.h:4,
                 from /home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworks/utils/ofThread.cpp:2:
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: error: template argument 1 is invalid
 BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
 ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: error: template argument 3 is invalid
/usr/include/boost/mpl/aux_/preprocessed/gcc/full_lambda.hpp:555:1: error: template argument 1 is invalid
 BOOST_MPL_AUX_NA_SPEC2(2, 3, lambda)
 ^~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [makefileCommon/compile.core.mk:240: /home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworksCompiled/lib/linuxarmv6l/obj/Release/libs/openFrameworks/utils/ofThread.o] Error 1
make: *** [makefileCommon/compile.core.mk:204: Release] Error 2
make: Leaving directory '/home/pi/of_v0.11.0_linuxarmv6l_release/libs/openFrameworksCompiled/project'

Posts: 4

Participants: 2

Read full topic

ofAppNoWindow keypressed

$
0
0

@RobbertGroenendijk wrote:

I’m running OF on a Raspberry Pi 4 (Raspbian Lite) that is used to control LED matrixes. Therefore I’d like to run in headless mode with ofAppNoWindow. But for debugging it would be nice if I could still detect keypresses so I can shut down the application. So far I’ve had no luck getting the key detection to work, even though it seems like it should work as I find use cases on github. Any pointers on how to go about this?

#include "ofMain.h"
#include "ofApp.h"
#include "ofAppNoWindow.h" 

//========================================================================
int main( ){
    ofAppNoWindow window;  
    ofSetupOpenGL(&window,1024,768,OF_WINDOW);  

    ofRunApp(new ofApp());  
}

Trying to use the basic void ofApp:keyPressed(int key) function for detection at the moment.

Posts: 1

Participants: 1

Read full topic

Random segmentation fault on threaded HTTP requests with Raspberry Pi 4

$
0
0

@angelo wrote:

Hello!
The scope of this section of the app is to test if there’s an internet connection available by sending an HTTP_HEAD request to a public DNS. After some time (minutes, hours even days) a SIGSEGV appears and the app crashes. When doing gdb debugging, backtrace always displays the following output:

Thread 1 "project-counter_" received signal SIGSEGV, Segmentation fault.
0xb5e1db48 in ?? () from /usr/lib/arm-linux-gnueabihf/libopencv_core.so.3.2
(gdb) bt
Python Exception <class 'gdb.MemoryError'> Cannot access memory at address 0x42ff3ffc: 
#0  0xb5e1db48 in ?? () from /usr/lib/arm-linux-gnueabihf/libopencv_core.so.3.2
Cannot access memory at address 0x42ff3ffc

The class inherits ofThread and it’s set to sleep for 20 seconds.

Class header

class ConnectionHandler : public ofThread
{
public:
	ConnectionHandler();

	void setup(ConfigurationManager *config);
	void threadedFunction();
	bool pingServer(string scheme, string ip);
	bool isConnected();

private:
	ConfigurationManager	*config;
	std::map<std::string, std::string> headers;
	ofxHTTP::ClientSessionSettings sessionSettings;
	bool connected;
	long sleepTime;
};

ConnectionHandler.cpp

#include "ConnectionHandler.h"

ConnectionHandler::ConnectionHandler()
{

}
//--------------------------------------------------------------------------
void ConnectionHandler::setup(ConfigurationManager *config) 
{
	startThread(false);
	setThreadName("ConnectionHandlerThread");
	this->config = config;
	sleepTime = config->systemConfig.getCheckConnectionTime() * 1000;
	sessionSettings.setKeepAliveTimeout(Poco::Timespan::SECONDS * 10);
}
//--------------------------------------------------------------------------
bool ConnectionHandler::isConnected() 
{
	//Poco::ScopedLock<ofMutex> lock(mutex);

	bool _connected = false;
	if (isThreadRunning()) lock();
	_connected = connected;
	if (isThreadRunning()) unlock();

	return _connected;
}
//--------------------------------------------------------------------------
void ConnectionHandler::threadedFunction()
{
	while (isThreadRunning())
	{
		ofLogNotice("ConnectionHandler::threadedFunction")
			<< "I will try to have a response from the outside world.";

		// Try ping and check response
		pingServer("https://", config->serverConfig.pbDNSServer);

		ofLogNotice("ConnectionHandler::threadedFunction")
			<< "Ping " << config->serverConfig.pbDNSServer
			<< " result " << std::boolalpha << connected;

		sleep(sleepTime);
	}
}
//--------------------------------------------------------------------------
bool ConnectionHandler::pingServer(string scheme, string ip)
{
	auto startT = chrono::steady_clock::now();
	// Create the URI with the url
	string url = scheme; // Using a secure scheme
	url.append(ip); // Append server address
	Poco::URI uri(url);

	std::string path(uri.getPathAndQuery());
	if (path.empty()) path = "/";

	HTTPRequest request(HTTPRequest::HTTP_HEAD, path, HTTPMessage::HTTP_1_1);
	
	bool success = false;
	try // Do the ping!
	{
		//HTTPResponse response;
		//HTTPSClientSession *httpsSession = new HTTPSClientSession(uri.getHost(),
		//														  uri.getPort());
		//httpsSession->setTimeout(Poco::Timespan(20, 0));
		//httpsSession->sendRequest(request);
		//std::istream *stream = &httpsSession->receiveResponse(response);
		
		HTTPSClientSession session(uri.getHost(), uri.getPort());
		session.setTimeout(Poco::Timespan(10, 0));
		session.sendRequest(request);
		HTTPResponse response;
		std::istream &is = session.receiveResponse(response);

		// For any status
		ofLogNotice("ConnectionHandler::pingServer")
			<< "Response from server: " << response.getStatus()
			<< " " << response.getReason();
		
		success = true;
	}
	catch (const Poco::Exception& exc) {
		ofLogError("pingServer::sendRequest")
			<< "Poco Network Exception: " << exc.displayText() << endl
			<< "\tHost URL = " << uri.getScheme() << uri.getHost() << ":" << uri.getPort();
	}
	catch (const std::exception& exc) {
		ofLogError("pingServer::sendRequest") << exc.what();
	}

	auto endT = chrono::steady_clock::now();
	long t = chrono::duration_cast<chrono::milliseconds>(endT - startT).count();
	ofLogNotice("ConnectionHandler::pingServer")
		<< "Time elapsed " << t << "ms";

	lock();
	connected = success;
	unlock();

	return success;
}
//--------------------------------------------------------------------------

Another approach was to use ofxTaskQueue with Poco::Task and sending notifications to the queue. After hours of testing, the same segmentation fault appeared.

Here is the task code:

void CheckConnectionTask::runTask()
{
	if (isCancelled())
	{
		return;
	}

	// Try ping and check response
	pingServer("https://", config->serverConfig.pbDNSServer);

	postNotification(new Poco::TaskCustomNotification<HTTPResponseInfo>(this, checkInfo));

	ofLogNotice("CheckConnectionTask::runTask")
		<< "Ping " << config->serverConfig.pbDNSServer
		<< " result " << std::boolalpha << checkInfo.success;
}

Tested both codes on a Raspberry Pi 4 Model B (2GB RAM) and Raspberry Pi 3 Model B (1GB RAM) for the first implementation.
Using the latest version of_v0.11.0_linuxarmv6l_release

Any help would be most appreciated. Thanks!

Posts: 1

Participants: 1

Read full topic

ofShader on ofAppNoWindow - Raspberry Pi Buster Lite

$
0
0

@RobbertGroenendijk wrote:

I’m running OpenFrameworks on a Raspberry Pi 4 with ofAppNoWindow (Running Buster lite) and notice that fading in the ± 50k pixels of my LED matrix is ripping it all apart :wink: After the initial fade-in setup the code runs smoothly as it doesn’t need to fade in that many at a time. Now I was thinking, maybe I can do these fading-operations in a shader, though I don’t actually need the visuals, would just be nice to do the computation on the GPU over some textures.

So the real question;
Is it possible to run OpenFrameworks with ofAppNoWindow on a Raspberry Pi 4 (4GB) with Buster Lite as OS, and still use shaders?

Maybe someone has tried something similar before, or can point me based on the explanation. Cheers!

Posts: 1

Participants: 1

Read full topic

Segmentation fault with Astra SDK on Raspberry Pi 4

$
0
0

@angelo wrote:

While trying to open the device (Astra Pro) with a Raspberry Pi 4 Model B and the Astra SDK and using the modified addon of ofxOrbbecAstra (updated API and added includes)

The lib appears to throw SIGSEV:

Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bin/astra_debug...done.
(gdb) run
Starting program: /home/pi/Desktop/of_v0.11.0_linuxarmv6l_release/apps/myApps/astra/bin/astra_debug 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[notice ] entry point: 

Program received signal SIGSEGV, Segmentation fault.
0xb6fa7d00 in astra_streamset_open () from ./bin/libs/libastra_core_api.so
(gdb) bt
#0  0xb6fa7d00 in astra_streamset_open () at ./bin/libs/libastra_core_api.so
#1  0x000231c4 in astra::StreamSet::StreamSetRef::connect() (this=0x42351c)
    at /home/pi/Desktop/of_v0.11.0_linuxarmv6l_release/addons/ofxOrbbecAstra/libs/astra/include/astra_core/StreamSet.hpp:96
#2  0x00022ff0 in astra::StreamSet::StreamSet(char const*) (this=0x41a924, uri=0x25519c "device/default")
    at /home/pi/Desktop/of_v0.11.0_linuxarmv6l_release/addons/ofxOrbbecAstra/libs/astra/include/astra_core/StreamSet.hpp:45
#3  0x00022f70 in astra::StreamSet::StreamSet() (this=0x41a924)
    at /home/pi/Desktop/of_v0.11.0_linuxarmv6l_release/addons/ofxOrbbecAstra/libs/astra/include/astra_core/StreamSet.hpp:39
#4  0x000201e8 in ofxOrbbecAstra::ofxOrbbecAstra() (this=0x41a920)
    at /home/pi/Desktop/of_v0.11.0_linuxarmv6l_release/addons/ofxOrbbecAstra/src/ofxOrbbecAstra.cpp:11
#5  0x0001f910 in ofApp::ofApp() (this=0x41a910) at /home/pi/Desktop/of_v0.11.0_linuxarmv6l_release/apps/myApps/astra/src/ofApp.h:14
#6  0x0001f624 in main() () at /home/pi/Desktop/of_v0.11.0_linuxarmv6l_release/apps/myApps/astra/src/main.cpp:12
(gdb)

I’m using the latest AstraSDK-v2.1.0, Linux-arm on Raspberry Pi Model 4 (2GB RAM).

Has anyone encountered the same error?

Posts: 1

Participants: 1

Read full topic

Viewing all 147 articles
Browse latest View live