Status Update
Comments
er...@google.com <er...@google.com> #2
er...@google.com <er...@google.com> #3
Great! Thanks a lot, I'll look for the live updates soon!
he...@gmail.com <he...@gmail.com> #4
1, I tried it on a Samsung A50 A505FN and everything looks normal.
2, Yes, CameraXBasic is also bad on Samsung A3
I checked the preview with the front camera in CameraXBasic and it looks normal, only the rear camera preview is stretched / distorted.
I recorded a video of the preview with a blue circle on screen.
By the way, I don't seem to be able to change the resolution in the ML Kit Vision Quickstart Sample App with CameraXLivePreview. It doesn't matter what I select in the settings, the preview always stays at 720x960 or the only other resolution that works is 288x352.
Off:
CameraXBasic always crashes after the first launch, happened on both devices. See the attached crash log. Only way I could open it again is to revoke the camera permission in settings so it has to ask for it again on launch.
Also something I noticed is that the image from CameraX seemed darker overall. Now I did a comparison and my guess is that it has increased contrast, because the highlights are brighter too, compared to the stock app.
I don't know how the image looks on other devices but shouldn't it be the same ?
This is not too good because it reduces the dynamic range.
er...@google.com <er...@google.com>
er...@google.com <er...@google.com>
xi...@google.com <xi...@google.com> #5
I am able to repro the issue with a Samsung Galaxy A3. It's not the same quirk as
The symptom seems to be that, no matter what Surface is given to the preview, the returned buffer is always 25% shorter than it should be. So if a 4:3 surface is provided, the returned buffer is 16:9 with a center-cropped FOV but stretched into the 4:3 buffer. However if a 16:9 buffer is provided, the return buffer is 64:27 stretched into the 16:9 buffer. The measurement is just me eye-balling. The issue only happens to back camera. The front camera is fine.
Most of the camera apps on Play Store do not have the same issue. Examples:
- OpenCamera
https://play.google.com/store/apps/details?id=net.sourceforge.opencamera - HD Camera:
https://play.google.com/store/apps/details?id=hd.camera
However there are some apps do have the same issue.
Action items:
- Ask Samsung for tips on how to workaround the issue.
- Test with a SM-T580 and see if
is still fixed. Maybe a recent change in the core negated the workaround.b/169471824 - OpenCamera is open source. Check OpenCamera's source code and see how they handle the issue.
- Add a workaround in the Viewport feature. I would avoid this if I could. This is undesirable because 1) Viewport feature is written based on the assumption that camera buffer is not stretched. Changing this assumption would mean major refactoring, and 2) if we fixed this way, end user still get a smaller FOV.
xi...@google.com <xi...@google.com> #6
I looked into OpenCamera's source code. Their secret is using camera1 on LEGACY device, which unfortunately does not work for us.
he...@gmail.com <he...@gmail.com> #7
I checked the ML Kit Vision Showcase App with Material Design.
link:
And the preview here works normally on Samsung A3.
xi...@google.com <xi...@google.com> #8
Thanks for the link,
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit 6f70309de2ab7d47938b6fe339c9e9f6563ee4e0
Author: Xi Zhang <xizh@google.com>
Date: Thu Feb 25 14:16:29 2021
Add a quirk for Samsung A3 stretched preview.
The quirk is that the preview is always stretched, and it seems that the FOV is always 1/3 wider than it should be.
The fix is changing the transform in PreviewView so that the extra FOV gets cropped.
This fix is not perfect as it won't fix core users. e.g. core test app still has the issue. However, there isn't a good way to fix it without adding new API to provide the extra info about stretching. With this fix at least the view artifact will work as expected.
Relnote: fix Samsung A3 stretched preview in PreviewView.
Bug: 180121821
Test: manual test and ./gradlew bOS
Change-Id: Iacb30b0ff035d5a24ac221470a6815d96eca1725
M camera/camera-core/src/main/java/androidx/camera/core/internal/compat/quirk/DeviceQuirksLoader.java
A camera/camera-core/src/main/java/androidx/camera/core/internal/compat/quirk/PreviewStretchedQuirk.java
A camera/camera-core/src/test/java/androidx/camera/core/internal/compat/quirk/PreviewStretchedQuirkTest.java
M camera/camera-view/src/main/java/androidx/camera/view/PreviewTransformation.java
Description
Please describe your issue and include details such as the version of CameraX you are using and any relevant logs related to your issue.
// If at all possible, capture an Android logcat (
CAMERAX VERSION (ex - 1.0.0-alpha07)
tried multiple, all bad
1.0.0-beta07
1.1.0-alpha01
1.0.0-rc02
CAMERA APPLICATION NAME AND VERSION: (Settings > Apps > (app name) > version)
ML Kit Vision Quickstart Sample App, Version 1.11
ANDROID OS BUILD NUMBER: (Settings > About > Build number)
Android 8.0, build: R16NW.A320FLXXS9CTK2
DEVICE NAME: (Nexus 5X, Samsung S6, etc)
Samsung Galaxy A3 2017 A320FL
DESCRIPTION:
Either clone the ML Kit Vision Quickstart Sample App or implement my own app following Getting Started with CameraX tutorial on codelabs.
Preview is stretched or distorted.
Photos taken are normal, only the preview is bad.
When opening the old LivePreviewActivity in the sample app, the preview is normal.
LIST ANY EXPERIMENTAL FEATURES: (As an example - @ExperimentalCamera2Interop)
STEPS TO REPRODUCE:
1. Clone ML Kit Vision Quickstart Sample App
2. Open CameraXLivePreview
OBSERVED RESULTS:
Stretched or distorted preview
EXPECTED RESULTS:
Normal Preview
REPRODUCIBILITY: (5 of 5, 1 of 100, etc)
100%
ADDITIONAL INFORMATION:
See the attached screenshots.
CODE FRAGMENTS (this will help us troubleshoot your issues):