Jump to content

ARFoundation sample issue


RRob
 Share

Recommended Posts

Hello,

I'm having an issue with the "Assets\Samples\VIVE Hand Tracking SDK\1.0.0\Sample\ARFoundation.unity" scene.
For some reason the camera passthrough does not work.

My setup is:
Unity: 2021.1.21f1
Packages:
image.png.2f7b87870e94b571770c54038f7081fa.png


Description:
When compiling and running it on my phone, the screen is black but the hand tracking is working.
I have narrowed it down to the GestureProvider.cs script. If it is disabled, camera passthrough works but it defeats the purpose.

Using logcat I managed to extract this:

2021/09/19 22:31:56.287 5246 5289 Error native ################ ARCore Native Error ##################
2021/09/19 22:31:56.287 5246 5289 Error native BUILD_CHANGELIST:387218412
2021/09/19 22:31:56.287 5246 5289 Error native BUILD_BASELINE_CHANGELIST:385683590
2021/09/19 22:31:56.287 5246 5289 Error native ################### Stack Trace Begin ################
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/infrastructure/cameras_external_state.cc:193	https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/infrastructure/cameras_external_state.cc?g=0&l=193
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/infrastructure/cameras_async.cc:162	https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/infrastructure/cameras_async.cc?g=0&l=162
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/infrastructure/android_data_source.cc:635	https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/infrastructure/android_data_source.cc?g=0&l=635
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/core/session.cc:1762	https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/session.cc?g=0&l=1762
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/core/c_api/session_lite_c_api.cc:76	https://cs.corp.google.com/piper///depot/google3/third_party/arcore/ar/core/c_api/session_lite_c_api.cc?g=0&l=76
2021/09/19 22:31:56.287 5246 5289 Error native ################### Stack Trace End #################
2021/09/19 22:31:56.287 5246 5289 Error native 
2021/09/19 22:31:56.287 5246 5289 Error native ################### Undecorated Trace Begin  #################
2021/09/19 22:31:56.287 5246 5289 Error native FAILED_PRECONDITION: 
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/core/session.cc:1762
2021/09/19 22:31:56.287 5246 5289 Error native 
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/infrastructure/android_data_source.cc:635
2021/09/19 22:31:56.287 5246 5289 Error native 
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/infrastructure/cameras_async.cc:162
2021/09/19 22:31:56.287 5246 5289 Error native 
2021/09/19 22:31:56.287 5246 5289 Error native ARCoreError: third_party/arcore/ar/infrastructure/cameras_external_state.cc:193
2021/09/19 22:31:56.287 5246 5289 Error native Operation required Started but state is Error
2021/09/19 22:31:56.287 5246 5289 Error native === Source Location Trace: ===
2021/09/19 22:31:56.287 5246 5289 Error native third_party/arcore/ar/infrastructure/cameras_external_state.cc:327
2021/09/19 22:31:56.287 5246 5289 Error native third_party/arcore/ar/infrastructure/cameras_external_state.cc:193
2021/09/19 22:31:56.287 5246 5289 Error native third_party/arcore/ar/infrastructure/cameras_async.cc:162
2021/09/19 22:31:56.287 5246 5289 Error native third_party/arcore/ar/infrastructure/android_data_source.cc:635
2021/09/19 22:31:56.287 5246 5289 Error native third_party/arcore/ar/core/session.cc:1762
2021/09/19 22:31:56.287 5246 5289 Error native 
2021/09/19 22:31:56.287 5246 5289 Error native ################### Undecorated Trace End  #################
2021/09/19 22:31:56.287 5246 5289 Error native 
2021/09/19 22:31:56.287 5246 5289 Error native session_manager.cc:115 ArPresto::ArSession_update failed with status -2.

This seems not to happen when I disable the GestureProvider.
I could not find the sources for the SDK so I could not dig further.
If anyone has any idea, it would help a lot.

Photo with GestureProvider enabled:
No description available.

Photo with GestureProvider disabled:
No description available.

Thanks.

Link to comment
Share on other sites

Hi @RRob

Can you please share the full adb log? I would suspect that hand tracking plugin doesn't detected arcore and thus getting camera stream using ndk camera, not from arcore apis.

Although you may have done this, please make sure you follow the instructions in the ARFoundation sample to replace "AR Session" and "AR Session Origin" game object with latest version.

Can you please also try Unity LTS versions? I have previously tested on 2019.4 and 2020.3 which should work fine. I'll check if I can reproduce this on my side.

Link to comment
Share on other sites

Hey @zzy

I've tried with 2020.3.11f1 as I already had it installed and had the same result.
My phone is a Xiaomi P20 Pro in case that matters and also tried with a Samsung A50, both of which are on the ARCore supported list.
I've recreated the project and attached it together with two logs from the P20Pro. One where there is no XR Provider set and one where ARCore is set.
I see that there is a camera error when transitioning from reconfiguring to capturing.
AnotherARProject.rar


Thank you for the help.

ARCoreXRProvider.txt NoXRPluginProvider.txt

Edited by RRob
Link to comment
Share on other sites

  • 4 weeks later...

Hi @RRob

Sorry for the late reply, I just got some time to test this.

Indeed the ARCore failed to start on my side. It seems that ARCore is taking more than 1 frame to start. Hand Tracking starts before ARCore and thus occupying the camera.

A quick way to fix this is that, you can disable GestureProvider script in your scene. You can add a script to wait until ARCore is started, and then enable GestureProvider script.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...