Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenGL ES 2.0 screen flickering
    primarykey
    data
    text
    <p>I'm facing a big problem. I'm using a Transformer tf101 tab with Android 4.0.3 on it. </p> <p>My app is using a custom OpenGL ES 2.0 surface. I'm rendering multiple planes with textures. this textures are changing approx. 20 times per second and are updated by passing byte arrays. However, in certain cases, the screen begins flickering and does not render the new textures. Additional UI Elements are still responsive and do their work as intended. It seems the OpenGL context ignores all commands and is unresponsive. </p> <p>When this happens, a few lines show up in my logCat: </p> <pre><code>08-20 10:31:15.390: D/NvOsDebugPrintf(2898): NvRmChannelSubmit: NvError_IoctlFailed with error code 1 </code></pre> <p>followed by</p> <pre><code>08-20 10:31:15.390: D/NvOsDebugPrintf(2898): NvRmChannelSubmit failed (err = 13, SyncPointValue = 879005, returning = 0) </code></pre> <p>and a few of them: </p> <pre><code>08-20 10:31:15.390: D/NvOsDebugPrintf(2898): NvRmChannelSubmit failed (err = 196623, SyncPointValue = 0) </code></pre> <p>Here is how i create my Textured Plane:</p> <pre><code> m_nTextureStorage[0] = 0; GLES20.glGenTextures( 1, m_nTextureStorage, 0); GLES20.glActiveTexture( GLES20.GL_TEXTURE0 ); GLES20.glBindTexture( GLES20.GL_TEXTURE_2D, m_nTextureStorage[ 0 ] ); // Set filtering GLES20.glTexParameterf( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST ); GLES20.glTexParameterf( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST ); GLES20.glTexParameteri( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE ); GLES20.glTexParameteri( GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE ); </code></pre> <p>and here is how i draw it:</p> <pre><code>GLES20.glEnable(GLES20.GL_TEXTURE_2D); GLES20.glEnable(GLES20.GL_DEPTH_TEST); GLES20.glActiveTexture( GLES20.GL_TEXTURE0 ); //GLES20.glUniformMatrix4fv(m_HMVPMatrixUniform, 1, false, mvpMatrix, 0); GLES20.glUseProgram( m_nProgramHandle ); ByteBuffer oDataBuf = ByteBuffer.wrap( m_sTexture ); m_HTextureUniform = GLES20.glGetUniformLocation( m_nProgramHandle, "uTexture" ); m_HTextureCoordinate = GLES20.glGetAttribLocation( m_nProgramHandle, "TexCoordinate" ); GLES20.glUniform1iv( m_HTextureUniform, 2, m_nTextureStorage, 0 ); // get handle to the vertex shader's vPosition member m_nPositionHandle = GLES20.glGetAttribLocation( m_nProgramHandle, "vPosition" ); // Prepare the triangle data GLES20.glTexImage2D( GLES20.GL_TEXTURE_2D, 0, GLES20.GL_LUMINANCE, 640, 480, 0, GLES20.GL_LUMINANCE, GLES20.GL_UNSIGNED_BYTE, oDataBuf ); // Prepare the triangle data GLES20.glVertexAttribPointer( m_nPositionHandle, 3, GLES20.GL_FLOAT, false, 12, m_oVertexBuffer ); GLES20.glEnableVertexAttribArray( m_nPositionHandle ); GLES20.glVertexAttribPointer( m_HTextureCoordinate, 2, GLES20.GL_FLOAT, false, 12, m_oTextureBuffer); GLES20.glEnableVertexAttribArray( m_HTextureCoordinate ); m_nMVPMatrixHandle = GLES20.glGetUniformLocation( m_nProgramHandle, "uMVPMatrix"); // Apply the projection and view transformation GLES20.glUniformMatrix4fv( m_nMVPMatrixHandle, 1, false, mvpMatrix, 0); GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 6); </code></pre> <p>The OpenGL Renderer simply calls the draw function of my TexturedPlane by passing the mvpMatrix. Im not deleting any textures since i've read that the android system will take care of that automatically.</p> <p>I think it has something todo with the GPU going OOM, but im not sure since i haven't found anything related to the posted error messages. </p> <p>Thanks it advance!</p> <p>UPDATE:</p> <p>The Rendermode was set to <code>RENDER_WHEN_DIRTY</code> . After Changing it to <code>RENDERMODE_CONTINOUSLY</code> the problem disappears.. Weird. Since this is just a workaround and no solution, I'm still asking for help ;)</p> <p>Leaving the Rendermode at continuously is no option, since this consumes to much processor time and makes no sense, since rendering is only necessary when new textures a generated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload