Search Unity

Bug Linux build not rendering correctly / not at all in 5.6.0xf1

Discussion in 'Linux' started by Odd-Redesign, Apr 6, 2017.

  1. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    I exported a test build today to record some gameplay, but the build is not working at all. Unity will render the Unity Logo and then either stay grey or draw a black screen. I can hear sound and walk around. After going into the ingame menu and hitting the button to activate windowed mode, the game becomes visible.

    Here's something I found in the Player.log:

    Code (CSharp):
    1. requesting resize 1920 x 1080
    2. Using native desktop resolution 1920 x 1080
    3. Clamping fullscreen resolution to 0 x 0
    4. requesting fullscreen 0 x 0 at 0 Hz
    5. Desktop is 1920 x 1080 @ 60 Hz
    That 0x0 doesn't look healthy. Might this be the issue?

    Changing to windowed mode logs the following:

    Code (CSharp):
    1. Desktop is 1920 x 1080 @ 60 Hz
    2. requesting resize 1920 x 1080
    3. resizing window to 1920 x 1080
    4. Desktop is 1920 x 1080 @ 60 Hz
    I also noticed that things that I calculate based on screen width (like font sizes) are also using the 0x0 resolution until they are getting calculated again while in windowed mode.

    This is critical for me, I don't want to build the game on windows again. 5.6.0. feels so incredibly stable, it would be sad for it to bug out in the build.
     
  2. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    I just realized that there is a newer version available (5.6.0f3). I'll try that one tomorrow and check if the bug persists.
     
  3. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    The bug still persists in 5.6.0f3. Any workarounds for this? This makes this version unusable.
     
  4. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    The issue disappears if unchecking "Others" in Edit->Project Settings->Player->Supported Aspect Ratios.

    This one was pretty tricky overall. In earlier versions, instead of forcing a 0x0 resolution on startup, it combined all available displays to one huge resolution, which was also not very useful.
     
  5. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    I was wrong, the issue didn't disappear. It still exists. Will try to create some kind of reference project. It always happens if the player tries to launch in fullscreen mode. If I set it to windowed by default, it'll render normally even if changed to fullscreen afterwards. If I quit the game from there and relaunch, the player will remember fullscreen and the bug reappears.
     
    Last edited: Apr 12, 2017
  6. Gamrok

    Gamrok

    Joined:
    May 13, 2015
    Posts:
    16
  7. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    Yep, second screen. I'm currently circling around this issue. I also did an export on 5.6.0. on windows just to be sure, but I don't know if it made a difference. I'm currently thinking that this might be a Unity bug, not a Linux Editor bug. While sometimes the screen stays black, there will be weird bugs happening on other machines or versions of the game. The mac build seems fine, which brought another thing to my attention: I'm usually overwriting old builds when exporting a new build for the game.

    I noticed that the linux binaries don't get overwritten, so I cleared all the builds and exported completely new ones. Can you check if that makes a difference for you?
     
    Last edited: May 5, 2017
  8. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    It's weird because it's working sporadically and sometimes it just randomly reappears. Still haven't figured out what does make a difference and what not.
     
  9. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    Code (CSharp):
    1. requesting fullscreen 1920 x 1080 at 0 Hz
    Love this one too. Still trying to guess what is happening. Is Screen.SetResolution at fault? Maybe I'll know someday.
     
  10. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    Sometimes the grey from the unity3d-splashscreen stays, but in most circumstances the game renders at least one frame for me. I attached two images: One is a screenshot of the frame that was rendered, showing that something got rendered. I'm fading in the scenes from black, so it makes sense that nothing is visible. However, on the second image I cranked up the brightness and contrast a lot, so you can see that the game is, indeed, rendered.

    I guess the one-frame-only comes from the 0 Hz error.

    When I start the game, I get one

    Code (CSharp):
    1. New context 0x2c73f18 created with attributes:
    2. Default vsync count 1
    3. requesting resize 1920 x 1080
    4. Using native desktop resolution 1920 x 1080
    5. requesting fullscreen 1920 x 1080 at 0 Hz
    6. Desktop is 1920 x 1080 @ 60 Hz
    and then some game stuff, something about Enlighten and then again a:

    Code (CSharp):
    1. requesting resize 1920 x 1080
    2. Using native desktop resolution 1920 x 1080
    3. Clamping fullscreen resolution to 0 x 0
    4. requesting fullscreen 0 x 0 at 60 Hz
    5. Desktop is 1920 x 1080 @ 60 Hz
    So I actually get both. Turning a monitor off does not change this, so I don't think it's a second monitor issue.
     

    Attached Files:

    Last edited: May 5, 2017
  11. Odd-Redesign

    Odd-Redesign

    Joined:
    Jul 26, 2013
    Posts:
    134
    I implemented a dirty workaround that puts the game into windowed mode and back into fullscreen mode whenever it detects the strange 0x0 resolution. The delay is necessary, as it will spam-repeat itself otherwise without bypassing the strange resolution.

    Code (CSharp):
    1. private float resetFullScreenCounter;
    2. private bool resetFullScreen
    3.  
    4. ...
    5.  
    6. if (resetFullScreenCounter > 0) {
    7.   resetFullScreenCounter -= Time.deltaTime;
    8. }
    9.  
    10. if (resetFullScreen && resetFullScreenCounter <= 0) {
    11.   gameSettings.isFullScreen = true;
    12.   applyResolution();
    13.   resetFullScreen = false;
    14.   resetFullScreenCounter = 0;
    15. }
    16.  
    17. if (Screen.currentResolution.width == 0 || Screen.currentResolution.height == 0 ||
    18.     Screen.width == 0 || Screen.height == 0 || Screen.currentResolution.refreshRate == 0) {
    19.   if (gameSettings.isFullScreen) {
    20.     gameSettings.isFullScreen = false;
    21.     applyResolution();    
    22.     resetFullScreen = true;
    23.     resetFullScreenCounter = 0.5f;
    24.   }
    25. }
     
    Novack likes this.
  12. WaaghMan

    WaaghMan

    Joined:
    Jan 27, 2014
    Posts:
    245
    Just wanted to chime in and say that our Linux users are reporting similar behavior (can't see anything, "Clamping fullscreen resolution to 0 x 0" / "requesting fullscreen 1920 x 1080 at 0 Hz" lines appearing in the log ).

    We'll try your proposed workaround until the bug gets fixed.

    PS: We use the Windows Editor, so it's definitely not related to the Linux Editor, just the Player.
     
    Odd-Redesign likes this.
  13. Gamrok

    Gamrok

    Joined:
    May 13, 2015
    Posts:
    16
  14. AttilioC

    AttilioC

    Joined:
    Jun 29, 2014
    Posts:
    86
    I've got a report for this issue in my game - I'm using Unity 2017.1.0f3, so seems like the issue is still not fixed.

    In my case, config file is set to
    <pref name="Screenmanager Is Fullscreen mode" type="int">1</pref>
    <pref name="Screenmanager Resolution Height" type="int">0</pref>
    <pref name="Screenmanager Resolution Width" type="int">0</pref>

    Also getting this error, not sure if it's related:
    Player data archive not found at `/home/steam/.local/share/Steam/steamapps/common/An Oath to the Stars/AnOathToTheStars_Data/data.unity3d`, using local filesystem

    I'll keep looking for a solution, just wanted to share an update on this issue.
     
  15. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001