Opengl error with fbo

Hi,
I’m getting this error each time I use fbo on Android

“W/GLConsumer: [unnamed-31567-0] bindTextureImage: clearing GL error: 0x502”

fbo.allocate(600, 400, GL_RGB);

void ofApp::draw(){
    fbo.begin();
    ofClear(0, 0, 0);
    fbo.end();
    fbo.draw();
}

Any clues why ?

not exactly the code that give me error…
I got errors when I’m using video player and video at the same time
Here is a code that generates errors

ofVideoPlayer player;
ofFbo fbo;

//--------------------------------------------------------------
void ofApp::setup(){
	player.load("hands.mp4");
    player.play();
	fbo.allocate(600, 400, GL_RGB);
}

//--------------------------------------------------------------
void ofApp::update(){
	player.update();
}

//--------------------------------------------------------------
void ofApp::draw(){
	fbo.begin();
	ofClear(125,0,0);
	fbo.end();
}

If I remove “player.play()” call, I don’t have any errors.
Or if I remove fbo.begin() and fbo.end(), I don’t have any errors either

Is it possible there is something incompatible between fbo and video player on Android ??

This is the error I get in loop

from a quick google it seems that error comes from not using the type of texture the video player uses internally, GL_TEXTURE_EXTERNAL_OES instead of GL_TEXTURE_2D.

not sure what relation that has with the fbo. probably something is staying bound when it shouldn’t and the video player is somehow trying to use the fbo texture instead of it’s own or the other way around. but not sure where’s the problem exactly

i’d check that everything is being unbound after being used, probably in the android videoplayer

I’m having troubles using FBOs only (no video player)

ofFbo fbo;

//--------------------------------------------------------------
void ofApp::setup(){
    fbo.allocate(600, 400);
}

//--------------------------------------------------------------
void ofApp::draw(){
	fbo.begin();
	ofClear(125,0,0);
	ofSetColor(0,255,0);
	ofFill();
	ofDrawRectangle(10, 10, 100, 100);
	fbo.end();
}

This shouldn’t draw anything because I don’t call fbo.draw
But I get a red screen with a green square at the bottom (y coord is inverted)

Is this a bug for every one or just for my config ?

Is there a stupid mistake i’m doing with fbo ?
I don’t understand why i get this result …
But I doubt there is a bug with such basic use of fbo

I’m using OF 0.9.3 and Android studio 1.5

no, sounds like a bug, i’ll try to take a look when i have a moment, could you try if it also happens with the nightly builds?

Hi !
I’ve tried with latest of_v20160701_android_nightly.tar.gz and I get same bug with code above
Thanks

I just put a new issue on github

I have a similar issue, but just to be sure, is your test device an Samsung device?
(it does not happen on Nexus 7 2013, for instance)

I have a Huawei honor device.
I don’t have another one for testing

@tessela do you mean that the bug above does not occur on Nexus 7 2013 ?

github issue is here : https://github.com/openframeworks/openFrameworks/issues/5183

I’ve tried other devices with help of TestObject website:

  • I get same bug with Samsung Nexus 10
  • but apparently no bug with LG Nexus 5x and LG Nexus 4 !

Yeah, it does not happen on Nexus 7 2013.

I’m not sure to be able to fix FBO on Android, but I’m going to have a look
Probably a weird bug if it’s working with some devices and not working with others
Any other advices @arturo ?

do you see any error when creating the fbo? one thing that might be happening is that the default settings for the fbo doesn’t work on certain platforms. if that’s the case the fbo wouldn’t be created and when you call bind you are binding an invaild fbo so it’s drawing to the screen directly. try to change the default settings to see if it makes any difference

Hi,

being frustrated by missing fbo on Android (presently a samsung galaxy TabA 2016, but other devices failed too), I spent a while testing things and I have some news about this (and a dirty hack), please see on the github issue.