[FIX] Front camera fix on the official CM13 builds

tank0412

Senior Member
May 24, 2014
2,831
5,468
0
Saint Petersburg
Hello.
I do not know but maybe it will be usefull for someone. I had dead front camera issue on the official CM13 builds.
So i fixed it:
https://drive.google.com/file/d/0B-Fin8UxrD6PTWZ2cjFuaVVaYk0/view
Just flash it via TWRP and you will get working front camera.

I created thist hread because i hope that this way this issue will be fixed faster by TheStrix.

P.S. My original first post with a fix is there:
http://forum.xda-developers.com/showpost.php?p=68183787&postcount=18

P.P.S My fix method is so stupid and simple but it works. :D
Maybe i will fing better fix later.
 
Last edited:

melmarPH

Senior Member
Feb 2, 2016
318
92
28
Caloocan City
This is such a wonderful share! One reason for me not flashing official cm13 is this front camera issue.. ( apart from the goodix issue ofcourse ) but seeing a working fix for the camera, now I am thinking twice! I think I can use cm13 now as a daily driver.. I am looking forward for fp fix in the future as well for goodix ones.
 

geriak

Member
Sep 6, 2016
5
1
0
Hello.
I do not know but maybe it will be usefull for someone. I had dead front camera issue on the official CM13 builds.
So i fixed it:
https://drive.google.com/file/d/0B-Fin8UxrD6PdzItRldIQlh3Z2M/view
Just flash it via TWRP and you will get working front camera.

I created thist hread because i hope that this way this issue will be fixed faster by TheStrix.

P.S. My original first post with a fix is there:
http://forum.xda-developers.com/showpost.php?p=68183787&postcount=18

P.P.S My fix method is so stupid and simple but it works. :D
Maybe i will fing better fix later.
Thx for work,
After flash this patch front camera works fine, but back camera is not detect :confused: I tried on cm13 official
 

geriak

Member
Sep 6, 2016
5
1
0
I use CM13 official too. (build of 1st September)
Back camera works fine with this patch.
Kernel stock? I installed cm13 last build 05/09 full wipe, my camera crashed with error " can't connect !:crying::crying:" , after your patch front camera works, but I can't switch to back " missing button to switch ",
I do not know what I can do :(:(:( What do you think about it?
Thanks again for your reply
 

tank0412

Senior Member
May 24, 2014
2,831
5,468
0
Saint Petersburg
Kernel stock? I installed cm13 last build 05/09 full wipe, my camera crashed with error " can't connect !:crying::crying:" , after your patch front camera works, but I can't switch to back " missing button to switch ",
I do not know what I can do :(:(:( What do you think about it?
Thanks again for your reply
It is really strange.
Try to get logcat and publish it there. I will look at it.
I use kernel by CM Team.
 

geriak

Member
Sep 6, 2016
5
1
0
It is really strange.
Try to get logcat and publish it there. I will look at it.
I use kernel by CM Team.
this is my logcat before apply patch, kernel by CM Team.

09-06 16:57:21.228 2285 3731 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.cyanogenmod.snap/com.android.camera.CameraLauncher bnds=[850,1701][1051,1929] (has extras)} from uid 10026 on display 0
09-06 16:57:21.239 2285 2386 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.cyanogenmod.trebuchet (pid=7783, uid=10026) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.gms/.icing.proxy.ApplicationLauncherReceiver
09-06 16:57:21.239 2285 2386 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.cyanogenmod.trebuchet (pid=7783, uid=10026) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.googlequicksearchbox/com.google.android.apps.gsa.search.core.icingsync.ApplicationLaunchReceiver
09-06 16:57:21.240 2285 2386 W BroadcastQueue: Permission Denial: broadcasting Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } from com.cyanogenmod.trebuchet (pid=7783, uid=10026) requires com.google.android.launcher.permission.RECEIVE_LAUNCH_BROADCASTS due to receiver com.google.android.googlequicksearchbox/com.google.android.apps.gsa.reflection.ReflectionReceiver
09-06 16:57:21.294 8254 8458 V CAM_PhotoModule: Open camera device.
09-06 16:57:21.295 8254 8458 V CameraHolder: open camera 0
09-06 16:57:21.295 8254 8458 E CameraHolder: fail to connect Camera:-1, aborting.
09-06 16:57:21.295 8254 8458 E CAM_PhotoModule: Failed to open camera:0
09-06 16:57:21.304 8254 8461 I OMXClient: Using client-side OMX mux.
09-06 16:57:21.307 8254 8254 V CAM_UI : Using mdp_preview_content (MDP path)
09-06 16:57:21.319 8254 8469 I OMXClient: Using client-side OMX mux.
09-06 16:57:21.322 8254 8254 V CAM_PhotoModule: On resume.
09-06 16:57:21.322 8254 8254 V CAM_PhotoModule: Executing onResumeTasks.
09-06 16:57:21.327 8254 8254 D CAM_Activity: send the turn off Flashlight broadcast
09-06 16:57:21.368 8254 8254 D CAM_PhotoModule: addIdleHandler in first time initialization
09-06 16:57:21.374 8254 8254 D CameraStorage: External storage state=mounted
09-06 16:57:21.377 8254 8472 I OMXClient: Using client-side OMX mux.
09-06 16:57:21.383 8254 8254 D CameraStorage: External storage state=mounted
09-06 16:57:21.397 8254 8254 V CAM_UI : setTransformMatrix: scaledTextureWidth = 1080.0, scaledTextureHeight = 1440.0
09-06 16:57:21.397 8254 8254 D CAM_UI : mSurfaceTextureUncroppedWidth=1080.0mSurfaceTextureUncroppedHeight=1440.0
09-06 16:57:21.406 8254 8254 V CAM_UI : surfaceCreated
09-06 16:57:21.406 8254 8254 V CAM_UI : surfaceChanged: width =1080, height = 1920
09-06 16:57:21.446 8254 8254 I FocusRingView: Computing center via view bounds.
09-06 16:57:21.477 2285 2391 I chatty : uid=1000(system) android.display expire 1 line
09-06 16:57:21.503 8254 8254 V CAM_UI : surfaceChanged: width =1080, height = 1440
09-06 16:57:21.984 603 603 I MSM-irqbalance: Decided to move IRQ240 from CPU3 to CPU1
09-06 16:57:22.204 4641 5215 I ClearcutLoggerApiImpl: disconnect managed GoogleApiClient
09-06 16:57:23.136 4647 4664 E ANDR-PERF-RESOURCEQS: Failed to apply optimization [4, 1]
09-06 16:57:23.297 8254 8274 D OpenGLRenderer: endAllStagingAnimators on 0x5591c40d90 (RippleDrawable) with handle 0x5591ea5490
09-06 16:57:23.309 8254 8254 V CAM_UI : surfaceDestroyed
09-06 16:57:23.314 8254 8254 D CAM_PhotoModule: remove idle handleer in onPause
09-06 16:57:23.314 8254 8254 V CAM_PhotoModule: On pause.
09-06 16:57:23.314 8254 8254 V CAM_PhotoModule: Close camera device.
09-06 16:57:23.358 8254 8254 I art : Starting a blocking GC Explicit
09-06 16:57:23.362 2285 3648 W InputMethodManagerService: Window already focused, ignoring focus gain of: [email protected] attribute=null, token = [email protected]
09-06 16:57:23.384 8254 8254 I art : Explicit concurrent mark sweep GC freed 6385(787KB) AllocSpace objects, 2(124KB) LOS objects, 24% free, 16MB/22MB, paused 507us total 22.191ms
09-06 16:57:23.427 8254 8254 I art : Starting a blocking GC Explicit
09-06 16:57:23.446 8254 8254 I art : Explicit concurrent mark sweep GC freed 3659(241KB) AllocSpace objects, 2(256KB) LOS objects, 25% free, 16MB/21MB, paused 456us total 18.390ms
09-06 16:57:23.446 8254 8254 I art : Starting a blocking GC Explicit
09-06 16:57:23.464 8254 8254 I art : Explicit concurrent mark sweep GC freed 36(1664B) AllocSpace objects, 0(0B) LOS objects, 24% free, 16MB/21MB, paused 366us total 17.785ms
09-06 16:57:23.488 8254 8254 E WindowManager:
09-06 16:57:23.488 8254 8254 E WindowManager: android.view.WindowLeaked: Activity com.android.camera.CameraActivity has leaked window com.android.internal.policy.PhoneWindow$DecorView{70ef881 V.E...... R....... 0,0-1026,590} that was originally added here
09-06 16:57:23.488 8254 8254 E WindowManager: at android.view.ViewRootImpl.<init>(ViewRootImpl.java:372)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:299)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:86)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.app.Dialog.show(Dialog.java:319)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.app.AlertDialog$Builder.show(AlertDialog.java:1112)
09-06 16:57:23.488 8254 8254 E WindowManager: at com.android.camera.util.CameraUtil.showErrorAndFinish(CameraUtil.java:403)
09-06 16:57:23.488 8254 8254 E WindowManager: at com.android.camera.CameraActivity$2.onDeviceOpenFailure(CameraActivity.java:318)
09-06 16:57:23.488 8254 8254 E WindowManager: at com.android.camera.AndroidCameraManagerImpl$CameraOpenErrorCallbackForward$2.run(AndroidCameraManagerImpl.java:990)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.os.Handler.handleCallback(Handler.java:739)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.os.Handler.dispatchMessage(Handler.java:95)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.os.Looper.loop(Looper.java:148)
09-06 16:57:23.488 8254 8254 E WindowManager: at android.app.ActivityThread.main(ActivityThread.java:5461)
09-06 16:57:23.488 8254 8254 E WindowManager: at java.lang.reflect.Method.invoke(Native Method)
09-06 16:57:23.488 8254 8254 E WindowManager: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
09-06 16:57:23.488 8254 8254 E WindowManager: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
 
Last edited:
  • Like
Reactions: tank0412

Alvarnar

Member
Mar 2, 2016
13
4
0
Thx for the fix. but...
I flashed with Alka TWRP but it didn't work on my current ROM (cm13 Resurrection remix 20160829) after flashed the phone just do optimized apps and there's still no front camera switch button in camera app. :crying::crying:
 
  • Like
Reactions: tank0412

geriak

Member
Sep 6, 2016
5
1
0
hi,

thanks for your work

but for me it does not work yet.

problem is diversity of hardware

my front cam s5k5e8 mod (z5e8yab) work fine !! bat back cam s5k3p3 mod gt24c64?* or f3p3man (I'm not sure which) missing libraries and crash (error can’t connect)

you could add libraries for both gt24c64, f3p3man

thx
 

rudix78

Senior Member
Sep 21, 2015
159
55
48
Kwidzyn
My rear camera works fine on every ROM, but front only in MIUI. On AOSP/CM based phone doesn't see a front camera, even after I installed these blobs.
Can you share what program did you use to check your camera, I mean this screenshot showing software version?

BTW: I applied blobs from 1408 over official CM and it works like a charm.
 
Last edited: