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

Since iOS external display, the Exit button causes hangs / freezes #12140

Closed
Halo-Michael opened this issue Jun 28, 2019 · 19 comments
Closed

Since iOS external display, the Exit button causes hangs / freezes #12140

Halo-Michael opened this issue Jun 28, 2019 · 19 comments

Comments

@Halo-Michael
Copy link
Contributor

What happens?

In the latest version (0v1.8.0-367-ge8aad38e7), the "Exit" button does not work and will cause the program frozen
This is different from the problem in #11905 . When the "Exit" button is pressed and the program is frozen, side PPSSPP out of the background and re-open it, PPSSPP can still work.

What should happen?

In version 0v1.8.0-291-gcfa79b686, this problem does not exist yet - the program will exit normally after pressing the "Exit" button

What hardware, operating system, and PPSSPP version? On desktop, GPU matters for graphical issues.

Apple A10 arm64, iOS 12.1.1, 0v1.8.0-367-ge8aad38e7

@Halo-Michael
Copy link
Contributor Author

It seems that more than that. On the non-jailbroken device, whether side PPSSPP out of the background or clicke the "Exit" button, ppsspp will be frozen, only restart can make it work again.

@Halo-Michael
Copy link
Contributor Author

Things are worse than I thought. On devices that use Electra (iPhoneXS, iOS 12.1.2), PPSSPP will also freeze when trying to exit—until it restarts.

@Halo-Michael
Copy link
Contributor Author

I really have a hard time confirming whether this is still caused by syscall - on devices that use unc0ver to jailbreak, it will freeze when clicking the exit button on the main page, and when side out PPSSPP from background and then enter PPSSPP again, it will also freeze briefly - But eventually it will work again without any other operations.

@unknownbrackets
Copy link
Collaborator

It sounds like this is related to #12096

What happens if you revert these changes?
imxieyi@1affe0b#diff-ae393d2b0619781d62bbb186fef9e7dc

Maybe it was only secretly working before because it was crashing on exit?

-[Unknown]

@Halo-Michael
Copy link
Contributor Author

Halo-Michael commented Jul 7, 2019

It sounds like this is related to #12096

What happens if you revert these changes?
imxieyi@1affe0b#diff-ae393d2b0619781d62bbb186fef9e7dc

Maybe it was only secretly working before because it was crashing on exit?

-[Unknown]

Yes, it is.
When I revert these changes, it works again.
But i still doesn't know where's the related to #12096.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Jul 7, 2019

Oops, when I paste #12094, GitHub is strangely changing it to #12096 (in the issue typeahead autocomplete.)

-[Unknown]

@Halo-Michael
Copy link
Contributor Author

Wrong tap

@Halo-Michael
Copy link
Contributor Author

Oops, when I paste #12094, GitHub is strangely changing it to #12096 (in the issue typeahead autocomplete.)

-[Unknown]

That's really cool!
Will external display support broken if revert imxieyi@1affe0b#diff-ae393d2b0619781d62bbb186fef9e7dc ? (I don't have Lightning-to-HDMI line so I can't test it)

@unknownbrackets
Copy link
Collaborator

I'm not sure - I don't have any iOS device to test it. I think probably not.

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Jul 7, 2019

Yeah, I think it makes sense to try to revert that part.

@Halo-Michael
Copy link
Contributor Author

Halo-Michael commented Jul 7, 2019

Note: If really need revent, just revent the part of main.mm

hrydgard added a commit that referenced this issue Jul 7, 2019
@hrydgard
Copy link
Owner

hrydgard commented Jul 7, 2019

Ok, done.

@unknownbrackets unknownbrackets changed the title In the latest version (0v1.8.0-367-ge8aad38e7), the "Exit" button does not work and will cause the program freeze Since iOS external display, the Exit button causes hangs / freezes Jul 7, 2019
@imxieyi
Copy link
Contributor

imxieyi commented Sep 29, 2019

This issue seems to be related to iOS version. I included this in #12094 because touching exit button caused hang on both iOS 12.1.1 and 12.3 and this change fixed it.

I just tried the latest code on master branch on both iOS 12.4 and 13.1.1 and the exit button caused hang. The reason was the same as before:

Assertion failed: (!initialized_), function ~Discord, 
file /.../ppsspp/UI/DiscordIntegration.cpp, line 42.

However it works again if I change the exit routine to the same as #12094.

Maybe we can try running ppsspp on different iOS versions and figuring out since which version this change is needed?

Finally figured out that this is related to build configuration. The assertion doesn't work in release mode. Only debug mode needs this change for exit button to work. Still confused why this change causes hang in release mode.

@unknownbrackets
Copy link
Collaborator

Maybe the assertion failing trips some kind of handling that prevents the hang (since the hang is caused by a "debugger" being attached)?

I think Discord is disabled on iOS anyway, but that code still runs (it's deeper in that it's disabled.)

-[Unknown]

@hrydgard hrydgard added this to the v1.10.0 milestone Sep 30, 2019
@hrydgard
Copy link
Owner

Good find! Should be pretty easy to fix then.

@hrydgard
Copy link
Owner

So it seems that NativeShutdown doesn't run on iOS then, since it calls g_Discord.Shutdown() which would prevent this assert from triggering.

Nevertheless I'm disabling the assert for now since it's pretty low-value.

@Halo-Michael
Copy link
Contributor Author

So can we restore the exit animation on iOS now?

@hrydgard
Copy link
Owner

No idea about that stuff, sorry

@Halo-Michael
Copy link
Contributor Author

After merge the pull request #12421 from sbingner, this problem can basically be confirmed as a complete fix. Even if you run PPSSPP on non jailbroken device, or if CS_DEBUGGED is not turned on, it will no longer freeze on exit.
I have compiled ipa and deb for it and can use them for testing.
https://github.com/Halo-Michael/halo-michael.github.io/raw/master/ipas/PPSSPP_0v1.9.3-80-g73bf6098e.ipa
https://github.com/Halo-Michael/halo-michael.github.io/raw/master/repo/debs/org.ppsspp.ppsspp-dev-latest_0v1.9.3-80-g73bf6098e_iphoneos-arm.deb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants