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

Test Duality on Linux #288

Closed
ilexp opened this issue Feb 14, 2016 · 31 comments

Comments

@ilexp
Copy link
Member

commented Feb 14, 2016

Create a small project with Duality (or just use one of the sample projects) and check if it runs on Linux using Mono. It will likely not - determine the breaking point and document it here, so it can be evaluated how to fix it.

This is specifically about launcher and core, not the editor.

Related: Issue #287

@ilexp ilexp added this to the General Improvements milestone Feb 14, 2016

@RockyTV

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2016

I can easily compile a sample project and run it in my Linux machine. I'll see what I can do in the next days.

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 15, 2016

Great! Let me know how it turns out.

@RockyTV

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2016

For my surprise: a simple Hello World application showed up! Not errorless, though. I'm uploading a screenshot and the log files.
The error in the log is related to audio. But looks like it works! Now I'll try doing some other thing like updating text based on time passed, and even draw things on the screen.

Logfile: http://termbin.com/c78r

EDIT: thing I noticed that could be due to my window manager (i3): my mouse keeps stuck inside the game window, when I try to move it to the other terminals it just won't get past the game's window border.
EDIT2: I'm running Manjaro Linux.

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 15, 2016

Awesome :) So the first step to running Duality on Linux is done. Can you check some of the sample projects?

Regarding the audio error, it looks like Duality isn't able to locate OpenAL on your system:

  • Is there an OpenTK.dll.config file in your Duality directory?
  • Can you install OpenAL and check whether that helps?
  • If it does, can you uninstall OpenAL again and just put the library inside the Duality directory? Does it still work?

The .config file defines a mapping from the usual Windows .dll files to their equivalent on other systems. Here's the excerpt for linux:

  <dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
  <dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
  <dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
  <dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
  <dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
  <dllmap os="linux" dll="libX11" target="libX11.so.6"/>
  <dllmap os="linux" dll="libXi" target="libXi.so.6"/>
  <dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
@RockyTV

This comment has been minimized.

Copy link
Contributor

commented Feb 15, 2016

These are the samples I ran in my crappy machine:

  • Custom test (would just render Duality's logo on screen and update a text with certain Time variables)
  • BasicMenu
  • DualStickSpaceShooter
  • ParticleSystem
  • BasicShaders
  • FlapOrDie

Custom test

Worked as expected. No additional comments.

Basic menu

Same as above. Logfile.

DualStickSpaceShooter

I was expecting to be able to play, but I think my crappy machine didn't allow me to. Game got stuck in the sample level phase, and no ships would be drawn. Logfile.

ParticleSystem

Worked as expected. Logfile.

BasicShaders

VertexShader doesn't work, something bad happens with it. FragmentShader is laggy, but, again, this should be an issue with the machine I used to test. Logfile.

FlapOrDie

Took a while to load the game, but it worked, and a bit laggy. But I could play just fine. Logfile.

EDIT: I tried installing openal by pacman -S openal, and the error is gone, but Duality says it couldn't connect to the AL server.

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 16, 2016

I was expecting to be able to play, but I think my crappy machine didn't allow me to. Game got stuck in the sample level phase, and no ships would be drawn.

Hmm.. don't see something suspicious in the logfile. What does "got stuck" mean?

VertexShader doesn't work, something bad happens with it. FragmentShader is laggy, but, again, this should be an issue with the machine I used to test.

Seems like the builtin shader variable gl_VertexID isn't available, which might have something to do with the OpenGL driver implementation or shading language version. Not an expert on Linux Mesa drivers though.. can someone check this?

EDIT: I tried installing openal by pacman -S openal, and the error is gone, but Duality says it couldn't connect to the AL server.

The message "couldn't connect to OpenAL server" doesn't ring any bells for me. Is there a logfile for this?


Edit: Also, can someone with a more gaming-ready linux machine test this as well, so we have a second point of reference?

@ilexp ilexp added the Linux label Feb 17, 2016

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

@ilexp Can you give me some references to run duality project with Mono? I have gaming-ready linux machine and want to help this issue. Following information is my Linux machine's spec.

CPU: i5-4690
RAM: 16GB
OS: Ubuntu 14.04 LTS
VGA: Intel HD Graphics

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2016

I'm on Windows only, so my experience here is limited, but I think it basically boils down to:

  1. Install Mono on your system, info on this here and here
  2. Prepare a Duality project, i.e. create a regular Windows release package of the project you want to test. Copy it over to your Linux environment.
  3. Open a terminal / bash / shell, go into the sample project's folder and execute mono DualityLauncher.exe
  4. See what happens.
@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

When I launch the command mono DualityLauncher.exe, I met following error and couldn't launch the program. @ilexp can you make this out?

sappho192@TAE-IN-UBUNTU:/다운로드/Duality$ ls
AdamsLair.WinForms.dll DualityLauncher.exe.config OpenTK.dll
AdamsLair.WinForms.pdb DualityLauncher.pdb OpenTK.dll.config
AdamsLair.WinForms.xml DualityPrimitives.XML OpenTK.pdb
Aga.Controls.dll DualityPrimitives.dll OpenTK.xml
Aga.Controls.pdb DualityPrimitives.pdb PackageConfig.xml
AppData.dat DualityUpdater.exe Plugins
DDoc.chm EditorUserData.xml PopupControl.dll
Data FarseerDuality.dll PopupControl.pdb
DesignTimeData.dat FarseerDuality.pdb Source
Duality.dll FarseerDuality.xml VistaBridgeLibrary.dll
Duality.pdb Microsoft.Web.XmlTransform.dll WeifenLuo.WinFormsUI.Docking.dll
Duality.xml NVorbis.XML WeifenLuo.WinFormsUI.Docking.pdb
DualityEditor.exe NVorbis.dll Windows7.DesktopIntegration.dll
DualityEditor.exe.config NuGet.Core.dll logfile.txt
DualityEditor.pdb OpenAL32.dll logfile_editor.txt
DualityEditor.xml OpenTK.GLControl.dll perflog.txt
DualityLauncher.exe OpenTK.GLControl.xml perflog_editor.txt
sappho192@TAE-IN-UBUNTU:
/다운로드/Duality$ mono DualityLauncher.exe
[Core] Msg: Running DualityLauncher with flags:
[Core] Msg: Using 'DefaultPluginLoader' to load plugins.
[Core] Msg: Scanning for core plugins...
[Core] Msg: Plugins/BasicMenu.core.dll...
[Core] Msg: Assembly loaded: BasicMenu.core
[Core] Msg: Assembly loaded: Duality
[Core] Msg: Assembly loaded: System.Linq.Expressions
[Core] Msg: Assembly loaded: Anonymously Hosted DynamicMethods Assembly
[Core] Msg: Assembly loaded: Mono.Security
[Core] Msg: Plugins/Compatibility.core.dll...
[Core] Msg: Assembly loaded: Compatibility.core
[Core] Msg: Assembly loaded: Duality
[Core] Msg: Plugins/DefaultOpenTKBackend.core.dll...
[Core] Msg: Assembly loaded: DefaultOpenTKBackend.core
[Core] Msg: Assembly loaded: OpenTK
[Core] Msg: Plugins/DotNetFrameworkBackend.core.dll...
[Core] Msg: Assembly loaded: DotNetFrameworkBackend.core
[Core] Msg: Assembly loaded: Duality
[Core] Msg: Loading auxiliary libraries...
[Core] Msg: Initializing ISystemBackend...
[Core] Msg: Assembly loaded: NVorbis
[Core] Msg: Assembly loaded: System.Xml.XDocument
[Core] Msg: Assembly loaded: System.Xml.Linq
[Core] Msg: Assembly loaded: System.Xml
[Core] Msg: .Net Framework...
[Core] Msg: Operating System: Unix 3.19.0.49
64 Bit Process: True
CLR Version: 4.0.30319.17020
Processor Count: 4
[Core] Msg: Assembly loaded: System.Threading
[Core] Msg: Assembly loaded: System.Xml.ReaderWriter
[Core] Msg: Assembly loaded: System.Text.Encoding
[Core] Msg: Assembly loaded: System.Text.RegularExpressions
[Core] Msg: Assembly loaded: System.Reflection.Extensions
[Core] Msg: Initializing IGraphicsBackend...
[Core] Msg: OpenGL 2.1 (OpenTK)...
[Core] Msg: Initializing OpenTK...
[Core] Msg: Backend: Default
EnableHighResolution: True
[Core] Msg: Initializing IAudioBackend...
[Core] Msg: OpenAL (OpenTK)...
[Core] Msg: Assembly loaded: System.Configuration
[Core] Msg: Available devices:
[Core] ERR: Failed: DllNotFoundException: openal32.dll
CallStack:
at OpenTK.Audio.AudioContext.CreateContext (System.String device, Int32 freq, Int32 refresh, Boolean sync, Boolean enableEfx, MaxAuxiliarySends efxAuxiliarySends) [0x00000] in :0
at OpenTK.Audio.AudioContext..ctor (System.String device, Int32 freq, Int32 refresh, Boolean sync, Boolean enableEfx, MaxAuxiliarySends efxMaxAuxSends) [0x00000] in :0
at OpenTK.Audio.AudioContext..ctor () [0x00000] in :0
at Duality.Backend.DefaultOpenTK.AudioBackend.Duality.Backend.IDualityBackend.Init () [0x00000] in :0
at Duality.DualityApp.InitBackend[IAudioBackend](IAudioBackend& target, System.Func2 typeFinder) [0x00000] in <filename unknown>:0 [Core] Msg: No Audio... [Core] Msg: Initializing core plugins... [Core] Msg: BasicMenu.core... [Core] Msg: Compatibility.core... [Core] Msg: DefaultOpenTKBackend.core... [Core] Msg: DotNetFrameworkBackend.core... [Core] Msg: DualityApp initialized Debug Mode: False Command line arguments: [Core] Msg: Opening Window... [Core] Msg: Assembly loaded: System.Drawing [Core] Msg: Window Specification: Buffers: 2 Samples: 8 ColorFormat: 32 (8888) AccumulatorFormat: 0 (0000) Depth: 24 Stencil: 8 VSync: On SwapInterval: 1 [Core] Msg: OpenGL Version: 3.0 Mesa 10.5.9 Vendor: Intel Open Source Technology Center Renderer: Mesa DRI Intel(R) Haswell Desktop Shading Language Version: 1.30 [Core] Msg: Initializing default content... Missing method SizeOf in assembly /home/sappho192/다운로드/Duality/Duality.dll, type System.Runtime.InteropServices.Marshal [Core] ERR: TypeInitializationException: An exception was thrown by the type initializer for Duality.Drawing.VertexC1P3T4A1 CallStack: at Duality.ContentProvider.InitDefaultContent () [0x00000] in <filename unknown>:0 at Duality.DualityApp.InitPostWindow () [0x00000] in <filename unknown>:0 at Duality.DualityApp.OpenWindow (Duality.Backend.WindowOptions options) [0x00000] in <filename unknown>:0 at Duality.Launcher.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Duality.Drawing.VertexC1P3T4A1 ---> System.TypeInitializationException: An exception was thrown by the type initializer for Cache1 ---> System.TypeLoadException: Could not load type 'System.Runtime.InteropServices.Marshal' from assembly 'Duality'.
at Duality.Drawing.VertexDeclaration+Cache`1[Duality.Drawing.VertexC1P3T4A1]..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at Duality.Drawing.VertexC1P3T4A1..cctor () [0x00000] in :0
--- End of inner exception stack trace ---
at Duality.ContentProvider.InitDefaultContent () [0x00000] in :0
at Duality.DualityApp.InitPostWindow () [0x00000] in :0
at Duality.DualityApp.OpenWindow (Duality.Backend.WindowOptions options) [0x00000] in :0
at Duality.Launcher.Program.Main (System.String[] args) [0x00000] in :0

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2016

Hmm.. the main culprit here seems to be this:

Missing method SizeOf in assembly /home/sappho192/다운로드/Duality/Duality.dll, type System.Runtime.InteropServices.Marshal

Apparently Marshal.SizeOf can't be found. Which is a bit weird, because this should be available in Mono. Which version do you have installed? Is there a way to verify the installation performed correctly?

[Core] ERR: Failed: DllNotFoundException: openal32.dll

This error should be entirely recoverable, but you won't have sound. Seems like you also need to install OpenAL on your system - or place the binaries in a folder where they can be found by the runtime.

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

Following info is the version of my mono.

sappho192@TAE-IN-UBUNTU:~$ mono --version
Mono JIT compiler version 3.2.8 (Debian 3.2.8+dfsg-4ubuntu1.1)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

I 've installed the mono which is in apt-get repository by the command:sudo apt-get install mono-complete.

And I solved OpenAL issue by installing OpenAL by command sudo apt-get install libopenal1.
Thanks.

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2016

I've checked the mono source code and this is the method in question. Seeing it implemented right there, with the same class and same signature as the one used by Duality makes me think that this might not be a compatibility issue due to API usage, but maybe there's a problem with resolving the correct mono assembly. Not sure here.

It seems like the mono version you're using is about 2 years old - any chance you can check with the latest version as well? It's probably unrelated though, 3.2.8 should be fine.

Maybe we can check some smaller sample programs to rule out it's an API or framework issue. Put each of them in their own Program.cs file and then run mcs Program.cs from the command line to compile them using Mono. Next, you can run them with Mono and we'll see what happens:

using System;

namespace Test1
{
    public static class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World");
            return;
        }
    }
}
using System;
using System.Runtime.InteropServices;

namespace Test2
{
    public struct TestStruct
    {
        public int FieldA;
        public long FieldB;
    }
    public static class Program
    {
        public static void Main(string[] args)
        {
            Console.WriteLine("Hello World 2");
            Console.WriteLine("Size of int: {0}", Marshal.SizeOf(typeof(int)));
            Console.WriteLine("Size of TestStruct: {0}", Marshal.SizeOf(typeof(TestStruct)));
            return;
        }
    }
}

The first one checks if compiling works, the second one invokes the API that has been logged by Duality as unavailable.

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

Following is a result of compiling & running your first code.

sappho192@TAE-IN-UBUNTU:/code/Hello$ mcs Program.cs
sappho192@TAE-IN-UBUNTU:
/code/Hello$ ls
Program.cs Program.exe
sappho192@TAE-IN-UBUNTU:~/code/Hello$ mono Program.exe
Hello World

Following is a result of second code.

sappho192@TAE-IN-UBUNTU:/code/Marshal$ mcs Program.cs
sappho192@TAE-IN-UBUNTU:
/code/Marshal$ ls
Program.cs Program.exe
sappho192@TAE-IN-UBUNTU:~/code/Marshal$ mono Program.exe
Hello World 2
Size of int: 4
Size of TestStruct: 16

I think it's working properly, isn't it?
I'm going to install latest Mono with monoproject's repo. Please wait a minute.

@RockyTV

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2016

I was using Mono 4 with Manjaro and everything was fine, except shaders.
EDIT: @ilexp maybe we should have a separate issue to create sample multiplatform samples, or tests? Maybe an AIO package.

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2016

I was using Mono 4 with Manjaro and everything was fine, except shaders.

Which, given the fact that you apparently aren't on a gaming machine, sounds very encouraging to me. Thanks for testing in any case :)

I think it's working properly, isn't it?

Yep, it definitely is! Must be caused by something else then!

Not sure how much time you have or want to pour into this, but since I'm out of ideas right now, debugging this on your system might be a good next step. This will require:

  • A C# IDE on your system along with Mono. I've used MonoDevelop / Xamarin Studio before and it always seemed quite nice. This will likely install an updated mono runtime as well.
  • You might need to compile the portable bits of Duality yourself in order to be able to step through the code.
  • Next, there'll likely be a lot of detective's work to find out where exactly it's failing, and why.

We're entering territory now where I can't really help you with concrete advice due to lack of experience and a testing system, but I'll be here to discuss your findings in case you should decide to give this some more time.

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

sappho192@TAE-IN-UBUNTU:~/다운로드/Duality$ mono --version
Mono JIT compiler version 4.2.2 (Stable 4.2.2.30/996df3c Mon Feb 15 17:30:30 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen

dualitylauncher

Sorry @ilexp . It works on latest Mono(4.2.2) ㅠㅁ ㅠ... Maybe the problem was out of Mono source code.

Thank you and I really appreciate your help ;ㅅ;

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2016

EDIT: @ilexp maybe we should have a separate issue to create sample multiplatform samples, or tests? Maybe an AIO package.

I think it's still a bit too soon for this. We don't need mass-testing on a lot of machines (where a set of prepared sample downloads makes totally sense) right now, but rather a few developers who are able and willing to look into the issues that pop up.

@ilexp . It works on latest Mono(4.2.2)

Awesome! :) Which samples did you test so far? Does audio work as well, now that you've installed OpenAL?

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

soundexample

@ilexp Yes, audio worked well with no problem! I tested Audio Handling Sample and Basic Menu Sample.

I also tried to launch the DualityEditor.exe but failed. What is strange is that the editor opened the package updater and downloaded packages even I already opened and downloaded previously at Windows. Then it throws an error which is related with file handling.

sappho192@TAE-IN-UBUNTU:~/code/test$ mono DualityEditor.exe

Waiting for file locks to release...

Begin applying update

sappho192@TAE-IN-UBUNTU:~/code/test$
;1Rfailed

Exception: System.IO.IOException: Invalid handle to path "/home/sappho192/code/test/[Unknown]"
at System.IO.FileStream.ReadData (System.Runtime.InteropServices.SafeHandle safeHandle, System.Byte[] buf, Int32 offset, Int32 count) <0x7f152b8e5230 + 0x000a3> in :0
at System.IO.FileStream.ReadInternal (System.Byte[] dest, Int32 offset, Int32 count) <0x7f152b8e33d0 + 0x00076> in :0
at System.IO.FileStream.Read (System.Byte[] array, Int32 offset, Int32 count) <0x7f152b8e31d0 + 0x000e1> in :0
at System.IO.StreamReader.ReadBuffer () <0x7f152b752cb0 + 0x002a4> in :0
at System.IO.StreamReader.Read () <0x7f152b751d70 + 0x00063> in :0
at System.TermInfoDriver.GetCursorPosition () <0x7f152b9fbe90 + 0x00099> in :0
at System.TermInfoDriver.Init () <0x7f152b9fb2b0 + 0x005ad> in :0
at System.TermInfoDriver.set_ForegroundColor (ConsoleColor value) <0x7f152b9fbe40 + 0x00023> in :0
at System.ConsoleDriver.set_ForegroundColor (ConsoleColor value) <0x7f152b9e70c0 + 0x00048> in :0
at System.Console.set_ForegroundColor (ConsoleColor value) <0x7f152b9e6210 + 0x0000c> in :0
at Duality.Updater.PrettyPrint.PrintCommand (Element[] elements) <0x4145ff20 + 0x000b2> in :0
at Duality.Updater.Program.PerformUpdate (System.Xml.Linq.XElement commandElement) <0x4145f5e0 + 0x004a3> in :0
at Duality.Updater.Program.Main (System.String[] args) <0x4143ca80 + 0x0052f> in :0

Press any key to continue

Unhandled Exception:
System.IO.IOException: Invalid handle to path "/home/sappho192/code/test/[Unknown]"
at System.IO.FileStream.ReadData (System.Runtime.InteropServices.SafeHandle safeHandle, System.Byte[] buf, Int32 offset, Int32 count) <0x7f152b8e5230 + 0x000a3> in :0
at System.IO.FileStream.ReadInternal (System.Byte[] dest, Int32 offset, Int32 count) <0x7f152b8e33d0 + 0x00076> in :0
at System.IO.FileStream.Read (System.Byte[] array, Int32 offset, Int32 count) <0x7f152b8e31d0 + 0x000e1> in :0
at System.IO.StreamReader.ReadBuffer () <0x7f152b752cb0 + 0x002a4> in :0
at System.IO.StreamReader.Read () <0x7f152b751d70 + 0x00063> in :0
at System.TermInfoDriver.ReadKeyInternal (System.Boolean& fresh) <0x7f152b9fd170 + 0x00113> in :0
at System.TermInfoDriver.ReadKey (Boolean intercept) <0x7f152b9fd8c0 + 0x0002a> in :0
at System.ConsoleDriver.ReadKey (Boolean intercept) <0x7f152b9e7800 + 0x00046> in :0
at System.Console.ReadKey (Boolean intercept) <0x7f152b9e6530 + 0x0001b> in :0
at Duality.Updater.IOHelper.WaitForUserRead (Int32 timeoutSeconds) <0x41460fc0 + 0x0009d> in :0
at Duality.Updater.Program.Main (System.String[] args) <0x4143ca80 + 0x006f3> in :0
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.IOException: Invalid handle to path "/home/sappho192/code/test/[Unknown]"
at System.IO.FileStream.ReadData (System.Runtime.InteropServices.SafeHandle safeHandle, System.Byte[] buf, Int32 offset, Int32 count) <0x7f152b8e5230 + 0x000a3> in :0
at System.IO.FileStream.ReadInternal (System.Byte[] dest, Int32 offset, Int32 count) <0x7f152b8e33d0 + 0x00076> in :0
at System.IO.FileStream.Read (System.Byte[] array, Int32 offset, Int32 count) <0x7f152b8e31d0 + 0x000e1> in :0
at System.IO.StreamReader.ReadBuffer () <0x7f152b752cb0 + 0x002a4> in :0
at System.IO.StreamReader.Read () <0x7f152b751d70 + 0x00063> in :0
at System.TermInfoDriver.ReadKeyInternal (System.Boolean& fresh) <0x7f152b9fd170 + 0x00113> in :0
at System.TermInfoDriver.ReadKey (Boolean intercept) <0x7f152b9fd8c0 + 0x0002a> in :0
at System.ConsoleDriver.ReadKey (Boolean intercept) <0x7f152b9e7800 + 0x00046> in :0
at System.Console.ReadKey (Boolean intercept) <0x7f152b9e6530 + 0x0001b> in :0
at Duality.Updater.IOHelper.WaitForUserRead (Int32 timeoutSeconds) <0x41460fc0 + 0x0009d> in :0
at Duality.Updater.Program.Main (System.String[] args) <0x4143ca80 + 0x006f3> in :0
^C
sappho192@TAE-IN-UBUNTU:~/code/test$

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2016

I also tried to launch the DualityEditor.exe but failed

The editor is definitely Windows only - there's too much platform specifics in UI handling for it to be portable.

@ilexp Yes, audio worked well with no problem! I tested Audio Handling Sample and Basic Menu Sample.

Allright, so the basics seem to work. Can you test the shaders and input samples as well?

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

I was able to launch Shader example but not in perfect.

shader
Fragment Shader works but Vertex shader threw errors.

sappho192@TAE-IN-UBUNTU:~/code/Shader$ mono DualityLauncher.exe
[Core] Msg: Running DualityLauncher with flags:
[Core] Msg: Using 'DefaultPluginLoader' to load plugins.
[Core] Msg: Scanning for core plugins...
[Core] Msg: Plugins/Compatibility.core.dll...
[Core] Msg: Assembly loaded: Compatibility.core
[Core] Msg: Assembly loaded: Duality
[Core] Msg: Assembly loaded: System.Linq.Expressions
[Core] Msg: Assembly loaded: Anonymously Hosted DynamicMethods Assembly
[Core] Msg: Assembly loaded: Mono.Security
[Core] Msg: Plugins/DefaultOpenTKBackend.core.dll...
[Core] Msg: Assembly loaded: DefaultOpenTKBackend.core
[Core] Msg: Assembly loaded: OpenTK
[Core] Msg: Plugins/DotNetFrameworkBackend.core.dll...
[Core] Msg: Assembly loaded: DotNetFrameworkBackend.core
[Core] Msg: Assembly loaded: Duality
[Core] Msg: Loading auxiliary libraries...
[Core] Msg: Initializing ISystemBackend...
[Core] Msg: Assembly loaded: NVorbis
[Core] Msg: Assembly loaded: System.Xml.XDocument
[Core] Msg: Assembly loaded: System.Xml.Linq
[Core] Msg: Assembly loaded: System.Xml
[Core] Msg: .Net Framework...
[Core] Msg: Operating System: Unix 3.19.0.49
64 Bit Process: True
CLR Version: 4.0.30319.17020
Processor Count: 4
[Core] Msg: Assembly loaded: System.Threading
[Core] Msg: Assembly loaded: System.Xml.ReaderWriter
[Core] Msg: Assembly loaded: System.Text.Encoding
[Core] Msg: Assembly loaded: System.Text.RegularExpressions
[Core] Msg: Assembly loaded: System.Reflection.Extensions
[Core] Msg: Initializing IGraphicsBackend...
[Core] Msg: OpenGL 2.1 (OpenTK)...
[Core] Msg: Initializing OpenTK...
[Core] Msg: Backend: Default
EnableHighResolution: True
[Core] Msg: Initializing IAudioBackend...
[Core] Msg: OpenAL (OpenTK)...
[Core] Msg: Available devices:
Built-in Audio Analog Stereo (Default),
Built-in Audio Digital Stereo (HDMI)
[Core] Msg: Current device: OpenAL Soft
[Core] Msg: OpenAL Version: 1.1 ALSOFT 1.14
Vendor: OpenAL Community
Renderer: OpenAL Soft
Effects: True
[Core] Msg: 256 sources available
[Core] Msg: Initializing core plugins...
[Core] Msg: Compatibility.core...
[Core] Msg: DefaultOpenTKBackend.core...
[Core] Msg: DotNetFrameworkBackend.core...
[Core] Msg: DualityApp initialized
Debug Mode: False
Command line arguments:
[Core] Msg: Opening Window...
[Core] Msg: Assembly loaded: System.Drawing
[Core] Msg: Window Specification:
Buffers: 2
Samples: 8
ColorFormat: 32 (8888)
AccumulatorFormat: 0 (0000)
Depth: 24
Stencil: 8
VSync: On
SwapInterval: 1
[Core] Msg: OpenGL Version: 3.0 Mesa 10.5.9
Vendor: Intel Open Source Technology Center
Renderer: Mesa DRI Intel(R) Haswell Desktop
Shading Language Version: 1.30
[Core] Msg: Initializing default content...
[Core] Msg: Assembly loaded: System.Collections.Concurrent
[Core] Msg: Assembly loaded: System.Threading.Tasks.Parallel
[Core] Msg: ...done!
[Core] Msg: Assembly loaded: DualityPrimitives
[Core] Msg: Assembly loaded: DualityPrimitives
[Core] Msg: Loading Resource 'Data\BasicShaders\ShadersSamples.Scene.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Visuals\BackgroundTile.Material.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Visuals\BackgroundTile.Texture.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Visuals\BackgroundTile.Pixmap.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\VertexSample\VertexMaterial.Material.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\VertexSample\VertexDrawTechnique.DrawTechnique.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\FragmentSample\FragmentMaterial.Material.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\FragmentSample\FragmentDrawTechnique.DrawTechnique.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\FragmentSample\FragmentProgram.ShaderProgram.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\FragmentSample\FragmentShader.FragmentShader.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\VertexSample\VertexProgram.ShaderProgram.res'
[Core] Msg: Loading Resource 'Data\BasicShaders\Shaders\VertexSample\VertexShader.VertexShader.res'
[Core] ERR: Error loading Shader Data\BasicShaders\Shaders\VertexSample\VertexShader:
BackendException: Vertex Compiler error:
0:22(21): error: gl_VertexID' undeclared 0:22(17): error: no matching function for call tomod(error, int)'; candidates are:
0:22(17): error: float mod(float, float)
0:22(17): error: vec2 mod(vec2, float)
0:22(17): error: vec3 mod(vec3, float)
0:22(17): error: vec4 mod(vec4, float)
0:22(17): error: vec2 mod(vec2, vec2)
0:22(17): error: vec3 mod(vec3, vec3)
0:22(17): error: vec4 mod(vec4, vec4)
0:22(6): error: operands to arithmetic operators must be numeric
0:22(2): error: no matching function for call to sin(error)'; candidates are: 0:22(2): error: float sin(float) 0:22(2): error: vec2 sin(vec2) 0:22(2): error: vec3 sin(vec3) 0:22(2): error: vec4 sin(vec4) 0:21(39): error: cannot constructvec2' from a non-numeric data type
0:21(15): error: operands to arithmetic operators must be numeric
0:21(2): error: operands to arithmetic operators must be numeric
CallStack:
at Duality.Backend.DefaultOpenTK.NativeShaderPart.Duality.Backend.INativeShaderPart.LoadSource (System.String sourceCode, ShaderType type) <0x40ba6790 + 0x0090b> in :0
at Duality.Resources.AbstractShader.Compile () <0x40ba64d0 + 0x00103> in :0
[Core] ERR: Error loading ShaderProgram Data\BasicShaders\Shaders\VertexSample\VertexProgram:
BackendException: Linker error:
error: linking with uncompiled shader
CallStack:
at Duality.Backend.DefaultOpenTK.NativeShaderProgram.Duality.Backend.INativeShaderProgram.LoadProgram (INativeShaderPart vertex, INativeShaderPart fragment) <0x40ba89c0 + 0x006d3> in :0
at Duality.Resources.ShaderProgram.Compile () <0x40ba6040 + 0x001bc> in :0

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

input
Input example works but couldn't check joystick and gamepad since I don't have them. Sorry.

@RockyTV

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2016

@sappho192 the errors you got are probably like mine. I don't know why it occurs.

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2016

@sappho192 the errors you got are probably like mine. I don't know why it occurs.

Yep, same error. I'd guess, gl_VertexID simply isn't supported by your OpenGL implementation. It's nothing vital though and the best course of action for now might be to remove it from the sample entirely as soon as issue #219 is implemented.

@sappho192

This comment has been minimized.

Copy link

commented Feb 20, 2016

Got it. Thanks!

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Nov 11, 2016

Note: @mfep wrote a forum post detailing his experiences with running Duality on Linux.

@ChristianGreiner

This comment has been minimized.

Copy link
Member

commented Nov 14, 2016

Trying to launch my game on Linux:

Linux version 4.4.0-45-generic (buildd@lgw01-34) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.2)
[Core] Msg: Initializing default content...
[Core] Msg:   Assembly loaded: System.Reflection.Extensions 4.0.0.0
[Core] ERR:   Unable to retrieve image codec for format 'image/png'. Can't initialize default Pixmap Resources.
[Core] Msg:   Assembly loaded: System.Runtime.Extensions 4.1.0.0
[Core] Msg:   Assembly loaded: System.Xml.ReaderWriter 4.0.10.0
[Core] Msg:   Assembly loaded: System.Text.Encoding 4.0.10.0
[Core] Msg:   Assembly loaded: System.Text.RegularExpressions 4.1.0.0
[Core] ERR:   An error occurred in custom deserialization in object Id 1130222838 of type 'PixelData': NotSupportedException: Unable to retrieve image codec for format 'image/png'. Can't load image data.
              CallStack:
                at Duality.Drawing.PixelData.Duality.Serialization.ISerializeExplicit.ReadData (Duality.Serialization.IDataReader reader) [0x0007a] in <5ee13b3cebc74a168b8c7b64285eac5e>:0 
                at Duality.Serialization.XmlSerializer.ReadStruct (System.Xml.Linq.XElement element, Duality.Serialization.Serializer+ObjectHeader header) [0x00164] in <5ee13b3cebc74a168b8c7b64285eac5e>:0 
[Core] ERR:   An error occurred in custom deserialization in object Id 1130222838 of type 'PixelData': NotSupportedException: Unable to retrieve image codec for format 'image/png'. Can't load image data.
              CallStack:
                at Duality.Drawing.PixelData.Duality.Serialization.ISerializeExplicit.ReadData (Duality.Serialization.IDataReader reader) [0x0007a] in <5ee13b3cebc74a168b8c7b64285eac5e>:0 
                at Duality.Serialization.XmlSerializer.ReadStruct (System.Xml.Linq.XElement element, Duality.Serialization.Serializer+ObjectHeader header) [0x00164] in <5ee13b3cebc74a168b8c7b64285eac5e>:0 

Edit:
Ok, I could fix this issue! My zip-tool unziped the files not correctly. It replaced the slashes "/" with a backslashes "".

@mfep

This comment has been minimized.

Copy link
Member

commented Mar 30, 2017

Latest experiment: building and running an F# project on Linux (Linux Mint 18, x86-64).
The repo can be found here.

Experience:

  • The default plugin projects were deleted from the Source/Code folder, but unless I kept the .sln file, Dualitor re-created them. This was a bit annoying. (The project itself was developed on Windows - it's one of @SirePi's tutorials ported to F#.)
  • The cloned repo contains a minimal source of the Duality Project. The Data folder, source code, and a few binaries, which are included in the official .zip release package. Additionally, some package and build information used by the build system.
  • The user plugin was built (and copied to the destination Plugins folder) successfully using the FAKE build system (Source/Code/build.sh).
  • At this point many binaries (including DualityLauncher.exe) are not yet present. Dualitor cannot start on Linux, however running mono DualityEditor.exe succeeds in downloading the packages defined in PackageConfig.xml.
  • mono DualityLauncher.exe starts the game as expected.
  • Some jitter can be perceived in the first ~10 seconds of the game running. F#? Mono? Redshift?

Conclusion

  • F# can work with Duality (there were some critical serialization issues on the way though)
  • It's possible to compile Duality games on Linux. Apart from minor quirks and the editor, the engine seems to be functional on Linux.
@realvictorprm

This comment has been minimized.

Copy link

commented Oct 21, 2017

@mfep What's the preferred way of embedding FSharp.Core? Might be good to have some information about this on the wiki page too.

@RockyTV

This comment has been minimized.

Copy link
Contributor

commented Oct 21, 2017

@realvictorprm I'm pretty sure you just have to add a NuGet reference and you're good to go.

@mfep

This comment has been minimized.

Copy link
Member

commented Oct 21, 2017

@realvictorprm @RockyTV As far as I can recall, neither installing the package in the IDE, nor adding it to PackageConfig.xml is sufficient. Copying FSharp.Core.dll in the root dir next to DualityLauncher.exe worked for me.

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Jan 2, 2018

Closing this issue, as it has been shown that Duality games can generally run on Linux. Open separate issues for specific work items or bugs as they come up.

Thanks to everyone who participated in testing this!

@ilexp ilexp closed this Jan 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.