question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CameraView freezes when using the front camera (Device: Sony Xperia XZ (F8332))

See original GitHub issue
07-28 17:32:15.780: E/camera-hal(2518): camera_device.cpp(3750):validateCaptureSettings: Unsupported ae mode 2.
07-28 17:32:15.780: E/camera-hal(2518): camera_device.cpp(5565):validateCaptureSettings: validateCaptureSettings failed.
07-28 17:32:15.780: E/camera-hal(2518): camera_device.cpp(2869):processRequest: Invalid settings for capture. Device:1 Frame Number:0
07-28 17:32:15.442: I/CameraService(2518): disconnect: Disconnected client for camera 0 for PID 25183
07-28 17:32:15.447: I/CameraService(2518): CameraService::connect call (PID -1 "city.alley.alleycity", camera ID 1) for HAL version default and Camera API version 2
07-28 17:32:15.448: I/Camera2ClientBase(2518): Camera 1: Opened. Client: city.alley.alleycity (PID 25183, UID 10250)
07-28 17:32:15.448: I/CameraDeviceClient(2518): CameraDeviceClient 1: Opened
07-28 17:32:15.450: D/audio_hw_primary(2466): adev_set_parameters: enter: camera_sub=on
07-28 17:32:15.450: D/audio_hw_extn(2466): audio_extn_set_anc_parameters: anc_enabled:0
07-28 17:32:15.451: W/ServiceManager(2518): Permission failure: com.sonyericsson.permission.CAMERA_EXTENDED from uid=10250 pid=25183
07-28 17:32:15.451: W/ServiceManager(2518): Permission failure: com.sonymobile.permission.CAMERA_DUAL_OPEN from uid=10250 pid=25183
07-28 17:32:15.452: W/ServiceManager(2518): Permission failure: com.sonymobile.permission.CAMERA_LOW_POWER from uid=10250 pid=25183
07-28 17:32:15.452: I/camera-hal(2518): camera_module.cpp(120):registerCamera: open was requested by non Sony camera app

I’ve tried to assign front facing by using both setFacing method and app:facing XML attribute, the CameraView freezes all the time and cannot take a picture.

PS. The back camera works well. Camera API v1 + SurfaceView seems to be quite normal with the front camera.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:21

github_iconTop GitHub Comments

2reactions
kraacommented, Apr 20, 2018

What helps me is app:flash="off" (problem with that in Front facing) Thats all! After that facing is working in xml and in code. Error 1:(4) disappear

2reactions
crontabcommented, Aug 29, 2017

CameraView has a problem with pretty much all Sony Xperia compact series phones: closing and re-opening the camera causes the API to return an error (4) and consequently crashing because the internal camera object becomes null. This happens e.g. when you switch the cameras from back to front, change aspect ratio etc. The OP’s problem here may or may not be related though.

My workaround was to force Camera1 API on these phones. It may be that camera hardware on these phones are not fully Camera2 compliant despite that the phone itself officially supports API 21+.

Read more comments on GitHub >

github_iconTop Results From Across the Web

XZP camera crashes the phone quite often - XDA Forums
Hi, Does anyone have an issue with XZP camera app? The camera app randomly crashes the phone quite often. I tried to clear...
Read more >
android - Camera live preview freezes on camera switch
Well, Here I'm going to write a tutorial for you about capturing an image using Camera by enabling some common features of camera....
Read more >
Cameras and the Flash Don't Work - Sony Xperia Z5 - iFixit
I have the same issue with my Sony Xperia XZ premium. ... because it seems very unlikely that flash front- and rear-camera brake...
Read more >
Sony Xperia XZ - Full phone specifications - GSMArena.com
F8331. F8331 USA. F8332. Also known as Sony Xperia XZ Dual F8332 with dual-SIM card slots ... Selfie camera, Single, 13 MP, f/2.0,...
Read more >
Xpreria XZ: Problem with picture freeze when recording video
I have an Xperia XZ running Andriod 8.0.0. I think I bought this phone in 2016, and these video hickups have been a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found