OpenNBS / OpenNoteBlockStudio

An open-source Minecraft music maker.
https://opennbs.org/
MIT License
731 stars 50 forks source link

Feature request: Mac/Linux support #4

Open Boobies opened 5 years ago

Boobies commented 5 years ago

Would it be possible to include a Linux port of Open Minecraft Note Block Studio? Perhaps in the form of a .deb package or something.

encode42 commented 5 years ago

I've been able to install and run the EXE through the latest version of wine on Linux Mint just fine.

Edit: Forgot to mention that it works perfectly fine so far.

HielkeMinecraft commented 5 years ago

Yeah right now the best thing you can do is to use Wine, as many things have been made with Windows in mind, and won't work on Linux.

Boobies commented 5 years ago

Wow, this is suddenly looking like a forum rather than a bug tracker :) I wasn't looking for a workaround, guys; I've been using Wine too.

HielkeMinecraft commented 5 years ago

Upon further inspection of the code, I think it's pretty much impossible. Just look at the .dll files at OpenNoteBlockStudio/datafiles/Data/

These files obviously won't work on Linux, and because I don't have the source code for them, making .so variants to work on Linux is... Impossible.

Boobies commented 5 years ago

I thought perhaps they came with GameMaker Studio, which I am not particularly familiar with. Do you know who the author is? Perhaps we can contact the auhor for help (either for the source or the shared object files). And, for that matter, aren't there potential licensing issues surrounding those files?

HielkeMinecraft commented 5 years ago

No, as in the code they are specified as libraries. You can find a lot of them online: http://www.gmtoolbox.com/ I have no idea who made these files and what the licenses they have. Your guess is as good as mine :-/

Boobies commented 5 years ago

Chances are they do Windows-specific things anyway judging from their names (e.g., window.dll) so it's possibly not as simple as providing .so's. Otherwise, we could have used objcopy. Could you identify where in the code these are used? If it's not a million functions being used, perhaps I could reimplement them using portable libraries.

HielkeMinecraft commented 5 years ago

As far as I know the .dll files are only loaded in once, in lib_init. There they are put into global variables. If you were to make .so variants that would do exactly the same thing as the .dll ones, we could just have a check, and if the platform is linux, the .so files will be used. But is that even possible, without having the source code? :-/

Still, this is just one thing that won't work on Linux. More things might be broken.

Boobies commented 5 years ago

The main reason why it's done this way, as far as I can tell, is that GML is a dumb language which doesn't abstract away calling conventions and such. At any rate, it would be possible, because it would not rely on those libraries at all; I would implement the functionality myself from scratch --- as long as it's not too much work (I expect that while those libraries have a lot of features, not too many are used by this specific program).

That said, in the mean while, I have tracked down one of the libraries. It seems to have its full source code available, and support is included Linux as well as macOS:

https://marketplace.yoyogames.com/assets/575/execute-shell

As far as I can tell, everything from file.dll and window.dll can easily be done using GameMaker's built-in functions. I haven't investigated further.

stuffbydavid commented 5 years ago

Hi, here are the sources for the DLLs you need to port:

https://github.com/stuffbydavid/audio-DLL https://github.com/stuffbydavid/midi-input-DLL https://github.com/stuffbydavid/window-DLL https://github.com/stuffbydavid/file-DLL

window.dll and midiinput.dll use Windows features like ShowWindow and midiInGetDevCaps, so they'll need to be rewritten from scratch. audio.dll and file.dll use the FFMPEG and Boost libraries which are cross-platform and require less changes.

Good luck!!

Boobies commented 5 years ago

You must be the original author :)

At any rate, if anything takes too much work to port, I'll also consider looking into how ditficult it is to replace them with cross-platform alternatives. Any idea as to how tight the coupling between these and Open Minecraft Note Block Studio is? Cause if it's just a matter of changing some calls and data structures, things should progress very quickly.

I haven't really looked at the APIs yet.

leafs444 commented 5 years ago

I know this is kinda necrotic but this isn't a forum so I have no reason not to tell y'all that I found a way to pretty much make this run without a compatibility layer (WINE (If its not an emulator then its a compatibility layer)) but I can't legally share it so... But it is possible...

ShinkoNet commented 5 years ago

Could you explain the method in doing so? I'm interested in doing this.

leafs444 commented 5 years ago

I found the libraries and replaced them with minor coding skills (just switched the code for the libraries)

AkarinLiu commented 4 years ago

Why not change using Qt development environment? That can support any platform!

Bentroen commented 4 years ago

@ScottLiu2019 Glad you pointed that out! I'm actually working on a prototype for a new version using exactly that framework (its Python version, PyQt, to be exact). No timeframe when this is going to be available, but I can already say it will be much less restrictive than the current version. :)

lachlandk commented 4 years ago

@Bentroen I just happened to be thinking about creating a new version of the program using that framework myself, I would be interested in pursuing this, is there any way I could get involved?

Bentroen commented 4 years ago

@lachlandk That's great! Thanks for your interest in helping the project. I'll invite you to the repository :)

MinecraftDesktopOnPi commented 4 years ago

If you would like some additional help, @Bentroen @lachlandk , I am good with linux and PyQT and interested in helping y'all out.

lachlandk commented 4 years ago

I think a rewrite could possibly do wonders to the performance of this program, my computer literally runs hotter while editing in NBS than playing some 3D games :D

Bentroen commented 4 years ago

@MinecraftDesktopOnPi Sorry, I seem to have missed your comment! I'm keeping the repository private until we have a minimally working version, and we've already reached the 3 contributors limit. As soon as it's made public you'll be able to contribute via pull requests :)

treierxyz commented 3 years ago

@Bentroen How's the progress on the new version? Any updates, how far along you guys are?

Bentroen commented 3 years ago

I already wrote a significant part of the interface in Python, but we're considering the possibility of moving to another language due to performance reasons (though it's more likely that we'll stay with Python).

456dev commented 3 years ago

@Bentroen iirc creating a free github organisation allows you to bypass the private repo contributor limit (and add better access control)

alx-alexpark commented 3 years ago

I think you can just export/compile it for ubuntu in gamemaker studio.

encode42 commented 3 years ago

@TheEpicProgrammer That won't work since NBS uses custom DLL files that are Windows-specific. No matter how the project is exported, DLLs will always stay the same and only work on Windows.

alx-alexpark commented 3 years ago

oh

alx-alexpark commented 3 years ago

thats sad

Mhowser commented 3 years ago

@Bentroen how's the progress on the new cross-platform version?

Bentroen commented 3 years ago

@Mhowser Right now I'm splitting my time between working on the new version, and adding features to the current program (as otherwise it would look abandoned). The tricky part is that a lot must be done before we have even a partially working version, so a lot of time must be spent for the progress to be apparent. To remedy this, I inverted the order of things a little bit: instead of designing the interface, I'm working on the new functionality that was announced for the rewrite. The goal is to gradually incorporate them into the current version - this way the progress will be pushed out as soon as possible, making use of the code that's already there. Once those features are ready, releasing the new version will just be a matter of tying up everything with the new interface.

Mhowser commented 3 years ago

That's great to hear, thanks for the update!

ShinkoNet commented 3 years ago

For now mac/linux does work via wine and with a good enough CPU is usable even with a tad bit of frameskipping. For macOS running Catalina or above you will need to use the wine32on64 variant. However, this is not the ideal scenario, so the multiplatform rewrite is still planning to be done while we rewrite various features in the current GameMaker version to use python code as well, that we will be able to easily refactor in to the full rewrite.

chenxi050402 commented 2 years ago

I'm working on a Linux port of ONBS. Currently, all functions except exports and MIDI devices work fine.

Mhowser commented 2 years ago

@chenxi050402 Wow thank you for taking the initial steps towards a Linux version!

DovydasTEDS commented 2 years ago

Will there be Android support?

Bentroen commented 2 years ago

@DovydasTEDS Mobile support is not planned at the moment, due to:

  1. the need to focus on bettering the desktop app;
  2. the limited developer resources available to the project;
  3. the difficulty of adapting the program to touch controls and smaller screen sizes.

That said, it could be a possibility in a distant future. :)

mrmelon54 commented 2 years ago

Hey any updates on the new cross platform version?

ghost commented 2 years ago

Here are some issues I found while using ONBS on WINE: #283 #284

chenxi050402 commented 2 years ago

Hey any updates on the new cross platform version?

I actually just got it running on macOS just now, and it runs better than my i9 10900k and RTX 3090 PC somehow

ghost commented 2 years ago

talking about rewrites, since there are already 2 of them, how about 2+1

Bentroen commented 2 years ago

Hey any updates on the new cross platform version?

@MrMelon54 As mentioned by @chenxi050402, he just managed to get the current version running under MacOS. So, it's possible that, sometime in the near future, we'll publish the current version to more platforms; however, some crucial features are missing since they rely on Windows-only libraries, and there are still other limitations we have to overcome before distributing to everyone, so we won't promise anything for now.

About the rewrite, it has been postponed a bit, as we'll first bring some of the features announced for it to the current version (check my previous comment above). Basically, we will start with the bits that can easily be connected to the current version, and the interface itself will be the last thing to just connect these features.

On that note, I've been working on two external components for NBS: GMPython and nbs-audio, which will bring the rewritten MP3 export from 4.0 into the current version — the goal is to integrate them to NBS as early as 3.10! Before working on this though, I'd like to release a patch addressing some of the bugs introduced in 3.9, and also a feature to allow pre-release versions — since embedding a new programming language is a "risky" addition to the program, we will probably release beta versions to make sure everyone can use it safely.

That's about everything that's going on with development right now! We're preparing the ground for some changes that could potentially make the current version as good as 4.0 will be :) If you have any questions, feel free to leave a comment here.

time-killer-games commented 2 years ago

Here's a cross-platform replacement for the file-dll: https://github.com/time-killer-games/libfilesystem https://github.com/time-killer-games/xProcess

Download the actual extensions for those here: https://samuel-venable.itch.io/gamemaker-extension-collection

Also message_yesnocancel() from the window-dll is windows only but my dialog module extension has a cross-platform function which does the same thing. The function is called show_question_cancelable(). Let me know if you have any questions.

Add me on discord: Samuel Venable#5465

bdotsamir commented 2 years ago

Seems that while starting this app via wine on my machine it takes exclusive control over the audio card and will prevent anything else from playing sounds until after the app is closed. The reverse is also true: while I have other applications open, ONBS will not play sounds. Not sure if this is the place to put this problem, but is anyone else having this issue?

uname -a: Linux (hostname) 5.15.13-arch1-1 #1 SMP PREEMPT Wed, 05 Jan 2022 16:20:59 +0000 x86_64 GNU/Linux

time-killer-games commented 2 years ago

Seems that while starting this app via wine on my machine it takes exclusive control over the audio card and will prevent anything else from playing sounds until after the app is closed. The reverse is also true: while I have other applications open, ONBS will not play sounds. Not sure if this is the place to put this problem, but is anyone else having this issue?

uname -a: Linux (hostname) 5.15.13-arch1-1 #1 SMP PREEMPT Wed, 05 Jan 2022 16:20:59 +0000 x86_64 GNU/Linux

That would be a problem with WINE, you posted in the wrong place I believe. :P

bdotsamir commented 2 years ago

Seems that while starting this app via wine on my machine it takes exclusive control over the audio card and will prevent anything else from playing sounds until after the app is closed. The reverse is also true: while I have other applications open, ONBS will not play sounds. Not sure if this is the place to put this problem, but is anyone else having this issue?

uname -a: Linux (hostname) 5.15.13-arch1-1 #1 SMP PREEMPT Wed, 05 Jan 2022 16:20:59 +0000 x86_64 GNU/Linux

That would be a problem with WINE, you posted in the wrong place I believe. :P

Ah, well, thanks for responding at least. Hopefully some poor soul in the future on their second page on Google will see this post and be that much closer to solving their problem. Hello future!

time-killer-games commented 2 years ago

I think the person who gave me a thumbs down doesn't understand what I said is actually relevant. They shouldn't complain if they are too lazy to report bugs to the right people. We have nothing to do with WINE. Expecting us to fix Wine's bugs is like expecting Microsoft to fix Apple's version of iTunes that just so happens to run on Windows. That is not Microsoft's problem and would be blaming the wrong people 100%.

My suggestion is find out what underlying C++ api is actually being used by the audio playback in the app, contact someone who knows, and once you have that information, attach that information to a WINE bug report, and give them information about your distro's setup or any other information that might be useful, which is the only way it's going to get fixed, I am trying to help and not be provoking, understand that.

That said, if you can wait like others have mentioned I am one of the users looking to help give native linux support so you won't need to rely on buggy workarounds like WINE. Don't bite the hand that feeds you.

TheoCGaming commented 1 year ago

A year later; how's progress on the cross-platform version?

time-killer-games commented 1 year ago

Unfortunately, there's only like 2 or 3 active developers working on this most the time as far as I can tell, I don't really count as one of those primary 2 or 3. The most I've done is fill in a few hollow spots that game maker lacked. Hopefully the other developers can give you a better idea of where we are at.

time-killer-games commented 1 year ago

That being said, i would like to help more proactively with this project and I will try to help more in any way I can to keep things moving in the direction you all want it to get to. :)

mrmelon54 commented 1 year ago

That's cool thanks