Potential bug- delay using pinch to zoom

186 views
Skip to first unread message

Taylor Stephenson

unread,
Jul 21, 2022, 10:43:14 AM7/21/22
to Android CameraX Discussion Group
Hi,

We are in the process of replacing our camera2 code with CameraX. Overall we're super happy with it, but I got one piece of negative feedback and I'm not sure how to improve it.

-------------------------------------------------------------------------------------------------------
When using 2 fingers to try and zoom in, there is about a slight (but noticeable) delay between your action and the camera catching up to zoom.

Pixel 5
Pixel 6
Galaxy S22+
-------------------------------------------------------------------------------------------------------

Our code is very similar to pinch to zoom described in this article. Currently we are using preview and image capture use cases with target aspect ratio / resolution set. Our previewView is 4:3.

I imagine zoom is a processing intense operation if you keep having to redraw the preview, but if that is the case it seems weird the delay is just at the beginning of the action and not a laggy-feel throughout.

Based on this similar issue with scrolling, I tried changing (in the android studio debugger, not with reflection):
- mMinSpan
- mTouchSlopSquare
- both of the above at the same time
But there was no noticeable difference. So it doesn't look like implementing custom gesture detection would help (and I don't like deviating from standard infrastructure because it's gonna cause a headache later).

Are there any known issues with zoom in general or with certain configurations? Or any suggested workarounds?

Let me know if there's anymore information I can provide and thanks,
Taylor Stephenson

Xi Zhang (张熹)

unread,
Jul 21, 2022, 11:32:44 AM7/21/22
to Taylor Stephenson, Android CameraX Discussion Group
Are you using LifecycleCameraController with your PreviewView? CameraController has a built-in pinch-to-zoom feature. Could you check if switching to CameraController makes a difference?

Also, you could compare it with the Google Camera App? If Google Camera App has the same latency, it's probably caused by camera hardware.

--
You received this message because you are subscribed to the Google Groups "Android CameraX Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camerax-develop...@android.com.
To view this discussion on the web visit https://groups.google.com/a/android.com/d/msgid/camerax-developers/5bdbe1fb-bdfa-41d4-afa3-51950b941f87n%40android.com.

Taylor Stephenson

unread,
Jul 22, 2022, 2:18:33 PM7/22/22
to Android CameraX Discussion Group, xi...@google.com, Android CameraX Discussion Group, Taylor Stephenson
We are not. I'll see if switching to it makes a difference when I get a chance and then update you.

The native app had a delay as well but it was much less noticeable.

Taylor Stephenson

unread,
Jul 28, 2022, 3:22:04 PM7/28/22
to Android CameraX Discussion Group, Taylor Stephenson, xi...@google.com, Android CameraX Discussion Group
On the Samsung making changes didn't really make a difference, but the delay on the native camera app was about the same as using CameraX.

Haven't gotten to test on a Pixel yet.

Xi Zhang (张熹)

unread,
Jul 28, 2022, 5:01:01 PM7/28/22
to Taylor Stephenson, Android CameraX Discussion Group
You mentioned that "The native app had a delay as well but it was much less noticeable."

So if it's the same on Samsung devices, could you tell me on which device it's much less noticeable?

Taylor Stephenson

unread,
Aug 4, 2022, 8:50:13 AM8/4/22
to Android CameraX Discussion Group, xi...@google.com, Android CameraX Discussion Group, Taylor Stephenson
I tried the Pixel models as well and couldn't see the difference. A UXD reviewed the Samsung device and agreed it doesn't seem to be an issue.

Since there aren't any known zoom issues, I'm going to assume this was something else slowing the user device.

I'm no longer looking into this or concerned about it. Sorry for the false alarm and thanks for y'alls quick responses as usual!
Reply all
Reply to author
Forward
0 new messages