Re: Major problems with remoteIO callback and crashing Xcode/Iphone
Re: Major problems with remoteIO callback and crashing Xcode/Iphone
- Subject: Re: Major problems with remoteIO callback and crashing Xcode/Iphone
- From: Alexander Bollbach <email@hidden>
- Date: Fri, 26 Feb 2016 06:10:36 +0000
It just occurred to me that the reason for the crashing may be the fact that I'm using the AudioController object as my "inRefCon" for the callback, however, I'm also accessing AudioController from my UI to set its properties. Accessing the object in two places along with the high priority real-time nature is a good candidate for the problem. And based on my most recent tests, it seems like it may be whats responsible. I am shocked by what carnage it was able to reap on my system. I would not expect that a simple audio app could crash the iphone's OS, or whatever made it so restarted my device was the only way to get another successful build onto it.
On Fri, Feb 26, 2016 at 12:38 AM Alexander Bollbach <
email@hidden> wrote:
I have a singleton class that creates and manages a remoteIO. What happens in the class is I set up a remoteIO and ask for render callbacks. I do some manipulating of (float *) buffers, specifically with some loop being/end and LFO concepts using basic mathematical operations on the buffer.
Recently, I've been experiencing VERY problematic behavior where the app freezes up, seemingly continues to run, awkwardly prints out some print() statements in the callback, yet not others, and then my whole system (xcode + iphone) goes to hell. The app is unresponsive, xcode won't build it again (gets "process timed out"), and the iphone itself basically crashes. Then I need to restart Xcode, often restart the Iphone and the whole process sets me back some 5-10 minutes every time.
Currently, I'm still trying to debug but I thought I'd post a description of the problematic behavior as well as a code sample. I've added comments to clarify what is important. One thing to note is that at the begin I access 4 properties as instance variables on my class. Those are changed as the app is running via my UI. At first the loop begin/end points are 0 - 0. Therefore, the callback returns noErr, (at this point everything is fine). As soon as I use the UI to set a valid loop duration say 1 - 100, this whole crashing process commences. Whats weird is the print statement further down the callback continues to print (awkwardly, very slowly and fragmented..) while the print at the front of the callback does not. Also, break points don't get called. However, no OSStatus is returned nor exception is thrown.
Here is a sample (the render callback code). I would really appreciate some help and if more information is needed please let me know.
https://gist.github.com/AlexanderBollbach/1c931df3c4ebf571e473
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden