Trying to get the stock camera app to work under AOSP

Search This thread

grisu59964

Senior Member
Sep 15, 2013
163
82
N 51° E 008°
Sony Xperia 5
Hi there,

a few days ago I posted my flavor of Pixel Experience 12 Plus and immediately got feedback that I should do something about the camera not working.
So, that's what I'm now trying to do. After bricking my phone several times and setting up my whole development system on a new PC, I now have a stable phone again and am able to continue.

I have added more proprietary files that were missing according to logcat.
Code:
lib/android.hidl.manager@1.0.so
lib64/android.hidl.manager@1.0.so
system_ext/lib/android.hidl.base@1.0.so
system_ext/lib64/android.hidl.base@1.0.so
Now I'm stuck here:
Code:
09-25 07:15:24.951 10496 10774 E AndroidRuntime: FATAL EXCEPTION: CameraAccess
09-25 07:15:24.951 10496 10774 E AndroidRuntime: Process: com.sonyericsson.android.camera, PID: 10496
09-25 07:15:24.951 10496 10774 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNK7android6Parcel10readIntPtrEv" referenced by "/system/lib64/libcacao_client.so"...
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:998)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1656)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at com.sonymobile.imageprocessor.bypasscamera2.BypassCamera.loadNativeLibrary(BypassCamera.java:214)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at com.sonyericsson.android.camera.device.CameraDeviceHandler$LoadNativeLibraryTask.doCameraDeviceAccess(CameraDeviceHandler.java:744)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at com.sonyericsson.android.camera.device.CameraDeviceHandler$CameraDeviceAccessTask.run(CameraDeviceHandler.java:4017)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.HandlerThread.run(HandlerThread.java:67)
As far as I know, _ZNK7android6Parcel10readIntPtrEv is part of libbinder.so that belongs to the NDK and really should be part of the ROM.
Maybe someone has a clue how to continue?
 

BrandonTGS

Member
May 17, 2020
43
8
Xperia XZ2
Nintendo Switch
I read on here not too long ago that the stock camera app broke since Android 12 because of a storage permission, I think? The only ROM I know of that has the stock camera app is Lineage 18.1 by @Sjll, but I don't think that ROM is AOSP based.

I think a few of the experts here like, @Miustone, @Sjll, @bobbyamarthaa, @elmaleek03, (sorry for the tags guys) might be able to help. :)

The moment you (or anyone else) get that stock camera app working I am gonna install your ROM straight away, it's the only thing keeping me on the Stock ROM. :)
Please continue the great work!
 

bobbyamarthaa

Senior Member
Hi there,

a few days ago I posted my flavor of Pixel Experience 12 Plus and immediately got feedback that I should do something about the camera not working.
So, that's what I'm now trying to do. After bricking my phone several times and setting up my whole development system on a new PC, I now have a stable phone again and am able to continue.

I have added more proprietary files that were missing according to logcat.
Code:
lib/android.hidl.manager@1.0.so
lib64/android.hidl.manager@1.0.so
system_ext/lib/android.hidl.base@1.0.so
system_ext/lib64/android.hidl.base@1.0.so
Now I'm stuck here:
Code:
09-25 07:15:24.951 10496 10774 E AndroidRuntime: FATAL EXCEPTION: CameraAccess
09-25 07:15:24.951 10496 10774 E AndroidRuntime: Process: com.sonyericsson.android.camera, PID: 10496
09-25 07:15:24.951 10496 10774 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNK7android6Parcel10readIntPtrEv" referenced by "/system/lib64/libcacao_client.so"...
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at java.lang.Runtime.loadLibrary0(Runtime.java:998)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at java.lang.System.loadLibrary(System.java:1656)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at com.sonymobile.imageprocessor.bypasscamera2.BypassCamera.loadNativeLibrary(BypassCamera.java:214)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at com.sonyericsson.android.camera.device.CameraDeviceHandler$LoadNativeLibraryTask.doCameraDeviceAccess(CameraDeviceHandler.java:744)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at com.sonyericsson.android.camera.device.CameraDeviceHandler$CameraDeviceAccessTask.run(CameraDeviceHandler.java:4017)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:938)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Looper.loopOnce(Looper.java:201)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:288)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.HandlerThread.run(HandlerThread.java:67)
As far as I know, _ZNK7android6Parcel10readIntPtrEv is part of libbinder.so that belongs to the NDK and really should be part of the ROM.
Maybe someone has a clue how to continue?
do using sony-msmnile tree?
i think u need to rebuild the tree's, cz msm-nile tree have many errors.
try to get contact with other dev here.
 
  • Like
Reactions: BrandonTGS

Miustone

Senior Member
Jul 23, 2012
3,355
6,184
30
Google Pixel 7 Pro
Hi there,

a few days ago I posted my flavor of Pixel Experience 12 Plus and immediately got feedback that I should do something about the camera not working.
So, that's what I'm now trying to do. After bricking my phone several times and setting up my whole development system on a new PC, I now have a stable phone again and am able to continue.

I have added more proprietary files that were missing according to logcat.
Code:
lib/android.hidl.manager@1.0.so
lib64/android.hidl.manager@1.0.so
system_ext/lib/android.hidl.base@1.0.so
system_ext/lib64/android.hidl.base@1.0.so
Now I'm stuck here:
Code:
09-25 07:15:24.951 10496 10774 E AndroidRuntime: FATAL EXCEPTION: CameraAccess
09-25 07:15:24.951 10496 10774 E AndroidRuntime: Process: com.sonyericsson.android.camera, PID: 10496
09-25 07:15:24.951 10496 10774 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNK7android6Parcel10readIntPtrEv" referenced by "/system/lib64/libcacao_client.so"...
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at java.lang.Runtime.loadLibrary0(Runtime.java:998)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at java.lang.System.loadLibrary(System.java:1656)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at com.sonymobile.imageprocessor.bypasscamera2.BypassCamera.loadNativeLibrary(BypassCamera.java:214)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at com.sonyericsson.android.camera.device.CameraDeviceHandler$LoadNativeLibraryTask.doCameraDeviceAccess(CameraDeviceHandler.java:744)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at com.sonyericsson.android.camera.device.CameraDeviceHandler$CameraDeviceAccessTask.run(CameraDeviceHandler.java:4017)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:938)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:99)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Looper.loopOnce(Looper.java:201)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:288)
09-25 07:15:24.951 10496 10774 E AndroidRuntime:     at android.os.HandlerThread.run(HandlerThread.java:67)
As far as I know, _ZNK7android6Parcel10readIntPtrEv is part of libbinder.so that belongs to the NDK and really should be part of the ROM.
Maybe someone has a clue how to continue?
Arent You the Guy from Android-Hilfe.de? I'm glad someone works on My old Xperia 5... Arent You willed to join Me with DIOS so we can work together on such Things? I have some other People around who can surely help with the Camera...
I read on here not too long ago that the stock camera app broke since Android 12 because of a storage permission, I think? The only ROM I know of that has the stock camera app is Lineage 18.1 by @Sjll, but I don't think that ROM is AOSP based.

I think a few of the experts here like, @Miustone, @Sjll, @bobbyamarthaa, @elmaleek03, (sorry for the tags guys) might be able to help. :)

The moment you (or anyone else) get that stock camera app working I am gonna install your ROM straight away, it's the only thing keeping me on the Stock ROM. :)
Please continue the great work!
Thanks for tagging Me, glad to see some Life over here!
do using sony-msmnile tree?
i think u need to rebuild the tree's, cz msm-nile tree have many errors.
try to get contact with other dev here.
Trees are availble on many Places. I would suggest using the SODP Trees since everything works over there except for Mobile Data...
 
  • Like
Reactions: BrandonTGS

bobbyamarthaa

Senior Member
Arent You the Guy from Android-Hilfe.de? I'm glad someone works on My old Xperia 5... Arent You willed to join Me with DIOS so we can work together on such Things? I have some other People around who can surely help with the Camera...

Thanks for tagging Me, glad to see some Life over here!

Trees are availble on many Places. I would suggest using the SODP Trees since everything works over there except for Mobile Data...
SODP need to much modified to work perfectly.
and it removes all xperia exclusive features.
 
Last edited:
  • Like
Reactions: BrandonTGS

grisu59964

Senior Member
Sep 15, 2013
163
82
N 51° E 008°
Sony Xperia 5
Thank you everyone for your replies! I've been active in background, working on the problem.
So far, I have created a shim for _ZNK7android6Parcel10readIntPtrEv and modified the references of libcacao_client to use libbinder.so and libhidlbase.so. Now the stock camera app starts, but it still won't work. It takes a few seconds before the message "Unknown error" appears on the screen.
No more exceptions in log, but I saw this:
Code:
10-03 12:25:42.968 14151 14194 I CameraApp: [PlatformCapability] shared-preferences is not valid: name = com.sonyericsson.android.camera.supported_values.platform
10-03 12:25:42.971  1691  4803 W ServiceManager: Permission failure: android.permission.HIGH_SAMPLING_RATE_SENSORS from uid=10064 pid=14151
10-03 12:25:42.977 14151 14194 I CameraManagerGlobal: Connecting to camera service
10-03 12:25:42.979  1336  1936 W ServiceManager: Permission failure: android.permission.CAMERA_OPEN_CLOSE_LISTENER from uid=10064 pid=14151
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: Cannot read /data/user/0/com.sonyericsson.android.camera/shared_prefs/com.sonyericsson.android.camera.supported_values.4.xml
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: org.xmlpull.v1.XmlPullParserException: Unexpected end of document
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:1548)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:969)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at android.app.SharedPreferencesImpl.loadFromDisk(SharedPreferencesImpl.java:171)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at android.app.SharedPreferencesImpl.access$000(SharedPreferencesImpl.java:59)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at android.app.SharedPreferencesImpl$1.run(SharedPreferencesImpl.java:140)
10-03 12:25:43.000 14151 14194 I CameraApp: [PlatformCapability] shared-preferences is not valid: name = com.sonyericsson.android.camera.supported_values.4
10-03 12:25:43.003   636   636 E SELinux : avc:  denied  { find } for pid=14151 uid=10064 name=cacao scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=0
10-03 12:25:43.003 14151 14194 I ServiceManager: Waiting for service 'cacao' on '/dev/binder'...
Is it possible that the cacao service is not running or cannot be found because of missing SELinux permissions?
I already set SELinux to permissive, but the only change was permissive=1 in the log.

do using sony-msmnile tree?
i think u need to rebuild the tree's, cz msm-nile tree have many errors.
try to get contact with other dev here.
I'm now using a mixture of elmaleek03s device tree and some additional changes for the stock camera app. The advise to head over to Telegram was already helpful as I got the hint with the shim there.

Arent You the Guy from Android-Hilfe.de? I'm glad someone works on My old Xperia 5... Arent You willed to join Me with DIOS so we can work together on such Things? I have some other People around who can surely help with the Camera...
I was active on android-hilfe.de, yes, but maybe I'm better known for my work back in the days on SE-world. I also dropped you a PM. ;)
Currently, I'm using my Xperia 5 as my daily driver (keeping my old buddy alive) so I try not to ruin everything all the time. But I'm really curious what you are doing with DIOS.
 

Attachments

  • Screenshot_20221003-171253_Camera.png
    Screenshot_20221003-171253_Camera.png
    19.5 KB · Views: 32
Last edited:

elmaleek03

Member
Jul 9, 2017
36
28
Tasikmalaya
Thank you everyone for your replies! I've been active in background, working on the problem.
So far, I have created a shim for _ZNK7android6Parcel10readIntPtrEv and modified the references of libcacao_client to use libbinder.so and libhidlbase.so. Now the stock camera app starts, but it still won't work. It takes a few seconds before the message "Unknown error" appears on the screen.
No more exceptions in log, but I saw this:
Code:
10-03 12:25:42.968 14151 14194 I CameraApp: [PlatformCapability] shared-preferences is not valid: name = com.sonyericsson.android.camera.supported_values.platform
10-03 12:25:42.971  1691  4803 W ServiceManager: Permission failure: android.permission.HIGH_SAMPLING_RATE_SENSORS from uid=10064 pid=14151
10-03 12:25:42.977 14151 14194 I CameraManagerGlobal: Connecting to camera service
10-03 12:25:42.979  1336  1936 W ServiceManager: Permission failure: android.permission.CAMERA_OPEN_CLOSE_LISTENER from uid=10064 pid=14151
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: Cannot read /data/user/0/com.sonyericsson.android.camera/shared_prefs/com.sonyericsson.android.camera.supported_values.4.xml
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: org.xmlpull.v1.XmlPullParserException: Unexpected end of document
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl:     at com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:1548)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl:     at com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:969)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl:     at android.app.SharedPreferencesImpl.loadFromDisk(SharedPreferencesImpl.java:171)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl:     at android.app.SharedPreferencesImpl.access$000(SharedPreferencesImpl.java:59)
10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl:     at android.app.SharedPreferencesImpl$1.run(SharedPreferencesImpl.java:140)
10-03 12:25:43.000 14151 14194 I CameraApp: [PlatformCapability] shared-preferences is not valid: name = com.sonyericsson.android.camera.supported_values.4
10-03 12:25:43.003   636   636 E SELinux : avc:  denied  { find } for pid=14151 uid=10064 name=cacao scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=0
10-03 12:25:43.003 14151 14194 I ServiceManager: Waiting for service 'cacao' on '/dev/binder'...
Is it possible that the cacao service is not running or cannot be found because of missing SELinux permissions?
I already set SELinux to permissive, but the only change was permissive=1 in the log.


I'm now using a mixture of elmaleek03s device tree and some additional changes for the stock camera app. The advise to head over to Telegram was already helpful as I got the hint with the shim there.


I was active on android-hilfe.de, yes, but maybe I'm better known for my work back in the days on SE-world. I also dropped you a PM. ;)
Currently, I'm using my Xperia 5 as my daily driver (keeping my old buddy alive) so I try not to ruin everything all the time. But I'm really curious what you are doing with DIOS.
glad to see someone popping out here. sadly im no longer using bahamut since months ago, i hope this issue can be fixed in a near. ive already tried ask Sjll, but he gave no clue except including all the related camera files in the build process. thats why his builds has a dedicated stock cam ROM ZIPS.
 
  • Like
Reactions: BrandonTGS

bobbyamarthaa

Senior Member
glad to see someone popping out here. sadly im no longer using bahamut since months ago, i hope this issue can be fixed in a near. ive already tried ask Sjll, but he gave no clue except including all the related camera files in the build process. thats why his builds has a dedicated stock cam ROM ZIPS.
om, coba intip ini.

maybe u can use this as refference grisu59964
he is the same person who has built a custom rom for xperia 1 on coolapk forum
 

grisu59964

Senior Member
Sep 15, 2013
163
82
N 51° E 008°
Sony Xperia 5
There were changes done by @elmaleek03 on setup-makefiles.sh that look like the camera APK gets elevated rights. Do I need to call setup-makefiles.sh manually during build? Can anybody help me fully understand what is going on in this commit?
As far as my research goes now, the camera app needs to be executed in the system_app domain rather than platform_app and I would like to change that.
 
  • Like
Reactions: BrandonTGS

grisu59964

Senior Member
Sep 15, 2013
163
82
N 51° E 008°
Sony Xperia 5
Alright, I found the answer to my last question myself. setup-makefiles.sh is called by extract-files.sh. And the code from the commit is written to vendor/sony/bahamut/Android.mk for anyone curious.
I'm currently starting /system/bin/cacaoserver via adb shell to get a message why the service crashes.
I have no idea why there is nothing to see in the log during boot. But at least now there is the first progress since days. Stay tuned!
 
Last edited:

grisu59964

Senior Member
Sep 15, 2013
163
82
N 51° E 008°
Sony Xperia 5
Current state: cacaoserver is now able to start. I went through a lot of missing files and then segfaults. Unfortunately, the cacaoserver does somehow not survive the boot phase and is not running any more when the camera app starts. When I start the binary manually, it stays alive.
If SELinux is not enforcing, the camera app will start, connect to the cacaoserver and then crash:
Code:
10-09 10:24:50.660   860   860 D Zygote  : Forked child process 12098
10-09 10:24:50.660  1639  1743 I ActivityManager: Start proc 12098:com.sonyericsson.android.camera/u0a64 for pre-top-activity {com.sonyericsson.android.camera/com.sonyericsson.android.camera.CameraActivity}
10-09 10:24:50.691 12098 12098 E .android.camer: Not starting debugger since process cannot load the jdwp agent.
10-09 10:24:50.694 12098 12098 D ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
10-09 10:24:50.702 12098 12098 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10064; state: DISABLED
10-09 10:24:50.712 12098 12098 W .android.camer: ClassLoaderContext shared library size mismatch. Expected=0, found=1 (PCL[] | PCL[]{PCL[/product/framework/com.sonymobile.camera.addon_impl.jar*1938205956]})
10-09 10:24:50.719 12098 12098 V GraphicsEnvironment: ANGLE Developer option for 'com.sonyericsson.android.camera' set to: 'default'
10-09 10:24:50.720 12098 12098 V GraphicsEnvironment: ANGLE GameManagerService for com.sonyericsson.android.camera: false
10-09 10:24:50.720 12098 12098 D NetworkSecurityConfig: No Network Security Config specified, using platform default
10-09 10:24:50.721 12098 12098 D NetworkSecurityConfig: No Network Security Config specified, using platform default
10-09 10:24:50.801 12098 12119 I CameraManagerGlobal: Connecting to camera service
10-09 10:24:50.816   630   630 E SELinux : avc:  denied  { find } for pid=12098 uid=10064 name=cacao scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=1
10-09 10:24:50.866  1318 27514 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10064 pid=12098
10-09 10:24:50.885 12067 12070 D CacaoService: client create - pid:12098
10-09 10:24:50.885 12067 12070 I cacao   : 2079724329205 pal.cpp                           (2611) 12070 I [INF] PAL_Create
10-09 10:24:50.888 12098 12122 E .android.camer: BypassCameraBurst_changeToPhotoMode: stop cacao ret=-111
10-09 10:24:50.888 12098 12122 D .android.camer: [Debug] BypassCameraBurst_changeToPhotoMode: burstNum=4
10-09 10:24:50.890 12098 12122 E AndroidRuntime: FATAL EXCEPTION: CameraAccess
10-09 10:24:50.890 12098 12122 E AndroidRuntime: Process: com.sonyericsson.android.camera, PID: 12098
10-09 10:24:50.890 12098 12122 E AndroidRuntime: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=com.sonymobile.cameracommon.action.CAMERA_STATUS_UPDATE pkg=com.sonymobile.cameracommon (has extras) }: app is in background uid null
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1870)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.app.ContextImpl.startService(ContextImpl.java:1826)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.content.ContextWrapper.startService(ContextWrapper.java:776)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.cameracommon.status.CameraStatusPublisher.publish(CameraStatusPublisher.java:96)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.cameracommon.status.CameraStatusPublisher.publish(CameraStatusPublisher.java:86)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.android.camera.device.BypassCameraController$OpenBypassCameraTask.doCameraDeviceAccess(BypassCameraController.java:1166)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.android.camera.device.CameraDeviceHandler$CameraDeviceAccessTask.run(CameraDeviceHandler.java:4017)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:938)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Looper.loopOnce(Looper.java:201)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:288)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.HandlerThread.run(HandlerThread.java:67)
10-09 10:24:50.892 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.894 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.896 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.900  1639 12166 I DropBoxManagerService: add tag=system_app_crash isTagEnabled=true flags=0x2
10-09 10:24:50.900 12098 12098 I DynamicAreaFilter: .init sSmoothFactor=0.9 screenSize.x=1080 screenSize.y=2520 mScreenHeight=2520 mLimitScale=71 mDynamicFilterType=2 mValidScreenHeightMin=252 mValidScreenHeightMax=1789
10-09 10:24:50.900 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.902  1639  4547 W ActivityTaskManager:   Force finishing activity com.sonyericsson.android.camera/.CameraActivity
10-09 10:24:50.911 12098 12098 D SYMPHONY: Detected Symphony running as an Android application, using logcat for all debugging output
10-09 10:24:50.911 12098 12098 I SYMPHONY: [36mA t794df074f8 /local/mnt/workspace/pcgbait/docker.ci.tmp/build/aarch64-android-clang6.0/SecondParty/symphony/src/symphony/src/lib/internal/soc/topology.c:674 Could not resolve a cluster for cpu 7. The cluster may be offline. Power request will be ignored.[0m
10-09 10:24:50.920 12098 12122 I Process : Sending signal. PID: 12098 SIG: 9
10-09 10:24:50.920  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
10-09 10:24:50.920  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
10-09 10:24:50.921  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
10-09 10:24:50.921  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
10-09 10:24:50.944   957  2454 D vendor.qti.bluetooth@1.0-wake_lock: Release wakelock is released 
10-09 10:24:50.973 12067 12067 D CacaoService: client delete - pid:12098
10-09 10:24:50.974  1639  1944 I ActivityManager: Process com.sonyericsson.android.camera (pid 12098) has died: fg  TOP 
10-09 10:24:50.974  1639  1746 I libprocessgroup: Successfully killed process cgroup uid 10064 pid 12098 in 0ms
The short life of the camera app process. 255 ms. Any hint solving those problems will massively improve my development speed, so please get in touch if you have a clue.
 
  • Like
Reactions: BrandonTGS

yogeshpatel7

Senior Member
Oct 2, 2015
66
10
Current state: cacaoserver is now able to start. I went through a lot of missing files and then segfaults. Unfortunately, the cacaoserver does somehow not survive the boot phase and is not running any more when the camera app starts. When I start the binary manually, it stays alive.
If SELinux is not enforcing, the camera app will start, connect to the cacaoserver and then crash:
Code:
10-09 10:24:50.660   860   860 D Zygote  : Forked child process 12098
10-09 10:24:50.660  1639  1743 I ActivityManager: Start proc 12098:com.sonyericsson.android.camera/u0a64 for pre-top-activity {com.sonyericsson.android.camera/com.sonyericsson.android.camera.CameraActivity}
10-09 10:24:50.691 12098 12098 E .android.camer: Not starting debugger since process cannot load the jdwp agent.
10-09 10:24:50.694 12098 12098 D ProcessState: Binder ioctl to enable oneway spam detection failed: Invalid argument
10-09 10:24:50.702 12098 12098 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10064; state: DISABLED
10-09 10:24:50.712 12098 12098 W .android.camer: ClassLoaderContext shared library size mismatch. Expected=0, found=1 (PCL[] | PCL[]{PCL[/product/framework/com.sonymobile.camera.addon_impl.jar*1938205956]})
10-09 10:24:50.719 12098 12098 V GraphicsEnvironment: ANGLE Developer option for 'com.sonyericsson.android.camera' set to: 'default'
10-09 10:24:50.720 12098 12098 V GraphicsEnvironment: ANGLE GameManagerService for com.sonyericsson.android.camera: false
10-09 10:24:50.720 12098 12098 D NetworkSecurityConfig: No Network Security Config specified, using platform default
10-09 10:24:50.721 12098 12098 D NetworkSecurityConfig: No Network Security Config specified, using platform default
10-09 10:24:50.801 12098 12119 I CameraManagerGlobal: Connecting to camera service
10-09 10:24:50.816   630   630 E SELinux : avc:  denied  { find } for pid=12098 uid=10064 name=cacao scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=1
10-09 10:24:50.866  1318 27514 W ServiceManager: Permission failure: android.permission.SYSTEM_CAMERA from uid=10064 pid=12098
10-09 10:24:50.885 12067 12070 D CacaoService: client create - pid:12098
10-09 10:24:50.885 12067 12070 I cacao   : 2079724329205 pal.cpp                           (2611) 12070 I [INF] PAL_Create
10-09 10:24:50.888 12098 12122 E .android.camer: BypassCameraBurst_changeToPhotoMode: stop cacao ret=-111
10-09 10:24:50.888 12098 12122 D .android.camer: [Debug] BypassCameraBurst_changeToPhotoMode: burstNum=4
10-09 10:24:50.890 12098 12122 E AndroidRuntime: FATAL EXCEPTION: CameraAccess
10-09 10:24:50.890 12098 12122 E AndroidRuntime: Process: com.sonyericsson.android.camera, PID: 12098
10-09 10:24:50.890 12098 12122 E AndroidRuntime: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=com.sonymobile.cameracommon.action.CAMERA_STATUS_UPDATE pkg=com.sonymobile.cameracommon (has extras) }: app is in background uid null
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1870)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.app.ContextImpl.startService(ContextImpl.java:1826)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.content.ContextWrapper.startService(ContextWrapper.java:776)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.cameracommon.status.CameraStatusPublisher.publish(CameraStatusPublisher.java:96)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.cameracommon.status.CameraStatusPublisher.publish(CameraStatusPublisher.java:86)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.android.camera.device.BypassCameraController$OpenBypassCameraTask.doCameraDeviceAccess(BypassCameraController.java:1166)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at com.sonyericsson.android.camera.device.CameraDeviceHandler$CameraDeviceAccessTask.run(CameraDeviceHandler.java:4017)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:938)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Looper.loopOnce(Looper.java:201)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.Looper.loop(Looper.java:288)
10-09 10:24:50.890 12098 12122 E AndroidRuntime:     at android.os.HandlerThread.run(HandlerThread.java:67)
10-09 10:24:50.892 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.894 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.896 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.900  1639 12166 I DropBoxManagerService: add tag=system_app_crash isTagEnabled=true flags=0x2
10-09 10:24:50.900 12098 12098 I DynamicAreaFilter: .init sSmoothFactor=0.9 screenSize.x=1080 screenSize.y=2520 mScreenHeight=2520 mLimitScale=71 mDynamicFilterType=2 mValidScreenHeightMin=252 mValidScreenHeightMax=1789
10-09 10:24:50.900 12098 12149 E CameraApp: [PlatformCapability] CameraInfo cannot be retrieved. Because PlatformCapability is not prepared.
10-09 10:24:50.902  1639  4547 W ActivityTaskManager:   Force finishing activity com.sonyericsson.android.camera/.CameraActivity
10-09 10:24:50.911 12098 12098 D SYMPHONY: Detected Symphony running as an Android application, using logcat for all debugging output
10-09 10:24:50.911 12098 12098 I SYMPHONY: [36mA t794df074f8 /local/mnt/workspace/pcgbait/docker.ci.tmp/build/aarch64-android-clang6.0/SecondParty/symphony/src/symphony/src/lib/internal/soc/topology.c:674 Could not resolve a cluster for cpu 7. The cluster may be offline. Power request will be ignored.[0m
10-09 10:24:50.920 12098 12122 I Process : Sending signal. PID: 12098 SIG: 9
10-09 10:24:50.920  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
10-09 10:24:50.920  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
10-09 10:24:50.921  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
10-09 10:24:50.921  1639  1742 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
10-09 10:24:50.944   957  2454 D vendor.qti.bluetooth@1.0-wake_lock: Release wakelock is released
10-09 10:24:50.973 12067 12067 D CacaoService: client delete - pid:12098
10-09 10:24:50.974  1639  1944 I ActivityManager: Process com.sonyericsson.android.camera (pid 12098) has died: fg  TOP
10-09 10:24:50.974  1639  1746 I libprocessgroup: Successfully killed process cgroup uid 10064 pid 12098 in 0ms
The short life of the camera app process. 255 ms. Any hint solving those problems will massively improve my development speed, so please get in touch if you have a clue.
Really good work bro please keep it up with your work
Nice to see some one will work on stock camera for android 12 xperia 5
Best of luck for next progress
 
  • Like
Reactions: BrandonTGS

grisu59964

Senior Member
Sep 15, 2013
163
82
N 51° E 008°
Sony Xperia 5
Short status update: It has been a rough few weeks for me in real life so I did not have so much time playing around and ruining my phone. ;) I tried to make the Xperia 5 II stock camera app work, but that one freezes as soon as you capture something - without leaving a trace in the logs. :(
I also tried decompiling and modifying the Xperia 5 camera app and adding probably missing things to the manifest, but that did not improve anything.
My device bricked twice and I'm currently running out of ideas.
Maybe something worth thinking about is the fact that the error message from my last logcat
Code:
AndroidRuntime: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=com.sonymobile.cameracommon.action.CAMERA_STATUS_UPDATE pkg=com.sonymobile.cameracommon (has extras) }: app is in background uid null
belongs to com.sonymobile.cameracommon which maybe also does not start properly.
I'm not giving up yet, but I'm not too optimistic either.
 
  • Love
Reactions: BrandonTGS

yogeshpatel7

Senior Member
Oct 2, 2015
66
10
Short status update: It has been a rough few weeks for me in real life so I did not have so much time playing around and ruining my phone. ;) I tried to make the Xperia 5 II stock camera app work, but that one freezes as soon as you capture something - without leaving a trace in the logs. :(
I also tried decompiling and modifying the Xperia 5 camera app and adding probably missing things to the manifest, but that did not improve anything.
My device bricked twice and I'm currently running out of ideas.
Maybe something worth thinking about is the fact that the error message from my last logcat
Code:
AndroidRuntime: android.app.BackgroundServiceStartNotAllowedException: Not allowed to start service Intent { act=com.sonymobile.cameracommon.action.CAMERA_STATUS_UPDATE pkg=com.sonymobile.cameracommon (has extras) }: app is in background uid null
belongs to com.sonymobile.cameracommon which maybe also does not start properly.
I'm not giving up yet, but I'm not too optimistic either.
I think xperia 5ii n xperia 5 have different camera drivers so face freezing during capture any images only slow motion video working in this app
I personally tried it so
 
  • Like
Reactions: BrandonTGS

nailyk

Senior Member
Oct 3, 2015
1,511
2,971
Hello @grisu59964
Currently trying the same exercise now.
Could you please provide the shim you created ? I tried to find a github from you but no luck ;)

About the permissions exceptions you are facing, did you try to go in permissive mode ?
Won't solve everything but should help.
 
  • Like
Reactions: BrandonTGS

grisu59964

Senior Member
Sep 15, 2013
163
82
N 51° E 008°
Sony Xperia 5

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Hi there,

    a few days ago I posted my flavor of Pixel Experience 12 Plus and immediately got feedback that I should do something about the camera not working.
    So, that's what I'm now trying to do. After bricking my phone several times and setting up my whole development system on a new PC, I now have a stable phone again and am able to continue.

    I have added more proprietary files that were missing according to logcat.
    Code:
    lib/android.hidl.manager@1.0.so
    lib64/android.hidl.manager@1.0.so
    system_ext/lib/android.hidl.base@1.0.so
    system_ext/lib64/android.hidl.base@1.0.so
    Now I'm stuck here:
    Code:
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: FATAL EXCEPTION: CameraAccess
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: Process: com.sonyericsson.android.camera, PID: 10496
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNK7android6Parcel10readIntPtrEv" referenced by "/system/lib64/libcacao_client.so"...
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:998)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1656)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at com.sonymobile.imageprocessor.bypasscamera2.BypassCamera.loadNativeLibrary(BypassCamera.java:214)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at com.sonyericsson.android.camera.device.CameraDeviceHandler$LoadNativeLibraryTask.doCameraDeviceAccess(CameraDeviceHandler.java:744)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at com.sonyericsson.android.camera.device.CameraDeviceHandler$CameraDeviceAccessTask.run(CameraDeviceHandler.java:4017)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
    09-25 07:15:24.951 10496 10774 E AndroidRuntime: 	at android.os.HandlerThread.run(HandlerThread.java:67)
    As far as I know, _ZNK7android6Parcel10readIntPtrEv is part of libbinder.so that belongs to the NDK and really should be part of the ROM.
    Maybe someone has a clue how to continue?
    2
    Alright, I found the answer to my last question myself. setup-makefiles.sh is called by extract-files.sh. And the code from the commit is written to vendor/sony/bahamut/Android.mk for anyone curious.
    I'm currently starting /system/bin/cacaoserver via adb shell to get a message why the service crashes.
    I have no idea why there is nothing to see in the log during boot. But at least now there is the first progress since days. Stay tuned!
    2
    Hello @grisu59964
    Currently trying the same exercise now.
    Could you please provide the shim you created ? I tried to find a github from you but no luck ;)

    About the permissions exceptions you are facing, did you try to go in permissive mode ?
    Won't solve everything but should help.
    You can find my device tree on GitHub. https://github.com/grisumedia/android_device_sony_bahamut
    Unfortunately, setting SELinux to permissive did not help either. :(
    2
    Thank you everyone for your replies! I've been active in background, working on the problem.
    So far, I have created a shim for _ZNK7android6Parcel10readIntPtrEv and modified the references of libcacao_client to use libbinder.so and libhidlbase.so. Now the stock camera app starts, but it still won't work. It takes a few seconds before the message "Unknown error" appears on the screen.
    No more exceptions in log, but I saw this:
    Code:
    10-03 12:25:42.968 14151 14194 I CameraApp: [PlatformCapability] shared-preferences is not valid: name = com.sonyericsson.android.camera.supported_values.platform
    10-03 12:25:42.971  1691  4803 W ServiceManager: Permission failure: android.permission.HIGH_SAMPLING_RATE_SENSORS from uid=10064 pid=14151
    10-03 12:25:42.977 14151 14194 I CameraManagerGlobal: Connecting to camera service
    10-03 12:25:42.979  1336  1936 W ServiceManager: Permission failure: android.permission.CAMERA_OPEN_CLOSE_LISTENER from uid=10064 pid=14151
    10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: Cannot read /data/user/0/com.sonyericsson.android.camera/shared_prefs/com.sonyericsson.android.camera.supported_values.4.xml
    10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: org.xmlpull.v1.XmlPullParserException: Unexpected end of document
    10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at com.android.internal.util.XmlUtils.readValueXml(XmlUtils.java:1548)
    10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at com.android.internal.util.XmlUtils.readMapXml(XmlUtils.java:969)
    10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at android.app.SharedPreferencesImpl.loadFromDisk(SharedPreferencesImpl.java:171)
    10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at android.app.SharedPreferencesImpl.access$000(SharedPreferencesImpl.java:59)
    10-03 12:25:42.999 14151 14220 W SharedPreferencesImpl: 	at android.app.SharedPreferencesImpl$1.run(SharedPreferencesImpl.java:140)
    10-03 12:25:43.000 14151 14194 I CameraApp: [PlatformCapability] shared-preferences is not valid: name = com.sonyericsson.android.camera.supported_values.4
    10-03 12:25:43.003   636   636 E SELinux : avc:  denied  { find } for pid=14151 uid=10064 name=cacao scontext=u:r:platform_app:s0:c512,c768 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=0
    10-03 12:25:43.003 14151 14194 I ServiceManager: Waiting for service 'cacao' on '/dev/binder'...
    Is it possible that the cacao service is not running or cannot be found because of missing SELinux permissions?
    I already set SELinux to permissive, but the only change was permissive=1 in the log.

    do using sony-msmnile tree?
    i think u need to rebuild the tree's, cz msm-nile tree have many errors.
    try to get contact with other dev here.
    I'm now using a mixture of elmaleek03s device tree and some additional changes for the stock camera app. The advise to head over to Telegram was already helpful as I got the hint with the shim there.

    Arent You the Guy from Android-Hilfe.de? I'm glad someone works on My old Xperia 5... Arent You willed to join Me with DIOS so we can work together on such Things? I have some other People around who can surely help with the Camera...
    I was active on android-hilfe.de, yes, but maybe I'm better known for my work back in the days on SE-world. I also dropped you a PM. ;)
    Currently, I'm using my Xperia 5 as my daily driver (keeping my old buddy alive) so I try not to ruin everything all the time. But I'm really curious what you are doing with DIOS.
    2
    glad to see someone popping out here. sadly im no longer using bahamut since months ago, i hope this issue can be fixed in a near. ive already tried ask Sjll, but he gave no clue except including all the related camera files in the build process. thats why his builds has a dedicated stock cam ROM ZIPS.
    om, coba intip ini.

    maybe u can use this as refference grisu59964
    he is the same person who has built a custom rom for xperia 1 on coolapk forum