Page 1 of 1

Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 10:44 am
by djazz
Image

I have managed to get Celeste running on a Raspberry Pi 3B! The game uses Mono + FNA, so it's cross platform. Needs the fkms v3d driver and lots of CMA memory to run. Textures need shrinking, the pi3 only supports 2048x2048 pixels per texture, while Celeste use many textures bigger than that.

Video demo: https://youtu.be/iTBUNb6IKHo

I am working on a guide, you can check out the work in progress guide here.
When the RPi 4B 4GB I ordered arrives, I will update this with details on how well it works on it :)

Stay tuned!

🍓

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 11:33 am
by topguy
Impressive.. hope more people will make Pi "friendly" versions of their games, not so "GPU memory hungry" versions ;-)

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 12:02 pm
by ptitSeb
Nice one! The resize of the Atlas is nice touch. And thanks for mentioning my article :)

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 12:21 pm
by djazz
ptitSeb wrote:
Mon Jul 01, 2019 12:02 pm
Nice one! The resize of the Atlas is nice touch. And thanks for mentioning my article :)
I found your article and decided to try it on Celeste! Thanks for writing it! :)
I tried your gl4es project first but it didn't work. Now after playing around and having learned more I will give it another try. It seems pretty cool :D

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 2:08 pm
by ptitSeb
Well, gl4es will not bring much compared to the full OpenGL driver that exist on the RPi. Only thing is gl4es can downsize the texture on the flight to fit max size constraint. But because you resize the Atlas, I don't think it can be really usefull here.

Glad to see the method works on more hardware! There are really good games in FNA.

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 2:31 pm
by djazz
Is CMA needed for gl4es? That's the biggest issue right now. gl4es doesn't require the v3d fkms/kms driver, right?

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 2:34 pm
by ptitSeb
gl4es will need an GLES2 driver. Not sure is needed to provide GLES2 driver on the RPi (CMA?).

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 7:26 pm
by djazz
ptitSeb wrote:
Mon Jul 01, 2019 2:34 pm
gl4es will need an GLES2 driver. Not sure is needed to provide GLES2 driver on the RPi (CMA?).
I got it to work with "LIBGL_FB=3 LIBGL_ES=2 LIBGL_GL=21" and "gpu_mem=700" but it runs very slow, less than 10 fps ingame. So I'll stick to OpenGL from v3d fkms for now.

CMA seems to be dynamic memory allocation for the gpu when using the v3d driver.

Here is the output using the flags above but with different LIBGL_ES values:


LIBGL_ES=0:
LIBGL: Unable to initialize EGL.
LIBGL: Unable to create EGL display.
IGLDevice: OpenGLDevice
OpenGL Device: GL4ES wrapper
OpenGL Driver: 2.1 gl4es wrapper 1.1.1
OpenGL Vendor: ptitSeb
MojoShader Profile: glsl120

LIBGL_ES=1:
LIBGL: ERROR: EGL Error detected: EGL_BAD_MATCH
LIBGL: ERROR: EGL Error detected: EGL_BAD_MATCH

LIBGL_ES=2:
LIBGL: Error while creating main fbo (0x8CDD)
LIBGL: ERROR: EGL Error detected: EGL_BAD_MATCH

LIBGL_ES=3:
IGLDevice: OpenGLDevice
OpenGL Device: GL4ES wrapper
OpenGL Driver: 2.1 gl4es wrapper 1.1.1
OpenGL Vendor: ptitSeb
MojoShader Profile: glsl120

Re: Celeste on the Raspberry Pi

Posted: Mon Jul 01, 2019 9:40 pm
by djazz
I got it running on a RPi 2B by following the guide! It runs slower, who would've thought! This works because the 2B also has 1 GB of RAM.
Watch it here: https://www.twitch.tv/videos/446954756?t=52m9s

Re: Celeste on the Raspberry Pi

Posted: Tue Jul 02, 2019 7:53 am
by ptitSeb
Thank you for the testing!

The LIBGL_ES=1 should work, but an EGL_BAD_MATCH.... Maybe we can fix that. If you could do the same test again, but rebuild gl4es with th line 40 of src/glx/glx.c uncommented, to have glx debug info printout.

Also, LIBGL_FB=3 should work basically everywhere, but because it involve a PBuffer and heavy blit, it is, most a time, too slow for games.

Also, I don't want to put too much gl4es stuff in your Celeste thread, so maybe we can create a new thread for that?

Re: Celeste on the Raspberry Pi

Posted: Tue Jul 02, 2019 9:19 am
by djazz
https://www.raspberrypi.org/forums/view ... 2#p1490532

The Raspberry Pi 4 should be able to run Celeste without the texture shrinking/patching :D

Re: Celeste on the Raspberry Pi

Posted: Wed Jul 03, 2019 11:59 am
by djazz
Hmm, not very successful. Seems to be something wrong with texture mapping on the Pi 4. And it runs 1-2 fps slower than a Pi 3! What?!

Pi 3:Image
Pi 4 with 4 GB: Image

Reported the bug to Mesa, hopefully they know what's wrong and how to fix it. https://bugs.freedesktop.org/show_bug.cgi?id=111052

Re: Celeste on the Raspberry Pi

Posted: Mon Aug 26, 2019 5:48 pm
by djazz
I got it working on the Raspberry Pi 4! I needed to compile latest Mesa to fix the visual artefacts.
https://www.youtube.com/watch?v=sTlY_hbe51Y

Re: Celeste on the Raspberry Pi

Posted: Fri Jun 26, 2020 2:11 pm
by sgtcrispy
Sorry to necro bump, but I've given this a go and all seems to install fine but when running I get this error. Any ideas?
Running on a RPi4 8GB off a usb ssd drive.

Celeste Error Log
==========================================

6/26/2020 9:08:37 AM
System.DllNotFoundException: mojoshader
at (wrapper managed-to-native) MojoShader.INTERNAL_glBestProfile(MojoShader/MOJOSHADER_glGetProcAddress,intptr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,intptr)
at MojoShader.MOJOSHADER_glBestProfile (MojoShader+MOJOSHADER_glGetProcAddress lookup, System.IntPtr lookup_d, MojoShader+MOJOSHADER_malloc m, MojoShader+MOJOSHADER_free f, System.IntPtr malloc_d) [0x00000] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Graphics.OpenGLDevice..ctor (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters, Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter) [0x00302] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.SDL2_FNAPlatform.CreateGLDevice (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters, Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter) [0x00035] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, Microsoft.Xna.Framework.Graphics.GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x000a4] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice () [0x000ae] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.get_GraphicsDevice () [0x00008] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Game.InitializeGraphicsService () [0x00033] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Game.get_GraphicsDevice () [0x00008] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Monocle.Engine..ctor (System.Int32 width, System.Int32 height, System.Int32 windowWidth, System.Int32 windowHeight, System.String windowTitle, System.Boolean fullscreen) [0x000f7] in <0346aea246134d37b6097e247b022b4e>:0
at Celeste.Celeste..ctor () [0x00012] in <0346aea246134d37b6097e247b022b4e>:0
at Celeste.Celeste.Main (System.String[] args) [0x0011c] in <0346aea246134d37b6097e247b022b4e>:0

Re: Celeste on the Raspberry Pi

Posted: Sun Jun 28, 2020 6:37 am
by hex007
@djazz It might be worth mentioning that this will work only for 32-bit OSs like Raspberry Pi OS (32-bit).

Fmod, which is a dependency, doesnt provide shared libs in aarch64. So 64 bit OSs like Pi OS (64-bit), Gentoo, Manjaro, Ubuntu 64 bit, etc will not support this without support for 32 bit executable support, which most of them lack.

Re: Celeste on the Raspberry Pi

Posted: Mon Jun 29, 2020 8:28 am
by ptitSeb
sgtcrispy wrote:
Fri Jun 26, 2020 2:11 pm
Sorry to necro bump, but I've given this a go and all seems to install fine but when running I get this error. Any ideas?
Running on a RPi4 8GB off a usb ssd drive.

Celeste Error Log
==========================================

6/26/2020 9:08:37 AM
System.DllNotFoundException: mojoshader
at (wrapper managed-to-native) MojoShader.INTERNAL_glBestProfile(MojoShader/MOJOSHADER_glGetProcAddress,intptr,MojoShader/MOJOSHADER_malloc,MojoShader/MOJOSHADER_free,intptr)
at MojoShader.MOJOSHADER_glBestProfile (MojoShader+MOJOSHADER_glGetProcAddress lookup, System.IntPtr lookup_d, MojoShader+MOJOSHADER_malloc m, MojoShader+MOJOSHADER_free f, System.IntPtr malloc_d) [0x00000] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Graphics.OpenGLDevice..ctor (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters, Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter) [0x00302] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.SDL2_FNAPlatform.CreateGLDevice (Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters, Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter) [0x00035] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, Microsoft.Xna.Framework.Graphics.GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x000a4] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.Microsoft.Xna.Framework.IGraphicsDeviceManager.CreateDevice () [0x000ae] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.GraphicsDeviceManager.get_GraphicsDevice () [0x00008] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Game.InitializeGraphicsService () [0x00033] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Microsoft.Xna.Framework.Game.get_GraphicsDevice () [0x00008] in <4aab567ce63d4d3d8764d881a46a5917>:0
at Monocle.Engine..ctor (System.Int32 width, System.Int32 height, System.Int32 windowWidth, System.Int32 windowHeight, System.String windowTitle, System.Boolean fullscreen) [0x000f7] in <0346aea246134d37b6097e247b022b4e>:0
at Celeste.Celeste..ctor () [0x00012] in <0346aea246134d37b6097e247b022b4e>:0
at Celeste.Celeste.Main (System.String[] args) [0x0011c] in <0346aea246134d37b6097e247b022b4e>:0
You need ibmojoshader (that is not too recent).

You can clone it from there https://github.com/FNA-XNA/MojoShader.git (you may need to go back in history, and use branch "fna")

Re: Celeste on the Raspberry Pi

Posted: Tue Jun 30, 2020 12:33 am
by hex007

Re: Celeste on the Raspberry Pi

Posted: Tue Jun 30, 2020 8:03 am
by webdev
What's the FPS after overclocking?
Celeste also has OpenGL version, will it get batter FPS than XNA/FNA version?

Re: Celeste on the Raspberry Pi

Posted: Tue Jun 30, 2020 9:19 am
by snowballEarth
Does Celeste work through Steam on TwisterOS on the pi4?
It's much cheaper to buy right now than at other places.

Re: Celeste on the Raspberry Pi

Posted: Tue Jun 30, 2020 10:37 am
by webdev
snowballEarth wrote:
Tue Jun 30, 2020 9:19 am
Does Celeste work through Steam on TwisterOS on the pi4?
It's much cheaper to buy right now than at other places.
Bastion is XNA game too, it has a demo version, could you test it on Twister OS?