title: Received exception on GL render thread : android
body: <p>I'm using CAMERA2 API and meanwhile developing an application without any errors the application will run superbly. But after recording some chunks of clips it shows above mentioned error.</p>
  
  <p>This is my approach,</p>
  
  <p>1.Open the camera using <code>cameraManager</code> class and then set video preview into texture field</p>
  
  <ol start="2">
  <li>After we started to record video it will break according to given time and instantly it will start record again and it will continuously create chunks of videos until user stopped the recording</li>
  </ol>
  
  <p>Without any issues, it creates many(around 200-300) camera sessions. But suddenly it occurs below error. I've given some times to set up the camera sessions and release those sessions using <code>Timer</code> class and <code>TimerSchdule</code> class.</p>
  
  <p>I've read <a href="https://stackoverflow.com/questions/30583343/camera-doesnt-work-after-starting-second-activity">this,</a> <a href="https://developer.android.com/reference/android/opengl/GLSurfaceView.html" rel="nofollow noreferrer">and here,</a> and <a href="https://developer.android.com/reference/android/opengl/GLSurfaceView.Renderer.html" rel="nofollow noreferrer">here</a> for extract what are the exactly happens. Thought needs some further help.</p>
  
  <p>What I want to know is</p>
  
  <ol>
  <li><p>What is this error says?</p></li>
  <li><p>generally, why those errors occur in</p></li>
  </ol>
  
  <p><b>EDIT : </b></p>
  
  <p>error --->>>></p>
  
  <pre><code>10-11 12:20:58.966 27862-27988/? E/CameraDeviceGLThread-0: Received exception on GL render thread: 
                                                             java.lang.IllegalStateException: glDrawArrays: GLES20 error: 0x505
                                                                 at android.hardware.camera2.legacy.SurfaceTextureRenderer.checkGlError(SurfaceTextureRenderer.java:537)
                                                                 at android.hardware.camera2.legacy.SurfaceTextureRenderer.drawFrame(SurfaceTextureRenderer.java:346)
                                                                 at android.hardware.camera2.legacy.SurfaceTextureRenderer.drawIntoSurfaces(SurfaceTextureRenderer.java:726)
                                                                 at android.hardware.camera2.legacy.GLThreadManager$1.handleMessage(GLThreadManager.java:105)
  </code></pre>