BlitterStudio / amiberry

Optimized Amiga emulator for Linux/macOS
https://amiberry.com
GNU General Public License v3.0
643 stars 86 forks source link

Emulator freezes when trying to quit using UAEquit (from within emulation) #159

Closed Voljega closed 6 years ago

Voljega commented 6 years ago

Hello,

When quitting a WHDL game, emulator goes back to an empty workbench screen, seems to freeze and it becomes impossible to quit it, key/button for entering GUI or quitting emulator doesn't work and you need to kill the process manually.

This happens when :

This doesn't happen when striking the key/button to quit the emulator.

Two issues there :

Here's my WHDL 'bootstrap' if it can help and if the issue is between my screen and my chair ;) https://github.com/Voljega/amiga4recalbox/tree/master/installAmiga/whdl

Also I'm using amiberry 2.1 (standard release)

HoraceAndTheSpider commented 6 years ago

The emulator should quit regardless of where the program is in terms of emulation running.

I.e. emulator quit should work both in game and after using the whd-quit, which simply returns you to the Amiga OS.

There is no “real” reason why the whd quit should interfere with this , but will need looking into the additional things added by recallbox

Voljega commented 6 years ago

Yep,

To clarify things, I'm mainly using the whdl folder pasted above, copying it over the game folder and generating the Startup-Sequence command with the game .slave file Every bit of that is done in ram storage (maybe it could be important regarding the bug)

Besides that everything works fine when playing the game, entering the GUI and tweaking it, or quitting it, the problem happens only once I've quitted the game through either the in-game menu or the dedicated whdl quit key shown at beginning (in the window over the workbench)

If it can help, here's what one of my uae looks like : https://pastebin.com/QGVRubfZ It has been simplified since, pruning every unnecessary line, but it's pretty much that.

Do you reproduce the issue on your side with 2.1 version ? If not, it must be a problem on my side...

Voljega commented 6 years ago

Hello, I found the issue : a long time ago (around uae4arm 0.4) someone gave me the uaequit and exitemu to add to my whdload folder to autoamtically quit the emulator after quitting the whdl game through menu or dedicated key. The exitemu command was added to my startup sequence after the calling of the slave files.

Back in the day it works, but I don't know why it freezes amiberry, I removed the call to it and the issue disappear, but of course the emulator isn't exited anymore when whdl game is quit through menu or dedicated key

midwan commented 6 years ago

@Voljega OK, that I can recreate. Not sure why it's happening yet, but at least we know what we're talking about now :) I'll change the title to reflect that.

midwan commented 6 years ago

Also related: UAEquit is a "classic" program used to exit the emulator from within the emulated machine. It's freely available here: http://aminet.net/package/misc/emu/UAEquit

It's very useful for non-keyboard setups. It's supposed to be able to quit the emulator back to the host OS, and so does it with fs-uae, uae, etc... However, on amiberry it leaves the emulation in an unusable state until you press ENTER, then the emulation is restarted with the latest configuration you loaded.

I have also noticed that trying to exit after passing a config file: ./amiberry myconfig.uae ...results on the emulator to re-enter instead of quitting. May be related.

Voljega commented 6 years ago

Oh yeah the thing with passing config file was a nightmare for me a year or so ago with uea4arm.

Ok well I think the exitemu command I was given is itself using the uaequit one, so everything is explained, even if I didn't try to push enter, I'm confindent what you explained was exactly what was happening

vanfanel commented 6 years ago

Is this supposed to be fixed with the latest GUI-related fixes on the dev branch?

midwan commented 6 years ago

No, those fixes are not related to this

midwan commented 6 years ago

This bug only occurs in SDL1, as in SDL2 we get a gui message first ("Amiga sent signal to quit emulator") and the emulator is restarted after clicking on "OK".

I believe the emulator should Quit, not restart after that signal - so that's something to fix. And of course, it should also work in SDL1. Probably the "gui_message" function got the app frozen for some reason there, I'll look into it...

midwan commented 6 years ago

Fixed with 67f4926aaefc425f192977f2067c3a945b94ebbc

vanfanel commented 6 years ago

@midwan : On SDL2, UAEQuit still fails with the latest git on the dev branch... So please don't close it, it's not resolved.

midwan commented 6 years ago

@vanfanel ok, let me give it another test, I was sure I tested it and it worked yesterday...

midwan commented 6 years ago

@vanfanel just tried it again, it quits normally in SDL2 as well.

What did you experience?

vanfanel commented 6 years ago

@midwan : I experience the emulator not quitting by running "uaequit", but resetting instead. Then, if I go to the F12 menu and click on QUIT, it resets again... until I enter the menu again and click QUIT once more.

midwan commented 6 years ago

@vanfanel strange, I don't have this behavior here.. nor has anyone else mentioned this...

Did you try a make clean first, to make sure you compiled all the latest changes?

vanfanel commented 6 years ago

@midwan: yes, I did. May I pass you my small HDF file to try?

midwan commented 6 years ago

@vanfanel sure, if you have something I can test, that would be great. Like I said, I still can't recreate this here...

vanfanel commented 6 years ago

@midwan : How can I send you a couple of files? An email address will do.

midwan commented 6 years ago

@vanfanel please send at midwan -at- gmail -dot- com :)