[iOS] RetroArch and game freeze while incoming a call on iPhone
Is there an existing issue for this?
- [x] This is a bug in RetroArch frontend
- [x] I have searched the existing issues https://github.com/libretro/RetroArch/issues/15316 https://github.com/libretro/RetroArch/pull/10497 https://github.com/libretro/RetroArch/issues/261 https://www.reddit.com/r/EmulationOniOS/comments/1ii322u/retroarch_keeps_crashing_when_i_get_called/
Description
When an incoming call is received on an iPhone, regardless of whether it is answered or declined, the running RetroArch and game will freeze, and tapping anywhere on the screen does not respond.
Expected behavior
Game resume after answer or decline a incoming call on iPhone.
Steps to reproduce the bug
- Start a game on iPhone
- Incoming a call
- Answer or decline the call
Version/Commit
1.20.0 ab3b175848
Bisect Results
No response
Present in the nightly version
I don't know
Platform & operating system
iPhone14 iOS 16.2
Affected Cores
No response
Environment information
No response
Relevant log output
The freeze also happens when an alarm goes off. There does not seem to be any way to unfreeze RetroArch other than closing it/swiping it away and restarting it, possibly resulting in data loss.
The issue has existed since at least the 1.19 nightly builds on iOS 18; I never got around to fully testing/bisecting.
This used to work in iOS 17 and I don't think there was a change to RetroArch in this area since https://github.com/libretro/RetroArch/pull/15319 went in. As in, I think iOS 18 broke this, not RetroArch. Also, I can't reproduce this in iOS 18.4 (there is a noticeable pause when the alarm first happens but it quickly recovers).
This issue still occurs on the latest nightly build (5e5f047e) on iOS 18.5, with the default retroarch.cfg. The freezing only happens if a core is running; not even the overlay will work then.
Hm, I still can't reproduce it with 18.5.
@warmenhoven Okay, I managed to get RetroArch to crash (and immediately restart) after a freeze by going to another app then back to RetroArch, then waiting a minute.
Here's the log, I hope it helps. It's from a new installation of the App Store stable version, the only non-default settings are to enable debug logging, no overrides. The device is an iPhone 12, if that matters.
Don't use the sdl2 audio driver, use coreaudio.
I tested some more, and yeah, the bug only happens with the sdl2 and openal audio drivers. coreaudio is fine.
That being said, sdl2 is the default audio driver on iOS (because of the mic support?), so maybe this should be changed to coreaudio. This bug will affect anyone that uses their iPhone like a regular phone, there was another report of this on Reddit.
I'll make another issue report that actually identifies the cause of the issue.