RetroArch icon indicating copy to clipboard operation
RetroArch copied to clipboard

[iOS] RetroArch and game freeze while incoming a call on iPhone

Open troilus opened this issue 9 months ago • 7 comments

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

  1. Start a game on iPhone
  2. Incoming a call
  3. 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


troilus avatar Mar 18 '25 00:03 troilus

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.

DJtheMan2101 avatar Apr 03 '25 19:04 DJtheMan2101

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).

warmenhoven avatar Apr 04 '25 13:04 warmenhoven

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.

DJtheMan2101 avatar Jul 28 '25 01:07 DJtheMan2101

Hm, I still can't reproduce it with 18.5.

warmenhoven avatar Jul 28 '25 02:07 warmenhoven

@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.

retroarch.log

DJtheMan2101 avatar Jul 29 '25 01:07 DJtheMan2101

Don't use the sdl2 audio driver, use coreaudio.

warmenhoven avatar Jul 29 '25 03:07 warmenhoven

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.

DJtheMan2101 avatar Jul 30 '25 00:07 DJtheMan2101