Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Lag when switching between editor windows

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

  1. NiceNChrispy

    NiceNChrispy

    Joined:
    Aug 1, 2017
    Posts:
    3
    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.
     
    RED_Spot likes this.
  2. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    436
    Thank god, I am not alone! I have been working with unity every day for over a year and it just started doing this.

    Same problems, when changing focus to different parts of the editor's UI the editor becomes unresponsive for +-10 seconds.

    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: Mar 16, 2020
  3. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    56
    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:
    436
    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:
    56
    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:
    84
    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:
    7
    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:
    56
    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. NiceNChrispy

    NiceNChrispy

    Joined:
    Aug 1, 2017
    Posts:
    3
    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:
    3
  12. FarmerBilly

    FarmerBilly

    Joined:
    Jun 23, 2013
    Posts:
    4
    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,
     
    RED_Spot 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!
     
    RED_Spot likes this.
  14. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    56
    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:
    111
    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:
    43
    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:
    43
    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:
    7
    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:
    126
    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] ==
     
  20. tng2903

    tng2903

    Joined:
    Apr 8, 2013
    Posts:
    38
    just another heads up, I have this problem as well on OSX, and logging out of my account in Unity editor solve the issues for me.

    here is the reference source
    https://answers.unity.com/questions/1421084/unity-editor-stuttering.html

    one downside is that you can't enable Unity services anymore but that's not an issue with me since there is better alternative :D
     
  21. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,075
    Is this still an issue? I am getting the "wait chain waiting for network i/o" issue and I happen to have an oculus. It seems to happen whenever I leave Unity alone for a while to alt tab or something. I am currently using 3.0f3. I don't have my oculus plugged in, but the OSVR service and whatnot were still running up until just a few minutes ago.

    I disabled them all after seeing this thread.
     
    Last edited: Feb 18, 2018
  22. dmarfurt

    dmarfurt

    Joined:
    Apr 28, 2013
    Posts:
    9
    Hi, I'm also still seeing this issue in 2017.4.3f1. I've disabled oculus processes but I'm still getting heavy stuttering just navigating the scene view. It goes back to normal once it's loaded the whole scene. Typically this behavior occurs right after making a build. Could that be it?
     
  23. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    1,075
    Mine was a mix and match of the running "Nvidia Containers" that showed up when starting a game along with the overlay, Windows Defenders "Realtime Protection" needing to be turned off, as well as the Oculus stuff. After having handled those I have not had a single performance issue since my post up there.
     
  24. rawalanche

    rawalanche

    Joined:
    Aug 26, 2017
    Posts:
    20
    Hi, has there been any progress or solution on this? Having Oculus service running still freezes Unity editor window for about 5 seconds every time you focus it. That makes it very painful when going back and forth between Unity and IDE.

    Manually stopping Oculus service does help, however that's not really a solution.
     
  25. AgileLens

    AgileLens

    Joined:
    Mar 5, 2019
    Posts:
    10
    Bump! Still having this problem in 2019.1
     
    Last edited: Jun 1, 2019
  26. matbean

    matbean

    Joined:
    Mar 5, 2015
    Posts:
    4
    And I have the same problem too. 2019.1.6f1
     
  27. mikef

    mikef

    Joined:
    Apr 2, 2009
    Posts:
    56
    Any updates on this? its been happening for years now. Really annoying to be constantly waiting for unity to respond, sometimes up to several minutes for a single click
     
  28. zwcloud

    zwcloud

    Joined:
    Mar 15, 2016
    Posts:
    344
    workaround:
    Disable Auto Refresh in the preference. Use Ctrl+R to refresh manually.
     
  29. jj-unity

    jj-unity

    Unity Technologies

    Joined:
    Jan 4, 2017
    Posts:
    56
    Apologies, hadn't checked this thread in some time. This issue should have been fixed in a Windows 10 update almost 2 years ago. Are folks who are still seeing this on old versions of Windows?
     
  30. Berbatho

    Berbatho

    Joined:
    Aug 24, 2017
    Posts:
    1
    Hello dears,

    Got the same issue as everybody else on this thread, and nothing really worked for me.
    Windows 10, working on Oculus Quest and Unity 2019.2.12.f1
     
    zaffre likes this.
  31. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    436
    I'm on 2018.4.15f1 and the UI still freezes very often. I think it stopped for a while but I'm not sure maybe I just got used to it.... but lately I came back with a vengeance.
     
  32. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    299
    This still happens to me on and off, when it happens it is the most frustrating thing ever. using 2019.4.1 and most recent windows updates.

    Also when clicking on certain gameobjects in scene that have GI enabled, the editor becomes unresponsive for a good 5 seconds . This doesn't seem to be related to the first issue, because this happens all the time where as the unresponsiveness mentioned in this thread isn't always happening.
     
  33. chaneya

    chaneya

    Joined:
    Jan 12, 2010
    Posts:
    416
    I also have a lag delay happen intermittently when I change focus to any other program and then come back to Unity. Once I refocus on Unity, the little timeout spinner spins for 5 - 10 seconds for no reason. I'm on the latest Windows 10, Unity 2019.4f1. It seems to have something to do with how much time I spend in the other program. If I spend several minutes looking at code in Visual Studio and then come back to Unity, I get the dreaded spin delay before I can use the Unity Editor. I don't recall noticing this being this bad before.
     
    BigRookGames likes this.
  34. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    299
    Yeah, I get that too. I get a large delay when selecting a gameobject that is set to GI lightmap if there are more than 40,000 light probes in the scene for some reason, i get about 5 second pause if i select a game object that has more than a few materials on it, I get a pause when coming back from another window, I get a 3-5 second pause when clicking the GI drop down if it is set to lightmap, i get another 5 second delay when i select probelights before it becomes active. I get a 5 second delay when hitting stop generate lighting. I get a 3 second pause when I select a gameobject that is set to Contribute GI before the dropdown appears. I feel like i should record and time it, I bet the actual work time is less than 50%.
     
  35. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    159
    Ive just started getting this in 2019.3.7f1, done a full clean install, bought an asset cleaner in the hopes my folder just got to big, about to try to update to LTS and pray that fixes it but I had issues with my characters falling halfway through the terrain last time I went for the move anyway I started getting the odd random crash a week or two ago, and now its constant and after its hung a few times it will eventually just not recover. Absolute nightmare, any ideas on a solution?

    Windows10pro fully up to date and no recent driver updates. only usb devices are a zalman zm-m401r mouse and a focusrite 2i2, Unplugging the soundcard hasn't made a difference :(

    Edit, I do run all my devices through repeaters though, but thats never caused a problem with anything in the past.
     
    Last edited: Aug 1, 2020
  36. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    159
    Moving to LTS Did not fix the problem sadly :( Its pretty much made my project unusable atm and the lags make it dangerous to do any form of sorting as ive ended up with Objects getting moved all over my scene :( It doesn't matter what I select either
     
  37. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    299
    hmm yeah it can be frustrating. What are you referring to about the asset cleaner? What is it called?
     
  38. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    159
    Asset hunter pro, but that just tidies up your project folder, and mine was getting a little out of hand, sadly didn't resolve the problem though.
     
  39. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    159
    So the problem has gone away as fast as it began and not a clue why, I do know have the items in my project have been moved all over the place, settings changed and items deleted. Wonder if its all the clicks that were out side of unity getting picked up or Ive been hacked :p Either way back to work, not a clue a what caused the problem though, or what fixed it.
     
  40. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    159
     
  41. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    299
    That is consistent with my experience as well, some days it seems to happen and other days not. When you say "turning on logging" are you referring to the "Use Player Log" checkbox in the "Resolution and Presentation" section of the Player in Project Settings?
     
  42. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    159
    Don't say that I was hoping it wouldn't come back to haunt me :p Erm no it was the "-logfile" command added to the launch options in unity hub.
     
    BigRookGames likes this.
  43. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    4,943
    yes it is still happening on 2020.1.17 with latest windows 10 pro auto updated.
    case 1291630
     
unityunity