account arrowhead-down arrowhead-up mobile-menu search sm-bold-x x-skinny-rounded x-skinny arrowhead-right social-facebook social-googleplus social-instagram social-linkedin social-pinterest social-qzone social-renren social-tencent social-twitter social-vkontakt social-weibo social-youku social-youtube

Please help us improve our website

Take our customer survey to evaluate your visit.

It should only take a few minutes to answer five quick questions. Just click the Launch survey button at the end of your visit to begin.

cancel
Showing results for 
Search instead for 
Did you mean: 
Welcome to the Open Devices community!

This is where we discuss open source and development related questions on our Open Devices initiative.

camera issues on Z5 Compact

Highlighted
Regular
Message 1 of 10
1,743 Views
Message 1 of 10

camera issues on Z5 Compact

(Because this appears to be an issue with the binary camera driver, I don't        
believe there's any Github repo that it's appropriate to file a bug against.       
Please let me know if you would prefer I raise this elsewhere.)                    
                                                                                   
I'm building 7.0 for an E5803 Z5 Compact. It's darn close to a daily driver,       
with the only apparent problem being a largely unusable camera. Here's what I   
see:                                                                               
                                                                                   
* In the 8MP mode, much of the time when opening the stock camera app, I get
  "Camera error - can't connect to the camera." The first use of the camera        
  after boot seems to always succeed, the second always seems to fail, and it's
  intermittent after that. The 23 MP mode fails most of the time, often on the  
  first attempt.                                                                   
* When I don't get that error, the preview out the back camera looks okay.         
  I am able to capture images, which are clear, but there is a thin green       
  bar on the right edge of the photo, and many objects have blue shadows of a   
  similar width to their left.                                                  
* The front camera seems to be always accessible. The preview is rotated 90     
  degrees counter-clockwise and has aspect ratio distortion. Image capture      
  succeeds, but the resulting file consists of many diagonal lines of garbage   
  and has a similar green stripe on the top edge.                               
                                                                                
I've been trying to make sense of the logcat without much success. Here's one,  
grepped for 'camera' to get the file size under pastebin's limit:               
http://pastebin.com/GE9yASyF
                                                                                
In this log, I booted the Z5C, opened the camera successfully, took a photo with
the rear camera, took a photo with the front camera, and then attempted to      
switch back to the rear camera, which failed. There's a segfault in             
/system/vendor/lib/libmmcamera2_iface_modules.so, and before that, several      
failures in mm-camera-* components that manifest in the open source code        
(QCamera3HWI.cpp) as a permission denial.                                       
                                                                                
I'm excited to switch to this thing and would very much like to help, but am    
unsure how to dig deeper into what appears to be a problem in a binary blob.       
Please let me know if there's anything I can do.

 

Here's a sample image from the rear camera:

front.jpg#

And the front:

front.jpg

9 REPLIES 9
Developer World
Message 2 of 10
1,697 Views
Message 2 of 10

Re: camera issues on Z5 Compact

Hi,

 

we will release soon the v7 libs that should fix the reported errors

 

Regards

Alin

 

Regular
Message 3 of 10
1,689 Views
Message 3 of 10

Re: camera issues on Z5 Compact

Thanks for the update. Sounds good - I'll try it as soon as they're out.

Regular
Message 4 of 10
1,680 Views
Message 4 of 10

Re: camera issues on Z5 Compact

Hi, Alin,

I did a clean build with the v7 binaries and all of the user-visible issues in my original post are still present. I think it might have a somewhat lower rate of "couldn't connect to camera", but it's still too high to be usable.

 

Is there anything I can do to help you guys out with this?

-Ted

Regular
Message 5 of 10
1,663 Views
Message 5 of 10

Re: camera issues on Z5 Compact

Same thing with v8.

Regular
Message 6 of 10
1,642 Views
Message 6 of 10

Re: camera issues on Z5 Compact

v9 seems to have fixed the stability issues - I am unable to reproduce the "Cannot connect to camera" error anymore. Thank you for that. Slightly smiling Face

 

That just leaves the decoding issues with both cameras and the orientation issue with the front camera. If there is any dev or test work I can do to help with this, please let me know.

Developer World
Message 7 of 10
1,613 Views
Message 7 of 10

Re: camera issues on Z5 Compact

Hi,

 

Please follow the build guide !

I suspect that you use master branch for n-mr1 and you have an incorect camera configuration

 

Regards

Alin

 

Regular
Message 8 of 10
1,606 Views
Message 8 of 10

Re: camera issues on Z5 Compact

Totally willing and happy to believe this is my fault. Slightly smiling Face Can you confirm that you guys have an e5803 running AOSP 7.1 where the camera works and produces correct images?

 

My .repo/local_manifests (which is what I think you're referring to) was on n-mr1, but I did see a stray Android.mk that I missed when switching from the old copy/paste instructions to checking it out as its own repo. I blew that away and did a pull, and hit a new problem. To be sure, I started the entire process over from scratch in a new dir, and got the new problem again.

 

* I'm now building android-7.1.1_r25 with v9 binaries

* e5823, which I think is correct for my e5803

 

Opening the camera just sits at a black screen, apparently forever. Both 8 and 23 MP. logcat shows this every five seconds:

CameraBase: CameraService not published, waiting...

ServiceManager: Waiting for service media.camera... (repeats four times)

 

I see this, a bit before it:

E SELinux : avc:  denied  { add } for service=media.camera pid=529 uid=1013 scontext=u:r:mediaserver:s0 tcontext=u:object_r:cameraserver_service:s0 tclass=service_manager permissive=
0
E ServiceManager: add_service('media.camera',18) uid=1013 - PERMISSION DENIED

Regular
Message 9 of 10
1,571 Views
Message 9 of 10

Re: camera issues on Z5 Compact

Found a fix for the hang/denial in my last post, which I submitted as an issue here: https://github.com/sonyxperiadev/device-sony-sepolicy/issues/175

 

Two issues left:

1) Autofocus on the back camera doesn't work. It actuates, but never actually locks onto anything. Lots of logcat chatter while this is happening:

1-09 02:53:28.078   608  5178 I mm-camera-sensor: af_actuator_move_focus:305curr_len_pos:334
01-09 02:53:28.108   608  5178 I mm-camera-sensor: af_actuator_move_focus:305curr_len_pos:226
01-09 02:53:28.143   608  5178 I mm-camera-sensor: af_actuator_move_focus:305curr_len_pos:118
(repeat a dozen times or so)
01-09 02:53:28.690   608  5178 I mm-camera-sensor: af_actuator_move_focus:305curr_len_pos:928

(repeat a dozen times or so)

2) Front camera preview is upside-down. Don't know if this is controlled by code or the binary blobs, but I'm going to see if I can find a fix for it myself.

Developer World
Message 10 of 10
1,493 Views
Message 10 of 10

Re: camera issues on Z5 Compact

Hi,

 

the secondary camera preview is fine on M and upside down on N(the snapshopt is ok)

I would suspect a change in how AOSP calculates the camera orientation between the 2 versions

 

Regards

Alin