mmatyas / pegasus-frontend

A cross platform, customizable graphical frontend for launching emulators and managing your game collection.
http://pegasus-frontend.org
Other
1.27k stars 114 forks source link

[Weird] Pegasus crashing Amiberry? #646

Closed nemo93 closed 4 years ago

nemo93 commented 4 years ago

hello @mmatyas hope you're doing ok. I'm reaching out as I do have a weird issue with Pegasus and Amiberry (an Amiga emulator optimized for ARM available in Retropie).

Issue

Amiberry is throwing an exception or even weirder prevent you from setting/modifying specific RAM settings within the emulator GUI. This occurs only when using Pegasus and whenever Pegasus is running. I've tried to replicate under those environments:

Definitely the issue happens only when Pegasus is running and/or when I launch an Amiga game which requires Z3 memory straight from it.

Environment / setup

Steps to reproduce

  1. compile Amiberry from source thanks to Retropie setup (binary update should be ok too).

  2. setup Pegasus to let it run Amiga *.lha packages (whdload)

  3. then try running DungeonMaster_v1.2_0833.lha (requires Z3 memory) => crash

    • you could also run Amiberry from a terminal (with Pegasus in background) to get to Amiberry GUI. Then go to Quickstart->pick A1200 from dropdown, CPU-> change to 68030, then change back to 020. Make sure 24-bit addressing is off. Then go to RAM and check the Z3 slider can be moved around => it will not which is not expected.
    • you could also launch a *.lha from a remote command-line session (while keeping Pegasus running in background). Ensure Pegasus is running on the Pi. Ssh to the Pi and type in: $ ./amiberry -autoload=/home/pi/RetroPie/roms/amiga/DungeonMaster_v1.2_0833.lha => crash with just $ ./amiberry (to get straight to the GUI) => you won't be able to move the Z3 slider after picking a A1200 or A4000 quick config.
  4. Amiberry will crash and generate a stacktrace.

The outcome will always be the same: crash of Amiberry or being unable to assign any Z3 memory. I don't really see the relation between Amiberry and Pegasus but there might be something! Any help appreciated. Thanks.

mmatyas commented 4 years ago

Hi, if I understand correctly ("you could also launch a .lha from the command line => crash") this also happens if you run Amiberry on its own, without Pegasus?

nemo93 commented 4 years ago

hey @mmatyas apologize :( Poorly phrased. I've edited my statement. You could launch a .lha from command-line (say from a remote ssh session) while still running Pegasus in the background then it will crash. If you exit Pegasus and launch the same remote command now Amiberry will run just fine. => the only way to get Amiberry running as it should is to close Pegasus. o_0

mmatyas commented 4 years ago

Hm so Amiberry actually does start up, ie. neither Pegasus nor Amiberry crashes on launch. but Amiberry has problems when changing some of its settings? When does the crash happen exactly? On touching the slider, or maybe when returning to the game? I see from the linked thread that someone reported it working; could it be a config file issue? Have you tried removing any user settings (if Amiberry has such things)?

About the remote SSH, the video driver of the Pi only allows running one graphical application at a time (or a single graphical desktop), so starting 2 GUIs in parallel will likely crash one of them (when launching from Pegasus, Pegasus closes itself first so that the launched program could access the GPU). Also I think launching Amiberry from SSH would also require setting DISPLAY=:0, to make it pick the correct screen, but it might be handled by the program too.

nemo93 commented 4 years ago
mmatyas commented 4 years ago

Ok, I've set up Amiberry and Dungeon Master on a Pi 3, but I could not reproduce this crash. Here's what I did, feel free to tell me if I missed something:

First I tried from EmulationStation:

Then I tried from Pegasus, launching from the command line by typing pegasus-fe. I've done exactly the same steps, and Z3 is also greyed out there too and cannot be selected or modified. The game seems to work fine.

nemo93 commented 4 years ago

@mmatyas let me first thank you for spending time and testing this out. Truly appreciated.

My Pegasus setup includes an amiga.metadata.txt file with the following defined:

collection: Amiga
shortname: amiga
directory: /home/pi/RetroPie/roms/amiga
launch: /opt/retropie/supplementary/runcommand/runcommand.sh 0 _SYS_ amiga "{file.path}"
extensions: lha, cue, uae

And somewhere in that file there's a definition for DungeonMaster_v1.2_0833.lha with description etc. Whenever I launch DungeonMaster_v1.2_0833.lha I can see the following in lastrun.log:

2020-05-22T13:28:41 [i] Executing command: [`/opt/retropie/supplementary/runcommand/runcommand.sh`,`0`,`_SYS_`,`amiga`,`/home/pi/RetroPie/roms/amiga/DungeonMaster_v1.2_0833.lha`]
2020-05-22T13:28:41 [i] Working directory: `/opt/retropie/supplementary/runcommand`
2020-05-22T13:28:41 [i] Process 1992 started
2020-05-22T13:28:41 [i] ----------------------------------------
2020-05-22T13:28:50 [i] ----------------------------------------
2020-05-22T13:28:50 [i] The external program has finished cleanly

Hereafter the content of my emulators.cfg from Retropie configs amiga dir:

amiberry = "/opt/retropie/emulators/amiberry/amiberry.sh auto %ROM%"
amiberry-a500 = "/opt/retropie/emulators/amiberry/amiberry.sh rp-a500.uae %ROM%"
amiberry-a1200 = "/opt/retropie/emulators/amiberry/amiberry.sh rp-a1200.uae %ROM%"
default = "amiberry"

Game still doesn't run here. Crash and back to Pegasus. Also the fact you can't set any Z3 after doing the steps described above is not normal. You should be able to set Z3 as long as 24 bit addressing is turned off.

May I ask also for you to try from the terminal session directly please? I mean exit EmulationStation/Pegasus. Log in with the pi user and run:

$ cd /opt/retropie/emulators/amiberry
$ ./amiberry.sh auto /home/pi/RetroPie/roms/amiga/DungeonMaster_v1.2_0833.lha

Alternatively:

$ cd /opt/retropie/emulators/amiberry
$ ./amiberry -autoload=/home/pi/RetroPie/roms/amiga/DungeonMaster_v1.2_0833.lha

=> from terminal both commands allow the game to properly work here. I can set Z3 too.

I'm really lost here as I don't see any obvious relation between an emulator setting and a frontend...

mmatyas commented 4 years ago

Ok, flashed the card again, same setup, except I have not even installed Pegasus or anything else, just Amiberry from source

amiberry = "/opt/retropie/emulators/amiberry/amiberry.sh auto %ROM%"
default = "amiberry"
amiberry-a500 = "/opt/retropie/emulators/amiberry/amiberry.sh rp-a500.uae %ROM%"
amiberry-a1200 = "/opt/retropie/emulators/amiberry/amiberry.sh rp-a1200.uae %ROM%"

Considering the nature of the bug and all the test results so far, to me this doesn't seem to be related to Pegasus either.

nemo93 commented 4 years ago

thanks again @mmatyas for spending time and testing this out. In the light of the above I really do not want to waste more time on that. I'm going to close that ticket then. It should be something with my setup... Thanks a lot!