Author Topic: Deadock on iOS when engaging Siri  (Read 495 times)

saga

  • Posts: 2778
Deadock on iOS when engaging Siri
« on: 10 Oct '23 - 10:11 »
We have observed that BASS deadlocks under certain conditions on iOS when engaging Siri. I wasn't able yet to work on a reproducer app, but I would hope that a textual description could already help finding the source of the problem in BASS.

I think the one prerequisite that is required to reproduce the issue is to have a BASS_SYNC_DEV_FAIL callback on the playback device or on a mixer that outputs to this playback device. Then in the callback, we have a call to BASS_StreamFree call to free that mixer. That call then gets stuck in __semwait_signal. If we omit the BASS_StreamFree call and instead directly call BASS_Free, the same problem occurs, the app hangs in __semwait_signal.
After that BASS_Free call, another BASS_Init call follows to hopefully re-initialize a working device, and the device failure callback would also be set up again.

To hopefully reproduce, an app outputting sound via BASS should be backgrounded, then Siri should be asked to play a song. Then return to the app, it should be frozen in the aforementioned function.

If the call to __semwait_signal is not enough of a clue what could be happening there, I can try to come up with a reproducer app, but it might take a few days.

Ian @ un4seen

  • Administrator
  • Posts: 26177
Re: Deadock on iOS when engaging Siri
« Reply #1 on: 10 Oct '23 - 15:17 »
If you can reproduce the problem, it's probably best if I send you a debug BASS version to get more info on what's happening. I will do so.

saga

  • Posts: 2778
Re: Deadock on iOS when engaging Siri
« Reply #2 on: 10 Oct '23 - 16:40 »
Yes, it's easily reproducible, just extracting the code into a stand-alone sample app might take a while.