Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track-Studio Shows Black Screen On Linux #4

Open
CuriousTommy opened this issue May 2, 2022 · 12 comments
Open

Track-Studio Shows Black Screen On Linux #4

CuriousTommy opened this issue May 2, 2022 · 12 comments

Comments

@CuriousTommy
Copy link
Contributor

CuriousTommy commented May 2, 2022

Track-Studio shows a black screen on Linux (Fedora 35). My machine uses the NVIDIA GPU (NVIDIA Driver Version: 510.60.02).

Unfortunately the console output don't really provide much details...

$ dotnet TrackStudio.dll 
Args : 
FileInput 
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile

Screenshot:
image

@CuriousTommy
Copy link
Contributor Author

CuriousTommy commented May 5, 2022

I noticed that cimgui.dylib and cimgui.so are missing (which are the macOS and Linux equivalent to a .dll file). I wonder if the missing cimgui.so is causing the blackscreen...

https://github.com/MapStudioProject/Track-Studio/blob/main/Track%20Studio/TrackStudio.csproj#L94-L99

Edit: Nevermind... this file does exist.

@CuriousTommy
Copy link
Contributor Author

CuriousTommy commented May 6, 2022

So I did some testing and noticed something strange...

As a quick test, I copy and pasted the protected override void OnRenderFrame(FrameEventArgs e) example from the ImGui.NET_OpenTK_Sample repo into the Framework.cs file.

On Windows, the "Dear ImGui Demo" window shows up without issue, but not on Linux... This implies to me that there might be something wrong with the bundled OpenTK.dll and/or ImGui.NET.dll libraries.

Edit 1: I'm going to try and update ImGui.NET and/or OpenTK using nuget. From what I was able to gather, ImGui.NET version is 1.78.0.0, while OpenTK's version is 3.1.0.0


On a sidenote, is there a particular reason why OpenTK.dll and ImGui.NET.dll are bundled in instead of being downloaded through nuget?

@CuriousTommy
Copy link
Contributor Author

The good news is that I got the interface to render on my Linux machine!

image

The bad news is that I had to commented out parts of the code to get it working... It mainly has to do with some methods that are not exposed in the official release (at least when I tried version 1.86.0 of ImGui.NET. I haven't tested the newer versions).

In addition, some part of the application don't render properly, so I'll have to look into that after I fix the above issue.

@KillzXGaming
Copy link
Contributor

Imgui fork is from ImGuiNET/ImGui.NET#273
Needed because the current imgui does not expose the needed internals to create a proper docking layout.

And OpenTK might be 3.3.2. Upgrading to newer builds would require alot of changes. I've seen Ryujinx use this version and may work better under some modifications if it has issues.

@KillzXGaming
Copy link
Contributor

OpenTK.zip

This is the build Ryujinx uses which might also be worth a try. Seems to still work with this tool

@CuriousTommy
Copy link
Contributor Author

Thanks KillzXGaming!

Seems like my best option is to get ImGuiSharp working on Linux. Once I get the the ImGui issue resolved, I'm going to test the pre-bundled OpenTK build first to see if there is actually anything wrong with it.

@CuriousTommy
Copy link
Contributor Author

I got ImGuiSharp set up to work on both Linux and Windows. In my fork of ImGuiSharp, I made a branch called trackstudio to store my Track Studio specific changes.

In addition, I also made the modifications needed for Track Studio to build and run on Linux and Windows. I have those changes saved in the use_imguisharp branch for both Track-Studio and MapStudio.UI.


Unfortunately, some of the menu items don't seems to display properly on Linux, but they show just fine on Windows (the Windows version is also using ImGuiSharp).

image
image
image

@CuriousTommy
Copy link
Contributor Author

OpenTK.zip

This is the build Ryujinx uses which might also be worth a try. Seems to still work with this tool

The pre-bundled version seems to work fine (or at least I don't noticed anything broken with it). But I'm having trouble getting the new version working for some reason... It seems to complain about a version conflict.

CSC : error CS1705: Assembly 'Toolbox.Core' with identity 'Toolbox.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'OpenTK, Version=3.1.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4' which has a higher version than referenced assembly 'OpenTK' with identity 'OpenTK, Version=1.0.5.32, Culture=neutral, PublicKeyToken=bad199fe84eb3df4' [/home/thomasa/Documents/CodingProjects/Repository/GitHub/Track-Studio/GLFrameworkEngine/GLFrameworkEngine.csproj]

@KillzXGaming
Copy link
Contributor

KillzXGaming commented May 10, 2022

I got ImGuiSharp set up to work on both Linux and Windows. In my fork of ImGuiSharp, I made a branch called trackstudio to store my Track Studio specific changes.

In addition, I also made the modifications needed for Track Studio to build and run on Linux and Windows. I have those changes saved in the use_imguisharp branch for both Track-Studio and MapStudio.UI.

Unfortunately, some of the menu items don't seems to display properly on Linux, but they show just fine on Windows (the Windows version is also using ImGuiSharp).

image image image

This issue is luckily an easy fix. It just means the plugin for TurboLibrary (mk8 editor) is not built in the Plugins folder. You may need to build that one separately. Though if it is present, it might mean Linux has an issue with how assemblies are loaded and I need to adjust it more. This is the code used to load the plugins

The OpenTK dll might need to recompile the Toolbox.Core lib with that referenced aswell. Though if it is displaying fine as is without it, probably not needed then.

@CuriousTommy
Copy link
Contributor Author

CuriousTommy commented May 13, 2022

I got the editor to show up, but I needed to disable/modify some parts of the code to get it working...

image


  1. Calling DrawText() (from class AnimationTimelineControl) throws an excpetion. Looks like the CurveEditorLibrary.dll library need to recompiled to use the ImGuiSharp library instead. Do you know where I can find the source code for this library?
An unhanded exception of type 'System.TypeLoadException' occurred in MapStudioUI.dll: 'Could not load type 'ImGuiNET.ImGui' from assembly 'CurveEditorLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.'
  1. [Fixed] For some reason, AssetViewWindow seems to be running out of columns when it tries to call DrawCategoryList() and DrawListView();... Will need to look more into this.

Update: This assertion seems to happen when you call ImGui.NextColumn(), regardless of the number the columns that were set.

Update 2: I figured out what the issue was, it was due to how ImGui.PopItemWidth() and ImGui.EndChild(); where placed in the DrawCategoryList() method.

dotnet: /home/user/Documents/CodingProjects/Repository/GitHub/ImGuiSharp/native/cimgui/imgui/imgui.h:1881: T& ImVector<T>::back() [with T = float]: Assertion `Size > 0' failed.
  1. [Fixed] ImGui throws an exception due to missing io.KeyMap[(int)ImGuiKey.Space] binding.
  2. An assertion gets thrown when the ImGuiDockNodeFlags.CentralNode is provided. Not sure why adding that flag is causing issues...
dotnet: /home/user/Documents/CodingProjects/Repository/GitHub/ImGuiSharp/native/cimgui/imgui/imgui.cpp:14584: void DockNodeFindInfo(ImGuiDockNode*, ImGuiDockNodeTreeInfo*): Assertion `node->IsLeafNode() && "If you get this assert: please submit .ini file + repro of actions leading to this."' failed.
  1. [Brought it up on Discord/Fixed] Potential memory corruption with window_class.

@CuriousTommy
Copy link
Contributor Author

@KillzXGaming Do you have the source code for the CurveEditorLibrary.dll library?

@S41L0R
Copy link

S41L0R commented Sep 23, 2022

Speaking for Killz because I'm bored and it appears to have been a few months: We have source code, but last I checked we weren't sharing it because we didn't have permission to share it from the primary author. Idk the specifics, but I figured I might as well say what I do know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants