Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not starting on some devices #143

Closed
Wojtek1234 opened this issue Jan 31, 2019 · 5 comments
Closed

Not starting on some devices #143

Wojtek1234 opened this issue Jan 31, 2019 · 5 comments

Comments

@Wojtek1234
Copy link

Basic configuration of camera view does not start on some devices.

On android 9 One Plus 6 it works as it should (starting preview)

on Lenovo Yoga tab 3 Android 7.1 (api 25) and on samsung Samsung Sm-A500FU android 6.0.1 (api 23) CameraView falls into some strange behaviour and does nothing,
in ovveriden method Camera2.start() it returns false and just hang there. In detail method chooseCameraIdByFacing() returns false so the true value from start is returned from line 626.

I have no idea why that is happening. Tested on both version 2.8.1 and 3.0.1-beta.

Basic Camera 2 api apps works on both devices.

CameraView widget has standart style from style="@style/Widget.CameraView"

@pvasa
Copy link
Owner

pvasa commented Jan 31, 2019

Do you see any errors in camera view error listener?

@Wojtek1234
Copy link
Author

unfortunately no, app just hangs. It never comes to listeners, it hangs up on line 570 of CameraView class when it try to destroy camera object

@pvasa
Copy link
Owner

pvasa commented Feb 2, 2019

@Wojtek1234 The reason chooseCameraIdByFacing() returns false could be because the hardware is not compatible with camera2 api on those devices. That is why it falls back to camera1 and return true which means the camera was started successfully.

Are you running sample app? If not, try the sample app and see if still facing same issue. Try adding a camera error listener first and then starting the camera. Please refer below snippet.

// add error listener first
cameraView.addCameraErrorListener { t, errorLevel -> 
   Log.e(javaClass.canonicalName, "Camera error", t)
}

// then start camera
cameraView.start()

@pvasa pvasa closed this as completed Feb 9, 2019
@ru-alxr
Copy link

ru-alxr commented Feb 20, 2019

Same bug.
Lib works perfectly on emulator, and fails on two real devices:
Lenovo a2016b30 (API 23)
Samsung SM-J810M (API 26)

Log contains these lines:

D/PermissionsManager: weaveJoinPoint: already has required permissions. Proceed with the execution.
I/CameraManagerGlobal: Connecting to camera service
D/VendorTagDescriptor: addVendorDescriptor: vendor tag id 3854507339 added
I/CameraManager: getCameraCharacteristics : cameraId = 0
I/CameraManager: getCameraCharacteristics : cameraId = 1
I/CameraManager: getCameraCharacteristics : cameraId = 0

@pvasa
Copy link
Owner

pvasa commented Feb 23, 2019

@ru-alxr Thanks for posting the log, although it does not say anything about the actual issue. And I don't have hands on those devices right now so I cannot test them either.

There are some major improvements and features coming to camera1 implementation (which seems to be the problem here) of the lib. So I would suggest to look out for it and once the release is out, try running the new version on those devices. There is going to be a lot of bug fixes which might fix the issue that you and @Wojtek1234 are facing. Refer PR #147 for more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants