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

Idea - Add Raspbian Support #2133

Closed
afyber opened this issue Feb 6, 2018 · 65 comments
Closed

Idea - Add Raspbian Support #2133

afyber opened this issue Feb 6, 2018 · 65 comments
Labels

Comments

@afyber
Copy link

afyber commented Feb 6, 2018

Would it be possible to add support for Raspbian? When I try to run the generic 32-bit it says:

MultiMC Dir: /home/pi/MultiMC
No missing dependencies found.
./MultiMC: line 38: /home/pi/MultiMC/bin/MultiMC: cannot execute binary file: Exec format error
@peterix peterix added the support label Feb 6, 2018
@peterix
Copy link
Member

peterix commented Feb 6, 2018

Well, that won't work. In this case, 'generic' means 'intel x86'.

Possible, sure. It's not impossible, but it would be a lot of work and it would require ongoing maintenance.

On the MultiMC side, it would involve some design changes and setting up a lot of build automation. Raspberry has an ARM CPU. I would need an ARM machine or at least some sort of emulation for running tests.

On the Minecraft end, the metadata would have to change to include native libraries for ARM, which I'd have to build, maintain and host somewhere. I can change the metadata, because MultiMC 0.6.0 no longer directly grabs that from Mojang anymore, so this is at the very least possible now.

I'd hoenstly rather do other things that benefit existing users. If you want this stuff for yourself, making an ARM build would be the first step. There are also some BSD patches that you could look at for integration with the system version of LWJGL -- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224823

Also, if you do any of this on your own, write the details down, push changes to github, tell me about it so it doesn't go away.

@peterix peterix closed this as completed Feb 14, 2018
@DestyNova
Copy link

I'd like to help with this and have access to an RPi4. Is there an easy way to get started with this? It's been a long time since I wrote C++ code 😀

@DestyNova
Copy link

Ok! Got it to build using the following commands:

mkdir build && cd build
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
make -j3

At first I had a problem with the Qt UI being waaaay bigger than my screen, perhaps to do with some sort of pixel scaling issue in my config. I fixed it by applying this environment variable:

QT_AUTO_SCREEN_SCALE_FACTOR=0

I've added this line to /etc/environment which I presume will sort the issue for a few other apps too (VLC and Xmoto both have been looking weird on this Pi for a while).

Then I tried to run MultiMC with 1.15.2 and, as expected, ran into a problem with lwjgl:

org.multimc.EntryPoint.main(EntryPoint.java:34)
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl32.so
        at cxm.<clinit>(SourceFile:38)
        ... 11 more
Caused by: java.lang.UnsatisfiedLinkError: Failed to locate library: liblwjgl32.so

Will try to make more progress tomorrow.

@peterix peterix reopened this May 6, 2020
@peterix peterix added feature and removed support labels May 6, 2020
@peterix
Copy link
Member

peterix commented May 6, 2020

Welp, keep me posted.

#2133 (comment) is still completely valid, but if you can get this to the point where people can build and use it on their own, there's a chance.

@JJTech0130
Copy link

I have it built and provide a patcher for it... it only works when the pi is in ARM64 mode though...
All you need to do is put the patcher as the pre-launch command. I also have up-to date arm64 builds. Check here for builds and here for the patcher.

@JJTech0130
Copy link

And no... you wouldn’t necessarily need an arm64 machine emulator for building it as you can just cross compile it (I’m currently trying to do that... haven’t finished it yet) and then relying on the community to test it.

@JJTech0130
Copy link

I don’t know if it had to do with the os your using, but I just changed it to use clang instead of g++ and it worked fine out of the box. It did need the patcher to make it actually run Minecraft, which required me to custom build LWJGL, but I currently use it daily without issues and was able to use it on several RPi4 64bit oses without issues. I found it runs the fastest on the 64bit gentoo with overclocking.

@comp500
Copy link

comp500 commented May 7, 2020

Since LWJGL 3.2.3, official ARM32/64 builds are available, and those work with the Pi 3 (I tested on 32bit raspbian but I'd assume the ARM64 builds also work on 64bit operating systems). Minecraft 1.13+ uses LWJGL 3.2.2 but it seems to be compatible with 3.2.3, so the official builds work.

For patching the LWJGL JSON, I made https://github.com/comp500/MultiMCPi a few weeks ago, but obviously that can be done in meta with the systems meta already uses.

In terms of compiling MultiMC itself, that's a bit more of a mess. I didn't manage to compile Qt (which most of the Qt cross compilation things use) but I managed to compile MultiMC on my Pi 3 using prebuilt Qt from Raspbian's repos. As @JJTech0130 said it does need clang to compile, but apart from that qmake works fine.

@DestyNova
Copy link

Yup, like I said it builds fine for me with clang. It just runs into the same lwjgl problem that's cropped up in all Minecraft versions since maybe 1.13. I'd like to make it build for vanilla 32-bit Raspbian, since I was able to run Minecraft 1.14 that way on an RPi4 by following these instructions. Presumably it's possible without Optifine too.

@comp500
Copy link

comp500 commented May 7, 2020

It is possible without Optifine - I've tested it with Fabric + Lithium + Sodium + Phosphor, although 1.13+ in general doesn't run very well on the Pi 3.

Another thing to note is that I ran into a segfault when closing the instance window, but it seems to save the changes properly.

Edit: I've put some rough build instructions in https://github.com/comp500/MultiMCPi if you want to run it on vanilla 32-bit Raspbian, that does install Java 14 but you can replace 14 with 8 if you want to use older Minecraft instances or Forge. (in theory it has better performance, but I haven't tested this)
To actually run the game you'll want to make an instance with 1.13+, then select LWJGL 3 and click Customize on the right, then Edit. Run the script in my repo (or JJTech0130's) on the file that is opened, then you can start the game with the right native libraries. (might need a restart of MultiMC)

@JJTech0130
Copy link

You mention LWJGL problems, under 64bit os’es I have had no problems and can run pretty much any mods I’ve tried from 1.6 to 1.15... the versions that use LWJGL 1 don’t work but I have never seen anyone using them... the only thing is controller mods and the like that interact directly with the os don’t work but that’s a Linux problem it won’t run on my intel pc either

@JJTech0130
Copy link

JJTech0130 commented May 7, 2020

I always use 64 bit oses for my pi’s anyway because it often performs better in some tasks especially sense most of the os’es are made exclusively for the pi4 and can use armv8 acceleration

@comp500
Copy link

comp500 commented May 7, 2020

I would have used a 64 bit OS, but I didn't manage to get Manjaro working with the proper GL driver - I think it's better supported on the pi 4. I think the aforementioned LWJGL problems were just because MultiMC was using the x86_64 binaries rather than the ARM32 ones, that's what the scripts fix.

@DestyNova
Copy link

@JJTech0130 agreed, I'd generally prefer to use a 64-bit OS myself, but my kid uses totally vanilla 32-bit Raspbian. It would be great to be able to say that (real) Minecraft is supported (almost) out-of-the-box on the Pi without needing to install a 64-bit OS 😃

Thanks @comp500 and @JJTech0130 -- this is really exciting already! Looking forward to trying your work on the weekend.

@JJTech0130
Copy link

JJTech0130 commented May 8, 2020

I use this script to build it on my RPi Jenkins server FYI. I also use some other applications to publish artifacts to github automatically and to allow web hooks without bypassing the firewall (port forwarding) but they don’t really matter.

git submodule init
git submodule update
mkdir build
mkdir install
cd build
cmake -D MultiMC_META_URL:STRING="https://jjtech0130.github.io/meta-multimc/" CMAKE_CXX_COMPILER=clang++ CMAKE_C_COMPILER=clang CMAKE_INSTALL_PREFIX=../install ../
make -j3

[EDIT]
I also use this script to package it into a .tar.gz release file like the official one as the normal packager fails when it realizes it is in a sandbox 😄

cp ./application/package/linux/MultiMC ./install
mkdir ./install/bin
cp ./build/MultiMC ./install/bin/
cp ./build/libMultiMC_* ./install/bin/
cp ./build/jars/ ./install/bin/ -r
rm ./install/bin/jars/CMakeFiles/ -r
tar -zcvf build-$BUILD_NUMBER.tar.gz ./install

[EDIT]
Added Meta URL parameter to cmake command

@JJTech0130
Copy link

JJTech0130 commented May 30, 2020

Well... there is the 8GB Rpi4 now, and a beta 64 bit raspbian so that you can use all 8 gb in one process... that should make MC a lot faster 😄
EDIT:
I see what you are saying, but it still help in both my cases - lots of mods, and a regular render distance (rather then running out of ram at anything higher then the lowest setting)

@dominic-03
Copy link

@JJTech0130 More RAM doesn't neccesarily mean it will run faster. Mine runs great with 2gb RAM allocated. Unless you use a lot of mods extra RAM can actually make it slower.

@comp500
Copy link

comp500 commented May 30, 2020

With the newer GCs (especially G1 and ZGC) allocating too much RAM isn't really a problem. The extra RAM will be useful for file caching though - you could even potentially use some of it as a ramdisk. However, 64 bit ARM has access to more registers, which means Java (especially newer versions like Java 14) should be faster than on 32 bit ARM. At some point though, you'll be limited by the graphics hardware anyway.

@JJTech0130
Copy link

JJTech0130 commented Jun 4, 2020

Is this a bug? Exit code 0 should mean success, right?????

MultiMC version: 0.6.12-custom


Minecraft folder is:
/home/pi/MultiMC/instances/1.14/.minecraft


Java path is:
/usr/lib/jdk8u252-b09/bin/java


Java is version 1.8.0_252, using 32-bit architecture.


Running Pre-Launch command: ./patches/patcher.sh 1.14
The process failed to start.
Pre-Launch command failed with code 0.

And yes, this is 64-bit ARM java, it just doesn't detect it right.
This only happens sometimes which is puzzling as there seems to be no logic to it failing or not.
Sometimes it will run first try, sometimes requires a restart of MMC, sometimes a reboot, and, if all else fails, a re-install.

EDIT: Just for clarification, this was run on the 64-bit nspawn container in Raspberry Pi OS.

@JJTech0130
Copy link

JJTech0130 commented Jun 8, 2020

On the 64 bit RPiOS it renders the QT window really large and then crashes the X server. It doesn't even get past the setup: the last thing it shows it the log it "Downloading Translations". Not sure why. I am not using 4k, only 1080p, so maybe it thinks it should render it in 4k? I have no idea.
EDIT: Figured out a fix! You need to run export QT_AUTO_SCREEN_SCALE_FACTOR=0 before launching MultiMC. The only explanation I can think of it that it "auto-scales" to 4k.
EDIT: 🤦 Just realized this issue was already addressed ^^^^

@JJTech0130
Copy link

JJTech0130 commented Jun 8, 2020

Here is a screenshot of it running the latest MC 1.15.2 without optifine on Hypixel on RPiOS 64bit:
screenshot

There is still the "Exit Status 0" bug so you have to maually patch everything, but oh well
The FPS are terrible without optifine, but thats just fine 😄

@JJTech0130
Copy link

JJTech0130 commented Jun 8, 2020

Found another bug: when you close the configuration window MultiMC crashes with a segfault:
./MultiMC: line 93: 30110 Segmentation fault "${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" "$@"
Should I file a bug? Or does it not count because it is an unsupported platform?

@JJTech0130
Copy link

Well. This is confusing. I found that if you use the ABSOLUTE PATH to the patcher and then run it ~2 times it will eventually succeed in running.

@JJTech0130
Copy link

But apparently my patcher's "Quick 'n Dirty" approach to patching LWJGL2 doesn't work on RPiOS 64-bit 😢
It says it cant find or run libawt_xawt.so. What is it? Google comes up with libawt.so, but not that!
Here is the full error:

java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
	at org.multimc.EntryPoint.listen(EntryPoint.java:143)
	at org.multimc.EntryPoint.main(EntryPoint.java:34)
Caused by: java.lang.UnsatisfiedLinkError: /home/pi/MultiMC/instances/1.9/natives/liblwjgl.so: libawt_xawt.so: cannot open shared object file: No such file or directory (Possible cause: architecture word width mismatch)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1934)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1850)
	at java.lang.Runtime.loadLibrary0(Runtime.java:870)
	at java.lang.System.loadLibrary(System.java:1122)
	at org.lwjgl.Sys$1.run(Sys.java:72)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
	at org.lwjgl.Sys.loadLibrary(Sys.java:96)
	at org.lwjgl.Sys.<clinit>(Sys.java:117)
	at bcf.I(SourceFile:2744)
	at net.minecraft.client.main.Main.main(SourceFile:39)
Exiting with -1
	... 8 more
Process exited with code 255.

@Painadath
Copy link

We have arm32 lwgl libraries and I run Minecraft java on my pi I just needs to use multimc

@Painadath
Copy link

And also we have both aarch64 and arm32 lwgl libraries

@TechDudie
Copy link

TechDudie commented Sep 7, 2021

Why not???? seriously??? there are plenty of people with Microsoft accounts and raspberry pis

i cant wait until theres microsoft account support (or is there support already)a

not suppporting raspbian is NOT a good idea

this launcher is fantastic

@Painadath
Copy link

My firend uses multimc on his aarch64 pi IDK how he build it

@JJTech0130
Copy link

Everyone should use the version on pi-apps, it has Microsoft account support and is maintained by someone much more active than I am.

@Zetabite
Copy link
Contributor

they should change the naming, to reflect the liscense

@JJTech0130
Copy link

JJTech0130 commented Nov 12, 2021

To quote @theofficialgman on the raspberry pi forums:

NOTE: This build is NOT a fork, you are executing a buildscript to build from the develop branch of the official MultiMC5 github repo BUT it does use a custom meta repo for the arm64/armhf builds, which is necessary as microsoft and the multimc5 devs do not provide arm64/armhf native libraries
MultiMC5 does not give support for custom builds, your custom build included (this buildscript does not distribute custom builds, you build it yourself by running it)

https://forums.raspberrypi.com/viewtopic.php?f=78&t=321888

I have no idea if he is right, I've mostly abandoned this project anyways so it doesn't matter much to me.

However, it seems similar to what the WoR people are doing with Windows, they are not distributing modified windows, rather letting them do it themselves, so in my mind it's a bit different. He's not even distributing the tar.gz like I was.

@peterix
Copy link
Member

peterix commented Nov 12, 2021

The answer is no.

@peterix peterix closed this as completed Nov 12, 2021
@peterix
Copy link
Member

peterix commented Nov 12, 2021

I'll do this properly when Mojang provides the files, and until then, I will treat any attempts to do this as forks - that should not infringe on the MultiMC name, or funnel support issues to the official channels.

I am not interested in dealing with this until it becomes feasible.

@JJTech0130
Copy link

I support your decision. I was hoping that this might gain official support from Microsoft, especially with other ARM platforms like the M1 and Surface entering the market, but it looks like it won't.

@JJTech0130
Copy link

I will be archiving my repositories, and adding a notice, as I don't have time to maintain them anyway and they have fallen behind.

@peterix
Copy link
Member

peterix commented Nov 12, 2021

It eventually will. Probably first on Apple M1 hardware.

@JJTech0130
Copy link

Maybe in the meantime, someone will rebrand it to comply with the license, but I don't have time for that, so I'll just use my own build without providing public builds or access. 😄

@peterix
Copy link
Member

peterix commented Nov 12, 2021

/shrug

@JJTech0130
Copy link

I think I have archived most everything. Ping me if there's a problem or if people are still using it and I need to further restrict access.

@peterix
Copy link
Member

peterix commented Nov 12, 2021

I don't want to bury it, I just don't want to deal with people coming in with some weird hacked up setup on a platform I don't even have access to.

@JJTech0130
Copy link

JJTech0130 commented Nov 12, 2021

I'm just archiving for now, I'll leave it up, but I'm making it very clear that it is deprecated and unsupported.
Cuz right now, despite it linking to theofficalgmans version for quite a while, I'm still getting stars and support requests and visitors... Guess I wasn't clear enough.

@Gabrielow11
Copy link

Gabrielow11 commented Jan 24, 2022

I can run minecraft on rpi4 (4gb), but with the old launcher and only demo, I need MultiMC to login with MS

@JJTech0130
Copy link

JJTech0130 commented Jan 24, 2022 via email

@kb-1000
Copy link
Contributor

kb-1000 commented Jan 24, 2022

As of last time I checked (rather recently), the pi-apps package also contains behavior I'd call malicious.
Debranding wasn't "just for fun" or to annoy users... you're not supposed to use MultiMC's branding, and never have been either. It was supposed to make it really easy to comply with that... in fact, you don't need to do anything really, now... you'd specifically, most likely with harmful intentions, have to change that to revert the changes to not comply.
No, "it's just a build script" doesn't count.
See also peterix' comment here: #2133 (comment)

@JJTech0130
Copy link

JJTech0130 commented Jan 24, 2022

¯_(ツ)_/¯
I don’t even play Minecraft anymore, but I never unsubscribed from this thread. They should rebrand it, but I’m not in charge of that, and it’s the easiest to install and fully featured launcher for Minecraft on raspberry pi.
EDIT: I’ve unsubscribed from this thread. Mention me if you need me.

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

No branches or pull requests