Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Instant Preview not working in HelloVR demo with Pixel 2

Discussion in 'Daydream' started by millefoliumink, Apr 23, 2018.

  1. millefoliumink

    millefoliumink

    Joined:
    Aug 28, 2014
    Posts:
    139
    As stated, I'm finding the documentation of Daydream View 2 absolutely infuriating.

    I go through the instructions step by step to test Instant Preview on the HelloVR Demo Scene:

    -Android platform selected
    -Android version to Nougat 7.0
    -VR for Daydream enabled in Player Settings
    -USB Debugging enabled on phone
    -USB plugged in and set file transfer (as opposed to charging only)

    Press play in the editor and receive:
    "Virtual Reality SDK Daydream is not supported in Editor Play Mode. Please Build and run on a supported target device.
    Attempting to enable None instead."

    With "Daydream Instant Preview" stating "Not connected to Editor"

    I can't figure out what the issue is here, no other HMD SDK has given me this amount of grief.

    Unity 2017.3.1f1, Android 8.1 on Pixel 2, GVR SDK for Unity v1.130.1
     
  2. millefoliumink

    millefoliumink

    Joined:
    Aug 28, 2014
    Posts:
    139
    Additional:

    After upgrading to recommended 2014.4.1f1, installing the newest version of Java, acquiring newest Android SDK with updates, the problem persists.
     
  3. derekrocco

    derekrocco

    Joined:
    Mar 27, 2018
    Posts:
    4
    Hi,

    Sorry you're running into frustrating problems :( We'll update the documentation once we can triage this issue.

    I ran into an issue setting up my own development environment when I installed JDK 10, and fixed it by installing JDK 8. I believe JDK 9 works now as well (but I'd try JDK 8 just to be certain). Also verify that Unity is using the right versions under `Unity > Preferences > External Tools > [SDK / JDK]`. I'm using android-24 for my SDK and jdk1.8.0_161.jdk for my JDK.

    As a sanity check, once you've verified all that is working, can you build a general Android app in an empty scene with no Daydream components and get it running on your phone?

    If that doesn't work, so we can try to set up a similar environment to yours, which OS are you using for your computer?
     
  4. Triton_Farms

    Triton_Farms

    Joined:
    Jun 25, 2015
    Posts:
    1
    Can you verify that USB debugging is enabled on your phone? If that's the root cause of these errors, it might be a straightforward fix. You can enable USB debugging in your phone's Developer Options settings.

    This makes me think that you've got everything set up correctly in Unity, and it's now just a matter of making USB debugging work on your phone.

    As an aside, also double-check that your system environment variables include the path to your Android SDK's platform tools folder that contains the Android debug bridge (adb) executable.
     
  5. millefoliumink

    millefoliumink

    Joined:
    Aug 28, 2014
    Posts:
    139
    Hi thanks for your reply, I appreciate the help.

    After restarting multiple times Instant preview is kind of working but the connection persistently drops and then reconnects whilst running at a very low framerate (with vsync turned off) in a near to empty scene (one canvas with button, one sphere with OnPointerEnter trigger event to change material colour).

    Environment is Windows 10 Home edition, NVIDIA 840m graphics card with Intel i7-5500U CPU 2.40ghz and 16GB ram, not the most powerful machine but it worked fine with the Oculus DK1.

    I'll attempt to build a Daydream apk with the near empty scene and if the problem persists a non-vr empty scene to see whether the problem is tied to Daydream.

    I've made multiple apps in the original software/sdk setup prior to updating Unity/Java/Android, both generic Android and Gear VR with no problems.

    Thanks for your reply.

    Debugging is permanently enabled as I use the phone to develop non-VR apps via Unity Remote with no issues.

    I'll attempt to build the near empty scene and run directly from the phone and see what happens to check whether the problem is solely Instant Preview or something deeper.
     
    Last edited: Apr 26, 2018
  6. ashleyh_unity

    ashleyh_unity

    Unity Technologies

    Joined:
    Feb 13, 2017
    Posts:
    1
    Just thought I'd add that I bought a Pixel 2 & Daydream today for testing, and have come across the same issue. Managed to get a short session to persist over WiFi, but it wasn't great. Simply can't get USB connection to work at all. Like the original poster, my USB connection is otherwise fine, I can install APKs and use Unity Profiler no problem.
     
    millefoliumink likes this.
  7. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Oh man, am I glad I checked this thread before diving back in tonight. Spent a few hours frustratingly trying to build the demo scene in a Daydream app last night and couldn't get it working right. Instant Preview wouldn't connect at all, through USB or WiFi, and building to the device would load the app, but nothing seemed to be working (no gyro movement for head, no stereoscopic view).

    Following this thread hoping for any updates on anyone that finds fixes!
     
    millefoliumink likes this.
  8. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    @ashleyh_unity Any further insight into what's going on here? Even if it's just whether it's on Google's end or Unity's?
     
    millefoliumink likes this.
  9. millefoliumink

    millefoliumink

    Joined:
    Aug 28, 2014
    Posts:
    139
    I've had absolutely no luck getting it to work, not great representation for their flagship phone.

    Tried several cables variations of Java and Android SDK etc. nothing makes it happy.

    The Editor emulator also absolutely hates when there's a Windows update pending in the background.
     
    Last edited: Jun 19, 2018
  10. millefoliumink

    millefoliumink

    Joined:
    Aug 28, 2014
    Posts:
    139
    I've had this with Windows Updates pending but even when you get it to work the signal flickers so badly it is very much unusable, the controller doesn't detect colliders due to the inconsistency, it builds and works perfectly fine on Pixel 2 though.
     
    Last edited: Jun 19, 2018
  11. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    958
    If you can, can those on this post provide the following information:

    JDK Version
    Installed Android SDK Version
    Target Device
    Unity Version
    Anything else you might think is relevant to your environment.

    Thanks.
     
  12. millefoliumink

    millefoliumink

    Joined:
    Aug 28, 2014
    Posts:
    139
    Hi Joejo, I have the following

    JDK Version: jdk1.8.0_131
    Installed Android SDK Version: tools_r25.2.5
    Target Device: Pixel 2, Android 8.1.0
    Unity Version: 2017.4.1f1

    Anything else you might think is relevant to your environment:

    - Daydream utility apps on phone have been uninstalled reinstalled and are up to date

    - No other apps running in background

    - Pending Windows updates stop all Daydream USB communication with Pixel 2, it suggests the phone doesn't even have a USB plugged in, however file transfers work just fine

    - May be worth checking out the Unity Editor refreshing problem many have been hit with, my work around has been to disable Auto-refresh, this issue appeared in 2017.4.1f1 and updating did not help
     
  13. barkest

    barkest

    Joined:
    Aug 7, 2017
    Posts:
    44
    I am pretty new with all of this but making sure the main camera had a main camera tag and that the instant preview app on the phone was active solved my 'non running' issue
     
    europeanrich likes this.
  14. GridWanderer

    GridWanderer

    Joined:
    Dec 14, 2014
    Posts:
    12
    Same with Pixel 2 XL.

    Console:

    Instant Preview Version 1.1.1

    Device supports positional tracking!

    Connected to Instant Preview.

    error: protocol fault (couldn't read status): Connection reset by peer

    Failed to setup port forwarding. Exit code 1 returned by process: CMD.exe /k adb forward tcp:7003 tcp:7003 & exit
    error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
    could not read ok from ADB Server
    * failed to start daemon *
    error: cannot connect to daemon
    at Gvr.Internal.EmulatorClientSocket.setupPortForwarding (Int32 port) [0x0011d] in C:\Neverland\FollowLeo\Assets\GoogleVR\Scripts\Controller\Internal\Emulator\EmulatorClientSocket.cs:159
    at Gvr.Internal.EmulatorClientSocket.phoneConnect () [0x00039] in C:\Neverland\FollowLeo\Assets\GoogleVR\Scripts\Controller\Internal\Emulator\EmulatorClientSocket.cs:97
    at Gvr.Internal.EmulatorClientSocket.phoneEventSocketLoop () [0x00017] in C:\Neverland\FollowLeo\Assets\GoogleVR\Scripts\Controller\Internal\Emulator\EmulatorClientSocket.cs:73
     
    millefoliumink likes this.
  15. jonathan-small

    jonathan-small

    Joined:
    Oct 8, 2018
    Posts:
    1
    Has this been resolved by anyone? First time developing with Daydream so maybe I'm doing something wrong. I can make a build to device but would rather not have to do so every time I want to check something. Instant Preview would greatly increase iteration time.

    Specs:

    Windows 10 and Google Pixel 2 with Daydream View

    The problem:

    It seems that as soon as I press Play, the grey bar in Daydream Instant Preview will go from "Press PLAY in Unity or unreal editor to stream:" to a red "Not connected to editor." Upon unplaying the unity editor, it will return to grey.

    Console:

    Virtual Reality SDK Daydream is not supported in Editor Play Mode. Please Build and run on a supported target device.
    Will attempt to enable None instead.

    Instant Preview Version: 1.1.1
    UnityEngine.Debug:Log(Object)
    Gvr.Internal.InstantPreview:Start() (at Assets/GoogleVR/Scripts/InstantPreview/InstantPreview.cs:162)

    Failed to setup port forwarding. Exit code 1 returned by process: CMD.exe /k adb forward tcp:7003 tcp:7003 & exit
    ADB server didn't ACK
    * failed to start daemon *
    error:
    error:

    at Gvr.Internal.EmulatorClientSocket.setupPortForwarding (Int32 port) [0x0011d] in C:\Users\Public\Documents\Unity Projects\Submarine\Assets\GoogleVR\Scripts\Controller\Internal\Emulator\EmulatorClientSocket.cs:159
    at Gvr.Internal.EmulatorClientSocket.phoneConnect () [0x00039] in C:\Users\Public\Documents\Unity Projects\Submarine\Assets\GoogleVR\Scripts\Controller\Internal\Emulator\EmulatorClientSocket.cs:97
    at Gvr.Internal.EmulatorClientSocket.phoneEventSocketLoop () [0x00017] in C:\Users\Public\Documents\Unity Projects\Submarine\Assets\GoogleVR\Scripts\Controller\Internal\Emulator\EmulatorClientSocket.cs:73
    UnityEngine.Debug:LogWarningFormat(String, Object[])
    Gvr.Internal.EmulatorClientSocket:phoneEventSocketLoop() (at Assets/GoogleVR/Scripts/Controller/Internal/Emulator/EmulatorClientSocket.cs:76)


    Thanks!
     
  16. millefoliumink

    millefoliumink

    Joined:
    Aug 28, 2014
    Posts:
    139
    No, still waiting on this.
     
  17. danieltomasini

    danieltomasini

    Joined:
    Jul 18, 2018
    Posts:
    1
    I have the same issue: compiling takes a very long time and instant preview is not working. I bought a Lenovo Mirage Solo, made a system update the first night, downloaded last Unity version 2018.1.6, update Android SDK to last version. Instant preview is not working, sometimes the system is not able to install it, and sometimes it crashes. Unity + Android SDK + Google VR + JDK = a shambles.
     
  18. shaunix

    shaunix

    Joined:
    Sep 13, 2017
    Posts:
    1
    Still no Instant preview working for the Mirage Solo and even the compiled HelloVR doesn't seem to work for me.

    Unity 2018..2.15f1
     
    mzthr78 likes this.