androidgoogle-cloud-messagingmediarecorderandroid-mediarecordergcmlistenerservice

Errors on Android recording video using server message as trigger


I am trying to make a very simple app that synchronizes stopping/starting recording across several devices.

I am using a mashup of these two tutorials.

Both components work well on their own. However, when I change the record button to instead send a message to the server, and then perform the start/stop recording action when the multicasted message from the server is received, the app starts to crash randomly about 1/4 of the time.

This crash usually occurs with the following lines being outputted repeating infinitely in LogCat. The entire phone will eventually die/restart.

05-19 18:09:36.596: E/Camera3-Device(3781): RequestThread: Can't get output buffer, skipping request: No such device (-19)
05-19 18:09:36.596: E/BufferQueueProducer(3781): [GraphicBufferSource] dequeueBuffer: BufferQueue has been abandoned
05-19 18:09:36.597: E/Camera3-OutputStream(3781): getBufferLocked: Stream 7: Can't dequeue next output buffer: No such device (-19)

Has anyone seen these error logs before and know what the cause could be?

This problem disappears when the record button directly starts/stops recording, without sending/waiting for a server message.


Solution

  • Based from this forum, maybe it was because you're trying to release the back buffer after it had been released due to async issues. You can also look into this issue:

    I think what’s happening here is that when MediaRecorder is reset, it kills the surface while the background thread is still trying to draw captured images onto it. I’m suspecting this based on the EGL error codes 0x300b and 0x300d (EGL_BAD_NATIVE_WINDOW and EGL_BAD_SURFACE, respectively).

    Closing the camera before resetting the recorder and reopening it afterwards works around the issue.

    Check these related so questions: