FireWire audio interface extends glfwSwapBuffers runtime

I use openframework to create this application, if I connect the FireWire echo audiofire 2 interface, then the time it takes for glfwSwapBuffers changes from 200 to 12000 microseconds to a fairly consistent 30000, which destroys the target 60 frames per second.

I tried to comment on all processed objects and did not call without sound if the problem was in another place. The problem is not only the slow frame rate, sometimes I get very poor flicker, covering the bottom half of the screen (not only in the application, but also in the screen itself).

I am using Mac OSX 10

Openframeworks uses openGL, here is a function that calls glfwSwapBuffers.

//------------------------------------------------------------ void ofAppGLFWWindow::display(void){ ofPtr<ofGLProgrammableRenderer> renderer = ofGetGLProgrammableRenderer(); if(renderer){ renderer->startRender(); } // set viewport, clear the screen ofViewport(); // used to be glViewport( 0, 0, width, height ); float * bgPtr = ofBgColorPtr(); bool bClearAuto = ofbClearBg(); // to do non auto clear on PC for now - we do something like "single" buffering -- // it not that pretty but it work for the most part #ifdef TARGET_WIN32 if (bClearAuto == false){ glDrawBuffer (GL_FRONT); } #endif if ( bClearAuto == true ){ ofClear(bgPtr[0]*255,bgPtr[1]*255,bgPtr[2]*255, bgPtr[3]*255); } if( bEnableSetupScreen )ofSetupScreen(); ofNotifyDraw(); #ifdef TARGET_WIN32 if (bClearAuto == false){ // on a PC resizing a window with this method of accumulation (essentially single buffering) // is BAD, so we clear on resize events. if (nFramesSinceWindowResized < 3){ ofClear(bgPtr[0]*255,bgPtr[1]*255,bgPtr[2]*255, bgPtr[3]*255); } else { if ( (ofGetFrameNum() < 3 || nFramesSinceWindowResized < 3) && bDoubleBuffered) glfwSwapBuffers(windowP); else glFlush(); } } else { if(bDoubleBuffered){ glfwSwapBuffers(windowP); } else { glFlush(); } } #else if (bClearAuto == false) { // in accum mode resizing a window is BAD, so we clear on resize events. if (nFramesSinceWindowResized < 3){ ofClear(bgPtr[0]*255,bgPtr[1]*255,bgPtr[2]*255, bgPtr[3]*255); } } if(bDoubleBuffered) { unsigned long long timeStartDisplay = ofGetElapsedTimeMicros(); glfwSwapBuffers(windowP); unsigned long long timeEndDisplay = ofGetElapsedTimeMicros(); printf("displayTimeAppWindow %llu \n", (timeEndDisplay - timeStartDisplay)); } else { glFlush(); } #endif if(renderer){ renderer->finishRender(); } nFramesSinceWindowResized++; glfwPollEvents(); } 
+4
source share

All Articles