Gearboy
Gearboy copied to clipboard
Freeze after temporary interruptions
Have you guys seen the GearBoy for iOS freezes every time the app is interrupted by an incoming phone call, SMS message or even the alarm? It only returns after killing the app and opening again. No state is saved during this freeze.
iOS version: 13.3 Model name: iPhone 6s The build is based on master, commit 770ab652dd09ae36cca62c558ccfa3420ad239d8
This is reproducible. I'll try to debug this one.
Thanks for reporting, iOS 13 has introduced some new issues. I'll have a look asap.
It is possible that this bug is caused by not handling correctly the audio interruption.
When the mute is on, the app doesn't freeze.
Emulator.mm gave this insight.
if (_audioEnabled && (sampleCount > 0))
{
theSoundQueue->write(theSampleBufffer, sampleCount);
}
I'll try to apply some fixes.
I didn't have success fixing this issue. I can't catch interruptions neither before nor after receiving it.
It seems that the problem is how Sound_Queue manages concurrence with semaphores.
If I comment out
SDL_SemValue and SDL_SemPost( free_sem );
in
void Sound_Queue::fill_buffer( Uint8* out, int count )
it won't freeze the app, but the sound obviously is very buggy.
Thanks for the hint.
I'm about to migrate the app to SwiftUI if I manage to get it working with Metal.
This will address iOS 13 and future releases I hope.
Nice! I worked recently with a migration from OpenGL to Metal. We are using this project to transform OpenGL calls to Metal.
It is called MetalANGLE.
https://github.com/kakashidinho/metalangle
It is updated frequently and the "project owner" helped us a lot.