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

Camera Orientation Incorrect on Pixel 6 #45

Closed
cwnuk-lfl opened this issue Jul 6, 2023 · 6 comments
Closed

Camera Orientation Incorrect on Pixel 6 #45

cwnuk-lfl opened this issue Jul 6, 2023 · 6 comments
Labels
android Issues that affect Android bug Something isn't working

Comments

@cwnuk-lfl
Copy link

cwnuk-lfl commented Jul 6, 2023

On the Pixel 6, we are seeing the front facing camera image rotated 90 degrees counter clockwise.

This previously worked as expected on this device, but the behavior changed when we upgraded to the latest version of Android available on the device. Other devices we have tested (see below) have not exhibited this issue, but do not seem to have the same OS updates available to them yet.

When we start the camera, we are seeing this spamming the console in logcat on the Pixel 6:
2023/07/05 13:48:46.260 31104 31278 Error ACameraMetadata getConstEntry: cannot find metadata tag 65568
This log message does not seem to appear on devices without the issue.

Consistent across all below tests:

Unity 2021.3.24f1
`Default Orientation` set to Landscape Left in Unity Resolution and Presentation Player Settings
NatDevice 1.3.1 and 1.3.4 were both tested with the same results
Minimum Android API Level 24
IL2CPP
API Compatibility Level: .NET Framework
Graphics APIs: OpenGLES3, Vulkan
Linear Color Space
URP

Configurations tested, where the issue does occur:

Pixel 6
Android 13
March 5, 2023 security update
Google play system update May 1, 2023
Kernel 5.10.149-android13-4-00004-g0e5c0e91bbee-ab947504
Issue present with 'Auto Rotate screen' both enabled and disabled in device's Settings/Display menu

Configurations tested, where the issue does not occur:

Pixel 6
Android 13
Dec 5, 2022 security update
Google play system update May 1, 2023
Kernel 5.10.107-android13-4-00038-ga6f610f1f1e6-ab9083768
Samsung galaxy S7
Android 13
July 1, 2023 security update
Google play system update: May 1, 2023
Kernel 4.19.113-26430179, natmlx/natdevice#1 wed apr 19 14:13:54 +07 2023
Samsung s22 ultra
Android 13
June 1, 2023 security update
Google play system update: may 1, 2023
kernel version: 5.10.136-android12-9-26203684-abs908usqu2cwe6

Mac & Windows in editor working as expected

iPhone 13 Pro & other iOS devices working as expected

@olokobayusuf
Copy link
Member

Hey @cwnuk-lfl , I've got inline responses below:

This previously worked as expected on this device, but the behavior changed when we upgraded to the latest version of Android available on the device. Other devices we have tested (see below) have not exhibited this issue, but do not seem to have the same OS updates available to them yet.

This is gonna be a tough one to find a workaround for, given that it's both device- and OS-version-specific.

When we start the camera, we are seeing this spamming the console in logcat on the Pixel 6:
2023/07/05 13:48:46.260 31104 31278 Error ACameraMetadata getConstEntry: cannot find metadata tag 65568
This log message does not seem to appear on devices without the issue.

I don't think this is related. Metadata tag 65568 should correspond to ACAMERA_CONTROL_AF_STATE (i.e. autofocus state).

A quick diagnostic to run is to check the cameraDevice.frontFacing of the front camera on the Pixel 6. If that value is incorrect, then that would both be the culprit and the place to build a workaround.

@cwnuk-lfl
Copy link
Author

cwnuk-lfl commented Jul 12, 2023

Hi @olokobayusuf thank you very much for the response! cameraDevice.frontFacing is reporting as true.

@olokobayusuf
Copy link
Member

@cwnuk-lfl this is going to be pretty involved to investigate and potentially fix. Shoot me an email to discuss further.

@cwnuk-lfl
Copy link
Author

Thanks @olokobayusuf - emailed you at that address.

@olokobayusuf
Copy link
Member

NatDevice has officially been deprecated, as it has been merged into VideoKit. I'm moving this issue to the VideoKit repo.

@olokobayusuf olokobayusuf added android Issues that affect Android bug Something isn't working labels Aug 9, 2023
@olokobayusuf olokobayusuf pinned this issue Aug 9, 2023
@olokobayusuf olokobayusuf unpinned this issue Aug 9, 2023
@olokobayusuf olokobayusuf transferred this issue from natmlx/natdevice Aug 9, 2023
@olokobayusuf
Copy link
Member

While we haven't added an explicit fix for this issue, we've exposed new APIs that will allow developers to write a workaround. Feel free to follow up for more info on doing this.

@olokobayusuf olokobayusuf closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issues that affect Android bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants