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

Add ARM Linux (Raspberry Pi) Build tutorial/support #167

Open
ghost opened this issue Dec 27, 2022 · 6 comments
Open

Add ARM Linux (Raspberry Pi) Build tutorial/support #167

ghost opened this issue Dec 27, 2022 · 6 comments
Labels
compilation help wanted Extra attention is needed

Comments

@ghost
Copy link

ghost commented Dec 27, 2022

It would be great, considering someone on reddit already made it but it fails

@stxticOVFL stxticOVFL transferred this issue from RSDKModding/Sonic-Mania-Decompilation Feb 7, 2023
@stxticOVFL stxticOVFL added help wanted Extra attention is needed compilation labels Feb 7, 2023
@DolphinCube
Copy link

I'm sorry. Has anyone figured this out yet? I am trying to compile it as well...

@squbbish
Copy link

Hello! Just tried to compile it on my Debian ARM container and it returns this error
Screenshot_2023-02-25_07-12-39
the other files compiles fine though, i also have no idea what causes this

@stxticOVFL
Copy link
Collaborator

stxticOVFL commented Feb 27, 2023

This just means you didn't set up the Game symlink correctly. If your goal was to just build v5, adding RSDK_ONLY=1 should do the trick. (Also, AUTOBUILD=0 is implied.)

@coreybruce
Copy link

I still can't figure out to compile this, how do I compile and get the binary? I only get the .so file

@ccricers
Copy link

ccricers commented Feb 11, 2025

I was able to get it to compile on a Raspberry Pi based off this guide for compiling Sonic Mania to run on Raspberry Pi 4. I made changes in some of the steps because I wanted to try it on Raspberry Pi Zero 2W hardware, with Debian Bookworm 64 bit (no RetroPie).

Changes I made in these steps:

  • Replaced -mtune=cortex-a72 with -mtune=cortex-a53 for the CFLAGS (you don't need to change unless using a Pi 3 or Zero 2W)
  • Skip all the steps related to RetroPie and EmulationStation (the binary can be run from a desktop)
  • /RSDKv5/RSDK/Graphics/Video.cpp may need to be edited (see below)

This creates the RSDKv5(U) binary to use your Data.rsdk file with.
Compiling All.c in the SonicMania/Objects/ folder will take a long time on this hardware.

Below is a possible issue when building - could this be worth opening a new issue for?

One problem I encountered- the Graphics/Video.cpp file produced an object file that gave me a linking error. I received the following error messages:

/usr/bin/ld: bin/obj/Linux/SDL2/RSDKv5/RSDKv5/RSDK/Graphics/Video.o: undefined reference to symbol 'ogg_stream_packetout'
/usr/bin/ld: /lib/aarch64-linux-gnu/libogg.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:241: bin/Linux/SDL2/RSDKv5U] Error 1

The full motion videos (like the ones that play in the idle title screen) depend on this.

I do not know why specifically ogg_stream_packetout was undefined, even though the version of libogg I have has it defined in the headers. Could it related to a Debian OS specific build?

In the meantime I created a workaround by creating empty versions of the following functions:

bool32 RSDK::LoadVideo(...)
void RSDK::ProcessVideo()

And wrapped them in a #ifdef directive (for example _NO_VIDEO_PLAYBACK) which I also defined in the source and compiled that successfully.

Sonic Mania is very playable on the hardware. You just won't be able to see the video cutscenes with this work around (the title screen will just loop back to itself), not unless this could be solved too.

@ccricers
Copy link

ccricers commented Feb 11, 2025

Update to my previous post: Compiling new libraries for libogg and Theora separately fixed the video playback problem for me. I had to use these in place of the shared system libraries.

In the RSDKv5 root folder I created a new directory to place copies of: libogg.so, libtheora.so and libtheoradec.so, and modified the makefile to link to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants