Ludere icon indicating copy to clipboard operation
Ludere copied to clipboard

PCSX core crashes on rotate

Open redthista opened this issue 5 years ago • 27 comments

the original upload included details on how to allow either portrait or landscape but was locked to the orientation when the game opened. This was useful for roms that crash on orientation change.

redthista avatar Oct 27 '20 19:10 redthista

In the original upload, the config was done through the gradle variables. This meant we were allowed to set the orientation through the Android manifest file. Now, since we use a config from the resources folder, the orientation is set on app start.

Which core are you referencing? I did an update last night that fixed a crashing issue on snes9x.

tytydraco avatar Oct 27 '20 19:10 tytydraco

It was the https://docs.libretro.com/library/pcsx_rearmed/ with the core option: pcsx_rearmed_neon_enhancement_no_main=enabled

redthista avatar Oct 27 '20 20:10 redthista

I think the better approach is to try and fix this issue from the source instead of putting a bandaid on it with locking rotation. Have you tried bundling a BIOS for the PCSX core in the system folder? The system folder acts exactly like RetroArch's, so follow the PCSX instructions for adding a BIOS and see if that fixed the issue.

tytydraco avatar Oct 27 '20 21:10 tytydraco

Good point, I will try with the bios and get back to you.

redthista avatar Oct 27 '20 21:10 redthista

i have tried this with a few different roms and with bios and all of them crash on rotate.

redthista avatar Nov 04 '20 20:11 redthista

Thanks for taking the time to test. Could you possibly try another core besides PCSX? I wonder if there are other PSX emulators in libretro that don't have this issue. If I recall correctly, even retroarch crashed on exiting the core with PCSX. I'll see if I can find a way to not reinitialize the core on rotate or at least catch the exception.

tytydraco avatar Nov 04 '20 20:11 tytydraco

No problem man, happy to help! and I'm struggling to find the Beetle PSX HW core in and of the folders in: http://buildbot.libretro.com/nightly/android/latest/

I can get it in the retro arch android app.

redthista avatar Nov 04 '20 21:11 redthista

I think it goes by mednafen_psx and mednafen_psx_hw, not sure why though. Give that a shot :D

tytydraco avatar Nov 04 '20 21:11 tytydraco

I haven't been able to get them working, seems they rely on the bios more than pcsx. but i have used the bios files i have and cant get the game to start.

redthista avatar Nov 04 '20 22:11 redthista

Yknow what, I just noticed there's a bug: I forgot to set the system directory to the new location! That means the bios was never getting detected. Sadly even after fixing this issue it still crashes on rotating with PCSX :(

I'll continue to work on this.

tytydraco avatar Nov 04 '20 22:11 tytydraco

By the way, just wanted to say I really appreciate the testing <3

tytydraco avatar Nov 04 '20 22:11 tytydraco

@MrThista Would you be able to confirm that the bug still indeed occurs on the latest tag? I did a large number of changes that could have perhaps fixed this issue.

tytydraco avatar Nov 23 '20 19:11 tytydraco

Hey man, I will try get an answer this week for you :)

redthista avatar Nov 23 '20 21:11 redthista

Awesome, thanks! I'm speaking with the LibRetroDroid developer to try to resolve this as well, as for my device, the PCSX and Beetle cores both crash, even in the sample app. It's super helpful to have multiple testers :D

tytydraco avatar Nov 23 '20 21:11 tytydraco

Hey, tried to run another build and I cant work out where to place the rom. Also where have the options for R1 and R2 gone from the config?

redthista avatar Nov 24 '20 21:11 redthista

Place it here: app/src/main/res/raw/rom

The L2 and R2 buttons are removed temporarily as I am working on improving the on-screen controls.

tytydraco avatar Nov 24 '20 21:11 tytydraco

can I manually add the buttons back in? and into a folder called rom or in the raw folder? and do you no longer specify the rom name in the config ? :)

redthista avatar Nov 24 '20 21:11 redthista

You can internally revert this commit: https://github.com/tytydraco/Ludere/commit/c1c6b485742473f69eb1294e8a4ca2ffd6217d6d

And you want to put it in a folder called raw, but the file is called rom. I'll specify this in the README

tytydraco avatar Nov 24 '20 21:11 tytydraco

and rom.[filetype] or rom with no file type?

redthista avatar Nov 24 '20 21:11 redthista

Just rom. The reason is that using this method lets Ludere load the ROM into RAM directly from the APK so we don't need to extract it internally.

tytydraco avatar Nov 24 '20 21:11 tytydraco

Got an error trying to build: Rom is about 500mb

Task :app:mergeReleaseResources FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:mergeReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade AAPT2 aapt2-4.1.0-6503028-windows Daemon #0: Compile 'W:\Android Dev\ROMAPK\PS1 - Diskworld Noir\app\src\main\res\raw\rom' timed out, attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

redthista avatar Nov 24 '20 21:11 redthista

Interesting, how large is the ROM? What happens if you try instead to just put an empty file called "rom" instead of the real file?

tytydraco avatar Nov 24 '20 21:11 tytydraco

500mb and with a blank romfile its a success.

redthista avatar Nov 24 '20 22:11 redthista

Looks like it's an issue with the ROM size; Android Studio's heap can't package it into the APK. This is one of the reasons I was considering saving the analog controls for the Standalone branch of Ludere. You can try with a smaller ROM file, or I can let you know when the standalone branch is ready. I appreciate your help by the way <3

tytydraco avatar Nov 24 '20 22:11 tytydraco

I was able to package a 1.6gb rom previously that worked. and sure man keep me posted :P. I appreciate all your work on the app. some great stuff man.

redthista avatar Nov 25 '20 17:11 redthista

The LibretroDroid developer told me it's due to loading the file as bytes instead of directly from a file. I'm going to need to workaround this by copying a temporary cached rom to the device.

tytydraco avatar Nov 25 '20 17:11 tytydraco

Let me know when its ready to test :)

redthista avatar Nov 25 '20 18:11 redthista