-
Notifications
You must be signed in to change notification settings - Fork 407
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
setParamaters Crash on Haiwai,1.0.2 #48
Comments
Could you please provide us with more logs from the device? In particular, I am interested in logs with tag |
When creating |
Few more generic questions which should help us to analyze the problem:
|
@markGilchristBookingBug In the meanwhile, please try updating to 1.0.3. It will not fix the problem itself, but it will include more information into exception's message. |
I have the same issue (exactly the same stack trace). I've added Crashlytics logging and upgraded to ver. 1.0.3 of Fotoapparat, maybe tomorrow I'll have something interesting to share. Crashlytics reports that 11 users on 6 different device models are affected in my case. The phone models being:
At the moment, I don't have a way of saying whether any of those models had a successful session. Because there are more users than models, I suspect that there must be multiple users affected by this issue on some device models. |
Hi @markGilchristBookingBug + @arekolek, How do you set the preview sizes? Potentially it's the same issue with this SO question. |
@Diolor I just have the <io.fotoapparat.view.CameraView
android:id="@+id/camera_preview"
android:layout_width="match_parent"
android:layout_height="match_parent"/> and set it up like this in my fragment: @BindView(R.id.camera_preview) CameraView cameraPreview;
private Fotoapparat fotoapparat;
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
ButterKnife.bind(this, view);
fotoapparat = Fotoapparat.with(getActivity())
.into(cameraPreview)
.photoSize(biggestSize())
.lensPosition(front())
.focusMode(firstAvailable(
continuousFocus(),
autoFocus(),
fixed()
))
.logger(new Logger() {
@Override
public void log(String msg) {
Crashlytics.log(Log.DEBUG, "Fotoapparat", msg);
}
})
.build();
}
@Override
public void onStart() {
super.onStart();
fotoapparat.start();
} I'm not doing anything with |
It seems (obviously) that Camera is not happy with whichever parameters we are passing to it. At the moment we try to update the whole set of parameters at once, so it's hard to tell which property causes the issue exactly. I'll create a fallback mechanism which will try to update each parameter individually and log/suppress the failures. Expect the new versions until the end of the week. Another topic. I see you are tracking Fotoapparat logs in Crashlytics. Is there any chance you can share those with us? |
The experimental fix is ready. You can try it out now in new version |
@dmitry-zaitsev I've added Crashlytics only recently, but got some reports over the weekend. Looks like they got obfuscated by ProGuard, but there were only at most three lines there anyway, so I guess those must be:
Sometimes all three, sometimes only two first, other times only the first, and sometimes none. Additionally, the exception message is more informative now and says:
That's on Samsung Galaxy S4 mini (GT-I9195). On ASUS MeMO Pad HD 7 (ME173X) the parameters were: Which kind of makes sense, considering S4 mini has a 540x960 px display and ASUS has a 800x1280 px display (from what I could find), so the requested preview size is bigger than the display in both instances. But it baffles me why would I'll try to keep ProGuard from obfuscating the logs and update Fotoapparat to 1.1.0 and we'll see what happens. I've added this to my
So far it looks like it does the job, not sure if there's anything more needed. |
Wow, that's really helpful!
That is actually OK, preview stream might have higher resolution than the screen itself. I am very suspicious about Either way, latest release ( |
The way it is implemented right now seems to be quite robust, so I am closing the issue. |
Fatal Exception: java.lang.RuntimeException: setParameters failed
at android.hardware.Camera.native_setParameters(Camera.java)
at android.hardware.Camera.setParameters(Camera.java:2028)
at io.fotoapparat.hardware.v1.Camera1.updateParameters(Camera1.java:178)
at io.fotoapparat.routine.StartCameraRoutine.run(StartCameraRoutine.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:838)
The text was updated successfully, but these errors were encountered: