Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Black screen on Windows build with "TLS Allocator" logs

Discussion in 'Windows' started by utkarshdwivedi3997, Feb 4, 2024.

  1. utkarshdwivedi3997

    utkarshdwivedi3997

    Joined:
    Aug 11, 2017
    Posts:
    26
    Hi,

    We have made a game with Unity and the latest version of the game runs with Unity 2021.3.26f1. One player has been reporting black screen on game launch for quite a while now. Earlier builds made with previous versions of Unity didn't create logs that would help narrow down the issue, but the current live build of the game has logs from Unity 2021.3.26f1. There seem to be many "TLS Allocator" logs in the player log on this player's machine (I've attached the player log file).

    They have 2 graphics GPUs, one from Intel and another from AMD. According to the logs the build is using the AMD GPU, which only has 2039 MB of VRAM. This should be more than enough memory required to run the game, but perhaps it is this limited amount that is causing the issue?

    I've seen a lot of TLS Allocator issues posted online, but they seem to all be reported in the Editor itself, not in the Windows Player. Is this something the Unity team has seen before? Do you have any leads that could help us fix this issue on our side? Can I provide any other information to help diagnose this?

    Thanks!
     

    Attached Files:

  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,738
    Those log messages get printed out when the game exits: they are entirely normal. Could it be that the player sees a black screen and presses Alt F4 to close the game?

    Do you by any chance play a video on startup? Do you know what operating system the player is using? It's possible that the video playback somehow fails.
     
    utkarshdwivedi3997 likes this.
  3. utkarshdwivedi3997

    utkarshdwivedi3997

    Joined:
    Aug 11, 2017
    Posts:
    26
    Thanks for the reply! Yes - we do play a video on startup. The player is using "Windows 10 ¼ÒÍ¥ÖÐÎÄ°æ 64-bit (10.0, Build 19045) (19041.vb_release.191206-1406)" (this is what their DxDiag diagnosis log told us). We used to have issues with the video's playback on "Windows NT" versions. Do you have any recommendations on handling what happens if video playback fails? Is there a callback we can register to?

    Also - the memory statistics logs must be a new thing, correct? In older Unity versions these didn't exist. Can you point me to documentation on what these mean? I can't seem to find anything on it, and based on the logs it seems(?) there may be too much memory usage in our game. Just something I'd like to investigate.
     
  4. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hey!

    Looking at Player.txt, the following message stands out:

    Unexpected timestamp values detected. This can occur in H.264 videos not encoded with the baseline profile. Timestamps will be skewed to correct the playback for D:/steam/steamapps/common/Fling to the Finish/Fling to the Finish_Data/sharedassets0.resource


    Microsoft's handling of timestamps is erratic when H.264 content is encoded with B-frames. This causes the need for offsetting and reordering timestamps in ways that are incorrectly supported by Microsoft Media Foundation.

    So if you follow the recommendation and re-encode the movie using the Baseline profile, you should get better results.

    For example, using the ffmpeg command-line tool, this is how you can do it. Feel free to use any other tool you're comfortable with, and also consider re-encoding from the original source (because re-encoding an existing mp4 means you'll be introducing one generation of decode/encode degradation):

    ffmpeg -i original.mp4 -c:v libx264 -profile:v baseline -c:a copy result.mp4


    You can also use Unity's video clip importer; just turn on the "Transcode" option in the importer and it'll create a baseline version of your original clip. It's not very fast, which is why, if your video is very long, you may want to use an external tool instead. External tools also give you better control over all aspects of encoding.

    Hope this helps!

    Dominique Leroux
    A/V developer at Unity
     
    utkarshdwivedi3997 likes this.
  5. utkarshdwivedi3997

    utkarshdwivedi3997

    Joined:
    Aug 11, 2017
    Posts:
    26
    Hi, thanks so much for this suggestion. I'm pretty unaware in this area of video encoding, so can you advise if reencoding through something like ffmpeg also has a potential of causing video playback errors in rare cases? If so, what can we do for players that may run into those issues? Is it possible to know in Unity if playback has failed, and if so, skip video playback? Would a simple try, catch suffice for this? Or are there events or callbacks I could use to register for error events?

    I see that https://docs.unity3d.com/ScriptReference/Video.VideoPlayer.html has an
    errorReceived
    event but it's description says "errors such as HTTP connection problems are reported". I wonder if this will also report other types of errors like playback failed?
     
    Last edited: Feb 8, 2024