arcore-unity-sdk icon indicating copy to clipboard operation
arcore-unity-sdk copied to clipboard

Instant preview not connected to editor after first run

Open minnes09 opened this issue 7 years ago • 44 comments

I use the instant preview connected with USB. The first times I launch the application everything works fine, then suddenly the instant preview shows the "Not connected to editor" message and if I launch the project from Unity there is the warning: "Failed to acquire camera image with status ErrorNotYetAvailable". I´ve shut down everything with no success, then I´ve tried the day after and it worked perfectly the first time...then same problem again. I use Huawei p20 and Unity 2017.4 Any help would be appreciated! Thanks

minnes09 avatar May 14 '18 08:05 minnes09

I'm having the same issue on a OnePlus 3T. Was working yesterday. Now it isn't. My Unity version is 2018.1.0f2

CormacAsGaeilge avatar May 15 '18 16:05 CormacAsGaeilge

Same here with Samsung Galaxy S8 and Unity 2017.3.1f1

poi-oezd avatar May 17 '18 14:05 poi-oezd

After it stops working, can you try closing all instances of Unity, running adb kill-server and then trying again? The port Instant Preview uses sometimes gets held open.

gstanlo avatar May 23 '18 18:05 gstanlo

Same Here, didnt get it to work, never Last try: Galaxy s8 with Oreo, unity 2018.1.1f1

geeosp avatar Jun 08 '18 01:06 geeosp

Same issue on Moto g5s plus , had to restart both phone and PC for it to start working

suhas919 avatar Jun 20 '18 12:06 suhas919

@geeosp restarting unity or killing adb server didn't help?

gstanlo avatar Jun 27 '18 20:06 gstanlo

Yeah. The instant preview never worked on my Galaxy s8. Doesn't matter unity version. I usually try with the most recent version, sometimes on Beta. My problem is the Instant preview app does not recognize unity when running on editor. It recognizes that it is connected by cable, but nothing happens when I press the play button on. unity. Correction, the instant preview app restarts. That's all. It closes and reopens itself in the same screen. Never got to see the camera feed, or receive tracking data on unity editor

geeosp avatar Jun 27 '18 20:06 geeosp

Does the connection bar in the app appear red or grey? Which OS are you developing with?

gstanlo avatar Jun 27 '18 21:06 gstanlo

I am using Unity 2018.1.6f1 on a windows 10 machine. My S8 model is SM-G950FD, an international variant, it has not a qualcoom processor, its one manufactored by samsung. I really hope this is not the root of the problem. It runs Android 8.0.0 The bar appear in grey, but the camera do not stream to unity when I play in editor. The phone does recognize that Unity editor is open. after connected, the bar appears in grey. but When I press play, is like the app restarts. I have only visual feedback, but I will try to discribe the best: It appears to try to open a black fullscreen activity, an then reopens the initial screen with the grey bar, I said the app restarts, but I am not sure if the app closes itself in the process since it does not show the smartphone home screen. Seems like everything is happening inside the instant preview app. Compile the game and testing in the phone works fine. I know it is not a configuration problem because it works fine on a Nexus 6p I have here.

, On Wed, Jun 27, 2018 at 6:45 PM gstanlo [email protected] wrote:

Does the connection bar in the app appear red or grey? Which OS are you developing with?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unity-sdk/issues/206#issuecomment-400839199, or mute the thread https://github.com/notifications/unsubscribe-auth/AH8Ga7naFgoG-RQf8GEdB_e8gJJfMjeRks5uA_zwgaJpZM4T9W-8 .

geeosp avatar Jul 01 '18 11:07 geeosp

I got this issue too and need to restart both PC and my phone to make it work again

Connection bar was being red

Thaina avatar Jul 10 '18 11:07 Thaina

I was getting the "Virtual Reality SDK Daydream is not supported in Editor Play Mode" at first." The solution is to make sure that the Main Camera has the tag "MainCamera". By default, it is untagged. Once you select the "MainCamera" tag and hit play in the Unity Editor, the phone should start flickering and then enter Daydream Preview Mode (plain black screen) and start sending gyro data to Unity. Looking back in Unity, the rendered view should orient appropriately. Using Unity 2018.2.11f1 with GoogleVRForUnity_1.180.0 asset containing Instant Preview Version 1.1.1.

yxa9 avatar Dec 05 '18 13:12 yxa9

Same here with Huawei Nova 3i

bawantha avatar Feb 04 '19 07:02 bawantha

Pre-requisites:

  • Download and install the latest version of ARCore SDK for Unity
  • Make sure you've setup Unity's Android support: https://docs.unity3d.com/Manual/android-sdksetup.html
  • Verify (for troubleshooting) that adb is on your PATH: https://developer.android.com/studio/command-line/adb

If you run into problems with intermittent connectivity, a couple items worth checking:

  1. Verify that you have only one version of adb installed on system
  2. Verify that Android SDK path in Unity (Edit > Preferences > External Tools > Android SDK) is same location as one that your PATH environment points to for platform-tools/adb. Run which adb from a terminal window to verify.

In order to help troubleshoot intermittent issues, please try these steps when you see "Not connected to editor":

  1. Run adb devices and adb logcat to verify that your computer and device have a working USB connection
  2. Stop playback mode in Unity. Try running adb reconnect, then hit in Play mode again in the editor.
  3. Stop playback mode in Unity. Try running adb kill-server, then hit in Play mode again in the editor.
  4. Close Unity. Re-open Unity. Hit Play again

Please report back which step in any above worked.

fredsa avatar Feb 11 '19 23:02 fredsa

I have a pixel 3 running Android Version 9 I had very similar issues as those above. It was working fine a week ago, then it would only play on the unity preview and not the phone, and opened the Arcore instant preview app showing "press play in Unity editor to stream" in the little grey bar, and the unity editor view will show the ar camera view and work fine. a couple days ago it went completely non-functional and showed the "Not connected to editor" in red on the same bar. I have been bouncing between those last two levels of functionality, deleting all the android sdk files and deleting android studio, restarting both devices, and then reimplementing the sdk, and restoring it to the "press play in unity editor to stream" level of functionality.

I checked the adb in the command line , here was the output with unity editor open and android connected without playing anything, here is a sample line that may be relevant

02-14 11:28:46.868 19930 20002 W native  : anchor_node_tracker.cc:112 RemoveAnchorNode called with invalid input
02-14 11:28:46.957 19930 20002 I chatty  : uid=10157(com.google.ar.core.instantpreview) identical 26 lines
02-14 11:28:46.963 19930 20002 W native  : anchor_node_tracker.cc:112 RemoveAnchorNode called with invalid input
02-14 11:28:46.965 19930 19975 W native  : freak_compact_dataset_recorder.cc:88 Failed to create pose node: generic::failed_precondition: VIO is not tracking.

playing unity cloud anchors example:

02-14 12:14:22.610 14174 14245 I chatty  : uid=10157(com.google.ar.core.instantpreview) expire 5 lines

when I start the arcore part of the example:

02-14 12:14:23.058 14174 14214 I InstantPreviewConnection: onError: io.grpc.StatusRuntimeException: UNAVAILABLE
02-14 12:14:23.058 14174 14214 I InstantPreviewConnection: trying reconnect
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager: missed a cpu image
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager: com.google.ar.core.exceptions.NotYetAvailableException
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at com.google.ar.core.Session.throwExceptionFromArStatus(Unknown Source:100)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at com.google.ar.core.Frame.nativeAcquireCameraImage(Native Method)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at com.google.ar.core.Frame.acquireCameraImage(Unknown Source:6)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at com.google.ar.core.instantpreview.ARCoreUpdateManager.sessionProc(ARCoreUpdateManager.java:135)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at com.google.ar.core.instantpreview.ARCoreUpdateManager.bridge$lambda$0$ARCoreUpdateManager(Unknown Source:0)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at com.google.ar.core.instantpreview.ARCoreUpdateManager$$Lambda$0.run(Unknown Source:2)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
02-14 12:11:21.013 14174 14244 W ARCoreUpdateManager:   at java.lang.Thread.run(Thread.java:764)
02-14 12:11:21.021   947  2220 D GraphicBufferSource: got buffer with new dataSpace #104
02-14 12:11:21.021   947 14298 I OMX-VENC: get_config (dataspace changed): ColorSpace: Recommend 601-limited for RGBA8888
02-14 12:11:21.021   947 14298 D OMXNodeInstance: Codec resolved it to (R:2(??), P:3(??), M:3(??), T:3(??)) err=0(NO_ERROR)
02-14 12:11:21.022   947 14298 E OMXNodeInstance: setConfig(0xe6aa7404:qcom.encoder.avc, ??(0x7f000062)) ERROR: UnsupportedSetting(0x80001019)
02-14 12:11:32.396 14174 14222 W native  : pose_manager.cc:61 GetRecentDevicePose failed. generic::invalid_argument: Passed timestamp is too old. Latest VIO t:78040.7574084, latest IMU t:78040.9085913, query t:78037.9992634

mklitsner avatar Feb 14 '19 20:02 mklitsner

ok, so now it looks to be very project specific. I get the red "not connected to editor" in one project and the functional grey "press Play in Unity Editor to stream" in the above project, which was the one that it was originally working fine with

mklitsner avatar Feb 15 '19 00:02 mklitsner

using: Google Pixel XL, Android 9, Unity 2018.3.4f1

Just ran into the same problem, having Instant Preview on phone with the red label not connected to editor. After following @fredsa instructions it showed the device was connected to the computer. After restarting both my computer and my phone, the issue dissapeared ( @Thaina comment).

I'll be watching the app's behaviour for the next couple of days in case this issue happens again, like in OP's case.

HSAnais avatar Mar 11 '19 17:03 HSAnais

Thanks, @HSAnais.

If you encounter the issue again, see if restarting Unity only fixes the issues. The reason for this is that when you run Instant Preview for the first time after starting Unity, an Instant Preview process is started on your development machine. The easiest way to stop this process is to exit Unity.

Knowing whether restarting Unity works, and whether it works for you every time to resolve any issues, will help us zero in on the cause of the issue.

fredsa avatar Mar 11 '19 19:03 fredsa

One more note: Instant Preview currently does not support it being used in more than one running instance of the Unity editor at a time.

fredsa avatar Mar 11 '19 19:03 fredsa

10 months later and I decided to jump back in to see if there had been any improvement to this and I'm disappointed that it still seems to be an issue.

I'm now attempting to use instant preview on the default HelloAR Scene using the ARCore 1.7.0 package on Unity Version 2018.3.10f1 on a OnePlus 6T device.

I am hitting the same issue as many people in this thread,the Not connected to editor in red in the ARCore Instant Preview app. I have checked my adb version and checked to see if the device is visible and it is.

Has anyone been able to isolate exactly what is causing this issue?

CormacAsGaeilge avatar Mar 26 '19 20:03 CormacAsGaeilge

same issue

On Wed, 27 Mar 2019 at 01:50, CormacAsGaeilge [email protected] wrote:

10 months later and I decided to jump back in to see if there had been any improvement to this and I'm disappointed that it still seems to be an issue.

I'm now attempting to use instant preview on the default HelloAR Scene using the ARCore 1.7.0 package on Unity Version 2018.3.10f1 on a OnePlus 6T device.

I am hitting the same issue as many people in this thread,the Not connected to editor in red in the ARCore Instant Preview app. I have checked my adb version and checked to see if the device is visible and it is.

Has anyone been able to isolate exactly what is causing this issue?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unity-sdk/issues/206#issuecomment-476832581, or mute the thread https://github.com/notifications/unsubscribe-auth/AQShEXfGcPz0Q8pI7BCIirE96SMi7S3Fks5vaoEDgaJpZM4T9W-8 .

-- Regards,

Bawantha Rajapaksha Batch Representative (16' batch) Department of Computer Science and Engineering University of Moratuwa +94766414669

bawantha avatar Mar 26 '19 21:03 bawantha

@CormacAsGaeilge / @bawantha Can you clarify:

  1. Does Instant Preview work the first time?
  2. If it does work once, but stops working at some point, does it help to shutdown (all instances of) Unity, then restart Unity?
  3. When the failure to connect happens, do you see your Android devices in the output of adb devices?

Also, please try the above troubleshooting steps in https://github.com/google-ar/arcore-unity-sdk/issues/206#issuecomment-462532721 and report back.

fredsa avatar Mar 26 '19 22:03 fredsa

no, it's never worked for me when I used it 'Not connected to editor' get blinks again and again nothing happened

On Wed, 27 Mar 2019 at 04:01, Fred Sauer [email protected] wrote:

@CormacAsGaeilge https://github.com/CormacAsGaeilge / @bawantha https://github.com/bawantha Can you clarify:

  1. Does Instant Preview work the first time?
  2. If it does work once, but stops working at some point, does it help to shutdown (all instances of) Unity, then restart Unity?
  3. When the failure to connect happens, do you see your Android devices in the output of adb devices?

Also, please try the above troubleshooting steps in #206 (comment) https://github.com/google-ar/arcore-unity-sdk/issues/206#issuecomment-462532721 and report back.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unity-sdk/issues/206#issuecomment-476878282, or mute the thread https://github.com/notifications/unsubscribe-auth/AQShEW59PDfM9V-vzoNjDrV8F3p670BEks5vap-ygaJpZM4T9W-8 .

-- Regards,

Bawantha Rajapaksha Batch Representative (16' batch) Department of Computer Science and Engineering University of Moratuwa +94766414669

bawantha avatar Mar 26 '19 22:03 bawantha

@fredsa It does not work from the outset for me. Originally (10 months ago) it did but this is a new install of Unity, a new phone and a newer version of ARCore. I have tried restarting Unity, rebooting the PC and re installing Android SDK, adb and Unity.

As I said, I can see my device in adb and I have tried the quoted troubleshooting steps to no avail. I do have a second version of adb (part of NVPACK for UE4) but it is not referenced in either user or system variables, only the version of Android SDK that I have referenced in Unity has System Variables.

Would the second Android SDK (as part of NVPACK) be causing this issue? I would prefer not having to uninstall part of my dev environment for UE4 but if that's what is required I'll give it a go.

CormacAsGaeilge avatar Mar 26 '19 22:03 CormacAsGaeilge

@CormacAsGaeilge The only interference from another Android SDK (and thus different version of adb) that I'd expect is if that other version of adb has an active process running.

You can (on Windows) use the Task Manager to confirm there are no instances of adb process running. You can kill them there as well. You can also try adb kill-server to kill any running processes, but confirm all indeed have died using Task Manager.

fredsa avatar Mar 26 '19 22:03 fredsa

@CormacAsGaeilge I take it that the new phone is the "OnePlus 6T". Do you recall what make/model the old phone was?

@bawantha What make/model phone are you using?

Separately, question for both:

  • Does your development machine (laptop/desktop) have a separate ("discreet") GPU, or an integrated GPU?

fredsa avatar Mar 26 '19 22:03 fredsa

Checking Task Manager there is only one instance of adb running. I killed it and tried again. Still no luck.

Development Machine uses a discreet GPU, GTX 1070. Current device in testing is the OnePlus 6T. The previous device was the OnePlus 3T.

CormacAsGaeilge avatar Mar 26 '19 22:03 CormacAsGaeilge

Thanks, @CormacAsGaeilge. What the output of adb shell getprop ro.build.fingerprint with the 6T connected?

fredsa avatar Mar 26 '19 23:03 fredsa

The output is

OnePlus/OnePlus6T/OnePlus6T:9/PKQ1.180716.001/1901231231:user/release-keys

CormacAsGaeilge avatar Mar 26 '19 23:03 CormacAsGaeilge

mine Huawei nova 3i

On Wed, 27 Mar 2019 at 04:47, CormacAsGaeilge [email protected] wrote:

The output is

OnePlus/OnePlus6T/OnePlus6T:9/PKQ1.180716.001/1901231231:user/release-keys

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google-ar/arcore-unity-sdk/issues/206#issuecomment-476891115, or mute the thread https://github.com/notifications/unsubscribe-auth/AQShETLmPZQ3QON2rzLWmJt_Wq05iXNFks5vaqp_gaJpZM4T9W-8 .

-- Regards,

Bawantha Rajapaksha Batch Representative (16' batch) Department of Computer Science and Engineering University of Moratuwa +94766414669

bawantha avatar Mar 27 '19 04:03 bawantha

@fredsa Would there be a specific version of Unity and or ARCore that you would recommend to be the most stable? Maybe it's something to do with my specific pairing of Unity and ARCore.

CormacAsGaeilge avatar Mar 30 '19 12:03 CormacAsGaeilge