CameraPanel crash on Samsung Trend Plus

Hi All,

CameraPanel (https://github.com/bolav/fuse-camerapanel) project crashes on (at least) Samsung Trend Plus device.
We extracted the camera stream feature (from CameraPanel project) from our complete app to verify it was this feature causing the crash. It was. It works on other devices / brands such as Huawei P9, OnePlus or Oppo R9.
The crash occurs once the app launches (we never get to see the first frame rendered).
Fuse version 0.32.
Using the latest version of CameraPanel project (Dec 2016).
Here is the logcat:

E/GLConsumer( 3449): [unnamed-3449-2] checkAndUpdateEglState: invalid current EGLContext
E/AndroidRuntime( 3449): FATAL EXCEPTION: main
E/AndroidRuntime( 3449): Process: com.apps.test, PID: 3449
E/AndroidRuntime( 3449): java.lang.IllegalStateException: Unable to update texture contents (see logcat for details)
E/AndroidRuntime( 3449):        at android.graphics.SurfaceTexture.nativeUpdateTexImage(Native Method)
E/AndroidRuntime( 3449):        at android.graphics.SurfaceTexture.updateTexImage(SurfaceTexture.java:169)
E/AndroidRuntime( 3449):        at com.foreign.Camera$2.onFrameAvailable(Camera.java:316)
E/AndroidRuntime( 3449):        at android.graphics.SurfaceTexture$EventHandler.handleMessage(SurfaceTexture.java:296)
E/AndroidRuntime( 3449):        at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime( 3449):        at android.os.Looper.loop(Looper.java:146)
E/AndroidRuntime( 3449):        at android.app.ActivityThread.main(ActivityThread.java:5692)
E/AndroidRuntime( 3449):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 3449):        at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 3449):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
E/AndroidRuntime( 3449):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
E/AndroidRuntime( 3449):        at dalvik.system.NativeStart.main(Native Method)

Thanks in advance for your support,

Thanks for reporting this!
Which Android version are you running on the Trend Plus?

Considering that CameraPanel calls the crashing method, I think you should report this issue to the respective community-project.

So, just to fill in some more details: I notice that the code calls GLHelper::MakeWorkerThreadContextCurrent(). However, the GL-context this makes current is the one that is designated to fuselibs GraphicsWorker-thread. And since a GL-context can only be bound to one thread at the time, this is an error.

However, if nothing in the app using this module cause the GraphicsWorker to be started (it’s started lazily), then this code would appear to work (even though it’s flawed).

So yeah, I think someone would need to fix fuse-camerapanel.

Another detail worth noting is that fuse-camerapanel’s README says “Currently supports iOS”. I’m not sure if this means that the Android-support is not considered production quality, or the README simply hasn’t been updated.

Hi!

Please try the fix for this issue https://github.com/bolav/fuse-camerapanel/pull/14

Hi All and thanks a lot for your replies and help,

Remi, my colleague is running Android 4.4 on his Trend Plus.
He will test Vegard’s fix during the day.

Vegard, I tested the following (on my Oppo R9 where the preview works):

  1. Launch the app: preview ok
  2. App to background > open other apps > reopen ours : preview resumes ok
  3. App to background > open the mobile’s camera app > close it > reopen ours: preview does not resume, there is no crash, the latest preview frame keeps being displayed, but not updated.

Should I stop answering here and swap to github?

Thanks again

Lets use github for issues related to fuse-camerapanel. So that we have all the information gathered :slight_smile: