Search Unity

  1. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  2. Unity 2017.1 is now released.
    Dismiss Notice
  3. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  4. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

Lag when switching between editor windows

Discussion in 'Editor & General Support' started by SlientSupernova, Aug 9, 2017.

  1. SlientSupernova

    SlientSupernova

    Joined:
    Aug 1, 2017
    Posts:
    2
    Up until yesterday Unity was working fine, but now there is about a 6-8 second wait when switching windows for me to be able to then interact with objects within that window. For instance, say I've just done something in the inspector and click the scene view. I click, wait 8 seconds then have full, lag free use of the scene view. But then have to repeat that process when clicking onto another editor window.

    This is the same for all projects no matter what version of Unity. After looking online I've tried the following
    - Forcing opengl
    - Updating drivers
    - Switching to DX9 in player settings

    All to no avail, so I'm open to any suggestions as to how I might get around this problem. Again I've never experienced this issue until yesterday, no errors, no warnings. Created new projects, same problem. Nothing out of the ordinary in Task Manager either.
     
    dpbsound likes this.
  2. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    92
    Thank god, I am not alone! I have ben working with unity every single for over a year and it has just started doing this for me too.

    Same problems, when changing focus to different parts of the editor there is a complete UI freeze for 6-10 seconds. The UI becomes completely unresponsive. It happens when changing focus to different window groups ie.: (with the default layout) Scene, Game and Asset store are one group, Hierarchy another, Project and Consoles are a group and Inspector is the final group.

    Switching between items within a group doesnt cause any issue but the minute you click another group there is a delay were even the group you were just woring into is frozen. Clicking the File/Edit/etc menu does not cause a freeze but does become unresponsive when the UI is frozen.

    I have tried:
    -Complete uninstall of Unity, Visual Studio and Mono Develop. Including all folders (installation, temp, appdata, etc..), registries have been cleaned and whatever plugins each of them may have had were uninstalled.
    -Installed windows updates
    -Did a full virus scan including a scan from a rescue disc
    -Ran a defrag on all drives
    -Updated video drivers from AMD
    -Disabled my onboard intel display adapter
    -Tried forcing opengl and a different directx level
    -I tried Analyzing the wait chain which shows 3 unity.exe proceses and it says: One or more threads of Unity.exe are waiting to finish network I/O but nothing specific shows up during the freezes.

    Reinstalled the latest unity version, created a new empty project and BAM same problem.

    Its unworkable. I have not been able to do a single bit of usefull work in unity for several days.

    PLEASE HELP!

    And before someone suggest reinstalling windows, everything else is working fine: Blender, Max, Photoshop, all my games NO HICCUPS anywhere. Even Unity works great as long as I don't switch window group within the app.

    It's a really weird problem.
     
    Last edited: Sep 1, 2017
  3. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    9
    We believe this might be some interaction between Unity, the Oculus 1.17 runtime, and certain USB devices. We're looking into a fix now. For me personally, I had a USB audio interface that was causing some form of conflict. Unplugging it fixes the issue for now, but we hope to have a better solution soon.
     
    tcz8 likes this.
  4. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    92
    Thank you so much for that post. I do have an oculus, i'll run some tests and update if I find a workaround.
    If you would like me to try anything on my system let me know.
     
  5. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    9
    The current workarounds are to either figure out which USB device is causing the pause by process of elimination and unplug it, or to temporarily disable the 'Oculus VR Runtime Service' service while using Unity. I'll follow up once we have a better solution in place.
     
  6. andrzej_

    andrzej_

    Joined:
    Dec 2, 2016
    Posts:
    3
    For fox sake ... I was close to reinstalling the whole system today. Tried everything, including clean reinstall of all drivers, Unity versions and so on ... I would have never figured out that was Oculus/USB issue. For me it wasn't only switching windows, but it was practically every operation inside Editor ... right click... wait 5 seconds ... move cursor ... wait 5 seconds ...

    If this helps some specs:
    Windows 10, latest Nvidia drivers, Unity 5.6 and 2017 both behaving like this and YES! killing the Oculus process did fix the issue.
     
  7. Nykster

    Nykster

    Joined:
    Jan 16, 2015
    Posts:
    3
    On my side I think the issue started when I added a 3rd oculus camera/sensor (with usb extender cable).
    I kept it plugged in but I stopped all oculus related processes on my pc and Unity ran fine.
    Thanks for the tip!
     
  8. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    9
    It could also have just been timing. Updates to the Oculus 1.17 runtime happen automatically, and yours may have updated right around the time you added that 3rd Oculus tracker. The other possibility is that if your USB extender is active, it might be one of the devices that is slow to enumerate.

    Here's the gist of the issue:

    When Unity starts up, it enumerates the USB devices connected to the system so that it can find input devices, etc. It also does this enumeration when Windows sends Unity a message telling it that USB devices have been added or removed. With a small subset of USB devices, this enumeration takes longer than it should, resulting in that 5-10 second pause, where it should be instant or almost instant. We're still looking into whether this pause is avoidable on the Unity side when enumerating these devices.

    The new issue is that after the Oculus 1.17 runtime is installed, Unity is getting the message to re-enumerate USB devices every time that you click around the UI. If you click on a button in one panel, and then click in another panel, we're being told that the USB device configuration has changed. On most machines, that re-enumeration is fast. But on a small subset of machines, there's this pause in the editor. When the Oculus 1.17 runtime isn't installed, we aren't getting these spurious messages telling us that the device configuration has changed. We also don't see this issue with 1.16 and earlier versions of the runtime.

    So the current solution is to:

    A) find the offending USB device and unplug it when you're using Unity. In my case it was an external USB audio interface/headphone amp, but we're still tracking down which devices are causing these issues.
    - or -
    B) disable the Oculus VR Runtime Service by opening the Services app, finding the Oculus VR Runtime Service, right clicking on it and selecting Stop. You'll have to remember to re-enable it before using Oculus devices.
    - or -
    C) uninstall Oculus until we come up with a resolution to this issue.

    A or B are probably the easiest for most developers experiencing these editor pauses.

    We're actively looking into both a short term solution that works across all affected Unity versions, and a longer term solution that fixes the pause when enumerating USB devices that take too long to enumerate.
     
    sonofbryce, pwnd, Ragee and 1 other person like this.
  9. HappySlice

    HappySlice

    Joined:
    Nov 3, 2014
    Posts:
    17
    Yes, this problem must have started right when 1.17 was pushed, it makes so much sense in hindsight. I already had a third sensor plugged in -- but I did buy wireless USB headphones. Do you think opting in the Oculus beta build has any promise or are they not necessarily working on fix with you guys?
    Thank you so much for your response.
     
  10. SlientSupernova

    SlientSupernova

    Joined:
    Aug 1, 2017
    Posts:
    2
    Thanks for replying! So for me it was the oculus service. Stopped that and Unity was back to normal!
     
    HappySlice likes this.
  11. pwnd

    pwnd

    Joined:
    Mar 13, 2013
    Posts:
    1
  12. FarmerBilly

    FarmerBilly

    Joined:
    Jun 23, 2013
    Posts:
    3
    Hello, just checking in from the Oculus forum (I'm "rvpeterson" over there). Is there any status on the fix for this? I know it's probably not 100% Unity's fault, but it's seriously slowing VR development down, and pretty unworkable right now.

    Cheers,
     
    dpbsound likes this.
  13. DaToney

    DaToney

    Joined:
    Aug 16, 2017
    Posts:
    1
    I began having this issue after the 1.17 Oculus update, and I had both the HMD and sensor attached to the FL1100 USB 3.0 card. I was using Unity with the Oculus service stopped in order to continue using Unity. After seeing @FarmerBilly's solution over on the Oculus board, I moved my HMD from the FL1100 USB 3.0 to a USB 3.0 controlled by my motherboard. Unity is now working for me with the Oculus service running. Thanks to all for the info here!
     
    dpbsound likes this.
  14. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    9
    Oculus has released a temporary workaround on their end in the public test channel.

    https://forums.oculus.com/community...round-available-on-public-test-channel#latest

    https://support.oculus.com/help/oculus/200468603765391

    The issue is complicated, and we're still working with both Oculus and Microsoft on figuring out the best way to mitigate. It does seem to be limited to Windows 10 Creators Update onward.

    We have discovered that the underlying issue may be exposed by other applications as well, including certain desktop virtualization applications. So if you continue to see temporary editor freezes, the best workaround is still to isolate whichever USB device is enumerating slowly.
     
    sonofbryce and junglemason like this.
  15. sonofbryce

    sonofbryce

    Joined:
    May 19, 2009
    Posts:
    101
    Thanks for the explanation! This issue almost brought me to tears. Turned out it was a conflict with a FiiO USB headphone amp in my case. Unplugging it solved the problem, and stopping the service worked as well (but kinda useless for working on a VR project).

    At first I thought it was just a problem with 2017.1 since I updated at the same time I ran into this problem. Good grief, what a headache.

    I may try the Oculus beta build to see if that fixes the issue altogether.
     
  16. pdq72

    pdq72

    Joined:
    Sep 29, 2013
    Posts:
    34
    I have the 3 sensor oculus sensor setup for room scale VR. The 3rd sensor was plugged into a USB2 port. Moving the 3rd sensor to a USB3 port solved the issue for me. I have been working in Unity now for 2 days since the move. So far so good. I never quite understood why Oculus recommended 2 sensors to be on USB3 and the 3rd can be on USB2. Perhaps all three sensors should be on USB3. Motherboard is an MSI Z270 SLI. I had this problem on both Unity 5.6.2 and 2017.1 by the way.
     
    sonofbryce likes this.
  17. pdq72

    pdq72

    Joined:
    Sep 29, 2013
    Posts:
    34
    Well after a couple more days. It seems I am back to getting lag. Does not seem as bad, but it has clearly come up. I might unplug the 3rd sensor all together and see what happens.
     
    sonofbryce likes this.
  18. PeteS

    PeteS

    Joined:
    Aug 1, 2012
    Posts:
    5
    Below is a link to the fix i used and it worked for me, hope it helps others here. I had this issue on different version of unity from 5.6 to 2017
    https://forums.oculus.com/developer...g-on-window-focus-changes-in-oculusvr-1-17/p2

    I moved my HMD USB 3.0 from the FL1100 (3.8.33709.0) to a USB 3.0 on my motherboard, and that solved it. My 2 sensors are on the FL1100 USB 3.0 and my HMD is on the ASRock motherboard USB 3.0, Unity is working fine now.

    I had Oculus USB issues for over a year now my sensors connect disconnect randomly i tried all the fixes i found (power bios and other settings) got the recommended USB 3.0 PCI it had 3 things plug into it and still i get a disconnect and quick reconnect. Now i have only the 2 sensors on the dedicated PCI card due to the OVRService and unity issues.
     
    Last edited: Sep 9, 2017
  19. pan-master

    pan-master

    Joined:
    Nov 11, 2013
    Posts:
    90
    after the newest Oculus Update 1.18 Unity crashes when I hit play.

    Unity Editor [version: Unity 2017.2.0b2_a9976befbe0f]

    Unity.exe caused an Access Violation (0xc0000005)
    in module Unity.exe at 0033:406f3da7.

    Error occurred at 2017-09-11_231014.
    C:\Program Files\Unity 2017.2.0b2\Editor\Unity.exe, run by Dev.
    62% memory in use.
    12232 MB physical memory [4578 MB free].
    24520 MB paging file [13218 MB free].
    134217728 MB user address space [134212694 MB free].
    Read from location 00000110 caused an access violation.

    Context:
    RDI: 0x005fb178 RSI: 0x00000000 RAX: 0x63dfe960
    RBX: 0x00000000 RCX: 0x00000000 RDX: 0x005fb178
    RIP: 0x406f3da7 RBP: 0x005fb1b0 SegCs: 0x00000033
    EFlags: 0x00010202 RSP: 0x005fb0d0 SegSs: 0x0000002b
    R8: 0x00000000 R9: 0x00000000 R10: 0x00000001
    R11: 0x63dfe960 R12: 0x00000005 R13: 0x05560990
    R14: 0x38614cf8 R15: 0x00000004

    Bytes at CS:EIP:
    48 8b 81 10 01 00 00 48 85 c0 74 65 8b 40 18 83



    Module 1
    C:\Program Files\Unity 2017.2.0b2\Editor\OpenRL_pthread.dll
    Image Base: 0x80000000 Image Size: 0x0000f000
    File Size: 42496 File Time: 2017-07-03_175346
    Version:
    Company: Open Source Software community LGPL
    Product: POSIX Threads for Windows LPGL
    FileDesc: MS C 32 bit
    FileVer: 2.9.0.0
    ProdVer: 2.9.0.0

    Module 2
    C:\Program Files\Unity 2017.2.0b2\Editor\OpenRL.dll
    Image Base: 0x80000000 Image Size: 0x00c30000
    File Size: 12654592 File Time: 2017-07-03_175346
    Version:
    Company: Imagination Technologies, Inc.
    Product: OpenRL™
    FileDesc: OpenRL™ Library
    FileVer: 1.5.100.0
    ProdVer: 1.5.100.0

    Module 3
    C:\WINDOWS\SYSTEM32\xinput1_3.dll
    Image Base: 0x00400000 Image Size: 0x0001e000
    File Size: 107368 File Time: 2007-04-04_185422
    Version:
    Company: Microsoft Corporation
    Product: Microsoft® DirectX for Windows®
    FileDesc: Microsoft Common Controller API
    FileVer: 9.18.944.0
    ProdVer: 9.18.944.0

    Module 4
    c:\program files\nvidia corporation\nvstreamsrv\detoured.dll
    Image Base: 0x0f000000 Image Size: 0x00006000
    File Size: 18880 File Time: 2017-08-18_063614
    Version:
    Company:
    Product:
    FileDesc:
    FileVer: 0.0.0.0
    ProdVer: 0.0.0.0

    Module 5
    C:\WINDOWS\SYSTEM32\MSVCR100.dll
    Image Base: 0x5fe00000 Image Size: 0x000d2000
    File Size: 829264 File Time: 2011-06-11_011538
    Version:
    Company: Microsoft Corporation
    Product: Microsoft® Visual Studio® 2010
    FileDesc: Microsoft® C Runtime Library
    FileVer: 10.0.40219.325
    ProdVer: 10.0.40219.325

    Module 6
    C:\WINDOWS\SYSTEM32\MSVCP100.dll
    Image Base: 0x5fee0000 Image Size: 0x00098000
    File Size: 608080 File Time: 2011-06-11_011538
    Version:
    Company: Microsoft Corporation
    Product: Microsoft® Visual Studio® 2010
    FileDesc: Microsoft® C Runtime Library
    FileVer: 10.0.40219.325
    ProdVer: 10.0.40219.325


    == [end of error.log] ==