Re: RemoteIO glitches - cured by propListener audio route change?!
Re: RemoteIO glitches - cured by propListener audio route change?!
- Subject: Re: RemoteIO glitches - cured by propListener audio route change?!
- From: jhno <email@hidden>
- Date: Sat, 8 Jan 2011 01:34:47 -0500
Unfortunately, I have no idea what the specific problem was. Sorry! I do not think it was message caching, because the audio would glitch when almost nothing was happening - i.e., it was calling my "synth" modules and returning immediately because there were no notes yet. Very few messages, and always the same ones.
As I wrote in my original inquiry, I discovered the strange behavior that plugging in/out headphones would make the glitches go away - in other words, if the RemoteIO was re-created due to a propListener callback.
What could it be? Perhaps a subtle timing issue based on the initialization sequence? The timing of the render callback compared to the OpenGL redrawing? Who knows. At some point my desire to figure it out yielded to my desire to do other things with my life.
In another project, I had an occasional situation where an app that ordinarily works fine would start glitching for no apparent reason. The audio would be completely unusable, with a distinctive audible signature where the input buffers would be passed to the output buffers and cause a glitchy, pulsing feedback. =) After making unrelated changes to the code and re-building, the problem would go away! Byte alignment? Chance timing of the application initialization process? Who knows.
On the bright side,
1) If it ain't broke, you probably don't need to fix it!
2) In my case at least, porting code from Objective-C to C++ was pretty painless.
jhno
On Jan 7, 2011, at 9:41 PM, Morgan Packard wrote:
> Your post has scared me a bit, since I've been using Objective-C extensively. I've been getting some conflicting bits of advice regarding whether it's appropriate to call objective-c code from the RemoteIO callback. Do you have more specific ideas about what was causing your glitches? Was it the non-cached selector calls described here http://lists.apple.com/archives/cocoa-dev/2006/feb/msg01735.html, or perhaps something else involving locks?
>
> thanks,
>
> -Morgan
>
> On Mon, Jan 3, 2011 at 3:48 AM, jhno <email@hidden> wrote:
> I cured my mysterious audio glitches, by switching the objects used by my RemoteIO perform() callback from Objective C to C++.
>
> I saw a reference to this phenomenon from James McCartney in the archives. Apparently Objective C selectors can invoke housekeeping tasks that can cause unexpected execution time.
>
> In my case, the result was reliable and inexplicable audio glitches.
>
> There was nothing fancy about the Objective C code. So this is something to keep in mind - !
>
> jhno
>
>
> ---
>
> On Dec 15, 2010, at 2:11 PM, jhno wrote:
>
> > Greetings,
> >
> > I have an iPad app with an audio engine based very closely on the AurioTouch code example.
> >
> > When I start the app, the synthesized audio is interrupted by glitches - which seem to be comprised of unprocessed signal vectors that contain the microphone input instead of my synthesized output. In other words there are bursts about every second where the perform() callback is not invoked.
> >
> > The glitches go away completely when I plug headphones into or out of the iPad. My propListener is invoked, it calls SetupRemoteIO, makes a new RemoteIO, and everything is fine - !
> >
> > However, if I manually try to call my propListener by another mechanism (NSTimer, UIButton), the audio still glitches.
> >
> > Does anyone have any idea what could be causing this behavior?
> >
> > I have been looking into this for a long time now and am totally flummoxed.
> >
> > thanks,
> > jhno
> >
> >
>
> _______________________________________________
> 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
>
>
>
> --
> ================================
> Web:
> http://www.morganpackard.com
>
> Mobile Phone:
> (646) 206-8337
>
> Music/Art:
> Album Moment Again Elsewhere available Oct 11.
> iOS app Thicket available on iTunes store.
> ================================
>
_______________________________________________
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