RE: Recommend way for an Audio Unit to implement a background timer
RE: Recommend way for an Audio Unit to implement a background timer
- Subject: RE: Recommend way for an Audio Unit to implement a background timer
- From: "Muon Software Ltd - Dave" <email@hidden>
- Date: Fri, 20 Feb 2009 09:35:31 -0000
- Thread-topic: Recommend way for an Audio Unit to implement a background timer
> CFRunLoopAddTimer would be the correct API, I'm pretty sure. If it's
> causing crashes, then either you're calling it wrong, or doing
> something during the callback that corrupts the state of the app.
Thanks for your response, I've got a feeling you may be right.
Unfortunately I've not managed to get anything sensible from the
debugger or crash logs, except one thing I've noticed is that there is
always an NSTimer fired in the call stack. I have this feeling that
maybe my timer is attaching itself to the run loop in a way that is
disturbing perhaps other timers installed on the host. I have tried a
build where the callback did nothing at all and commented out various
other bits of code until I got to the point where I concluded that if I
call CFRunLoopAddTimer it *will* crash *somewhere*, whereas if I don't
it will not.
> Many of the CFRunLoop functions are not thread-safe (sort of
> unexpectedly, for an object so closely related to a thread.) If you're
> adding your timer from a random thread (ie. from an AU callback), that
> could be the problem.
I've tried adding it from the AU constructor, and I've tried it from
Initialize().
I guess I might have to try a pthread instead.
Kind regards
Dave
_______________________________________________
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