Search Unity

Touch Input Stutter on Windows (Unity 2019, fullscreen mode only)

Discussion in 'Windows' started by SerenityForge_dev, Oct 22, 2019.

  1. SerenityForge_dev

    SerenityForge_dev

    Joined:
    Jan 8, 2018
    Posts:
    4
    Hello,

    My team is working on several interactable installations running on Windows 10 machines that use touch monitor input. We are currently developing these projects in Unity 2019.1.10f1, and I think I've identified an issue specific to Unity 2019 that causes noticeable stutters each time certain touch input events are processed. I couldn't find any other threads reporting this problem, so I wanted to mention it here and see if anyone else has encountered this issue or has a solution. We are on a tight schedule and will likely have to downgrade our projects to Unity 2018.3 due to this if there are no immediate solutions.

    This problem occurs only in builds (not Editor) made in Unity 2019 on touch supported devices running Windows 10, and only in fullscreen mode. I have identified multiple stutters that can occur. Each time the user taps the screen, the application hangs for a fraction of a second while processing the touch event. I have also seen similar stutters upon touch "begin hold" and touch "up" events, though which of these occurs has been seemingly inconsistent across devices. All of these input stutters do not go away over time. As stated, this problem only appears to occur in fullscreen mode and not windowed mode. Even if I switch between fullscreen and windowed mode during the same session, the stutter only occurs when in fullscreen.

    I have done some testing to isolate this problem specifically to Unity 2019 and make sure it is not hardware or code related. For this, I created a simple test project with a UI Image box with a script that makes it move back and forth across the screen by deltaTime. The idea is that, when you tap the screen, you can see the moving box stutter and jump if this problem occurs. There is no code in this test project that uses the InputManager class (I am also not using the new InputSystem). So, I have to assume whatever is happening is on the system level or how Unity is interfacing with the system's touch inputs.

    I first created the test project in Unity 2018.3, built, and did not encounter the touch input lag on my test devices. I then upgraded the project to Unity 2019.1.10f1 and made another build, which did have the touch input stutter. I also encountered this stutter when building in 2019.2.8f1.

    Most of these tests were conducted on two separate Windows Surface Pros, although I also saw these results on a separate Planar touch monitor we have (model PXL2230MV). I don't think the issue is hardware response delays, as this stutter does not occur when testing the project within the Editor, in windowed mode, or when built from Unity 2018.

    I have linked the test builds I created, as well as the 2018.3.8f1 version of the Unity project.

    Build (2018.3.8f1, no touch input stutter): https://drive.google.com/file/d/1QaJ0Dxq2WAo2RJHG3fu-OBShm07bIwCa/view?usp=sharing

    Build (2019.1.10f1, touch input stutter): https://drive.google.com/file/d/1YYijwl137jYhwT3KNj4uISuskIzxAvMJ/view?usp=sharing

    Unity Project (2018.3.8f1): https://drive.google.com/open?id=1IxKmrxR19AstXPu-1n5avaLl4mgUREoR
     
  2. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    Hey,

    Thank you for reporting this problem and providing a lot detailed information. From your description I don't believe this is a known issue, and so will you please file a bug with Unity Bug Reporter so we can track this bug?

    I have a few follow-up questions:
    • I'm assuming you're building for WindowsStandalone, but does the issue also repro on UWP (assuming you can build for it)?
    • When running in Fullscreen, to be very clear, is this "ExclusiveFullscreen" Mode?
    • What Input system are you using: the "old" Unity InputManager, New Input System, or a 3rd party plug-in?
    • Could you please try building on a 2019.3 Beta release and see if the bug repros there?
    • What Graphics API are you using, e.g. D3D11 or D3D12?
    The fact it only repros in Fullscreen Mode is bizarre and makes me think it may be partially related to graphics and not just an input bug. If so it's possible the issue may have been fixed in 2019.3 and worth a check.

    Unfortunately, given your time constraint, I'm unsure we can publish a fix in time, but I would like to try and find a work-around.
     
  3. SerenityForge_dev

    SerenityForge_dev

    Joined:
    Jan 8, 2018
    Posts:
    4
    Thanks for the very fast reply! I will follow up on the remaining questions tomorrow. Some quick answers:

    - I have been building for "PC, Mac & Linux Standalone." I will test on UWP if I'm able
    - I have my fullscreen mode in PlayerSettings set to "Fullscreen Window," not "Exclusive Fullscreen." The "Windowed" toggle in the startup Resolution Dialog (or the Alt+Enter shortcut while running) affect this result. I can also test with Fullscreen Mode set to "Exclusive Fullscreen." We may end up switching to this option anyway for the final build.
    - I am using "Input Manager" under "PlayerSettings/Active Input Handling." I am not using new InputSystem or any third party input plugins in the project. As stated, I am not making any calls in C# scripts to InputManager.
    - Graphics API: D3D11
     
  4. SerenityForge_dev

    SerenityForge_dev

    Joined:
    Jan 8, 2018
    Posts:
    4
    I have been unable to test the build in UWP and ended up encountering a separate Unity Editor crash in 2019.2.8f1 (as well as a bug reporter error). Initially after installing UWP, I received a compile error which partially said ""the type 'IMECompositionMode' exists in both 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' and 'UnityEngine.InputLegacyModule." In trying to remedy this, I switched to Developer mode in Windows Update and Security Settings and closed Unity to restart it. However, Unity now crashes every time I try to load up this copy of the test project. I attempted to submit a crash report with the Unity Bug Reporter containing more details, but I am unable to submit the crash report due to an error dialogue after hitting submit: "Error occurred while creating an acrhive. Error code: file read filed." I could try to submit this report in a different manner if that would be helpful. I don't really have the time to debug this UWP issue more thoroughly in other Unity versions.

    I made another Windows Standalone test build in 2019.3.0b7, also using Fullscreen Window mode, and I can confirm the same problem exists. This is the test build I created: https://drive.google.com/open?id=1XvqiJwhKMIs4oImaDZUV07zfzF6ZijVC

    In 2019.3.0b7, I then made another build using Exclusive Fullscreen mode, and this one actually seemed to fix the problem. I am able to run it in fullscreen (alt+enter) without the touch input stutter. This is that test build: https://drive.google.com/open?id=1QOz1QgAOuEV-dgDu10Mm9siYx65VgaHL

    I also tried Exclusive Fullscreen in 2019.1.10f1, and there is no touch stutter there either.

    So, it appears that building in Exclusive Fullscreen should be a viable workaround for us. It looks like this touch stutter only occurs with "Fullscreen Window" when running fullscreen.

    I will submit a bug report about this and post here when it is up, assuming I'm able to submit.
     
  5. SerenityForge_dev

    SerenityForge_dev

    Joined:
    Jan 8, 2018
    Posts:
    4
    I am also unable to submit this bug report (related to the touch input bug) with the Unity Bug Reporter. I am reporting this from within Unity 2019.1.10f1. I receive the error: "Error occurred while creating an archive. Error code: file read failed."

    The written contents of the report are a summary of the information above:

    What is the problem related to: A problem with the Player
    How often does it happen: Always

    Title: Touch Input Stutter on Windows (Unity 2019, Fullscreen Window mode, fullscreen display only)

    Details:
    The Unity player experiences a touch input stutter on certain touch events (touch down, and possibly touch hold and touch released).

    See this forum thread for more info and links to builds which demonstrate the issue: https://forum.unity.com/threads/tou...019-fullscreen-mode-only.764774/#post-5092253

    The problem occurs in any version of Unity 2019, including 2019.3.0b7. This is in Windows standalone builds. These tests have primarily been conducted on Windows Surface tablets, but the issue appears to occur on other devices as well.

    Under ProjectSettings/Player/Resolution and Presentation, Fullscreen Mode must be set to "Fullscreen Window" (the problem does not occur when set to "Exclusive Fullscreen"). ProjectSettings/Player/Other Settings/Active Input Handling is set to "Input Manager." The Graphics API being used is D3D11. No C# scripts in the test project reference the InputManager class.

    Create a build, and run it in fullscreen mode (Alt+Enter, or uncheck "windowed mode" in the Resolution Dialog). Touch events should produce a noticeable stutter. I have been able to visualize this stutter by creating a simple UI Image box that moves back and forth quickly across the screen at a rate of Time.deltaTime. When the stutter occurs, the box briefly appears to stop moving and then jumps forward, indicating a frame rate stutter.

    The problem does not occur in the following situations: if the standalone application was built in Unity 2018, if Fullscreen Mode is set to "Exclusive Fullscreen," if the project is running in Editor, and if the application is running in windowed mode.

    Attachments
    Project folder: https://drive.google.com/file/d/1jrkdj9CcGZKBcMi8DL86K1I2fyewCtSw/view?usp=sharing
     
  6. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    Thank you for reporting the bug, I'm sorry you're having all of these issue (Bug Reporter errors...*sigh*). The UWP error is weird, but you right it's not worth spending time debugging.

    So this is good news, and I'm glad you're able to find a reasonable work-around. It also may be an important clue to figuring out the problem. Thank you again for your comprehensive testing and detailed info. It really makes bug investigations easier and faster.

    At this point someone from QA may contact you if they have questions or difficulty reproing the bug, and eventually the case should make it to our team. However, since you already shared a repro project, I'll take some time to look into it beforehand.