I have an iPhone app that is recording audio and then broadcasting it across the network. In response to a "stop" from the far end it queues a notification to stop the recording. Alas when it gets to the AudioQueueStop call the application just hangs (ie Stop never exits). Thanks to the notification all AudioQueue manipulation is happening on the same thread.
Has anyone got any idea whats going on here?
Edit: I have set up a listener in the UI thread that handles the recorder.
Then from my network thread I use a "postNotificationName" beliving that it was post a message to the UI thread and everything would run from that thread. This does not appear to be the case. When I break point the function that is called by the postNotificationName it appears that the call is being made on the networking thread and NOT on the UI Thread.
I assume this is my error. Anyone know how to make it work by notifying the UIThread to handle it?
Edit2: OK I've re-written it to use performSelectorOnMainThread. And it still crashes.
On the plus side I just learnt how to get a lot more info out of XCode so I can see the call stack goes:
semaphore_timedwait_signal_trap
semaphore_timedwait_signal
_pthread_cond_wait
pthread_cond_timedwait_relative_np
CAGuard::WaitFor
ClientAudioQueue::ServicePendingCallbacks
AudioQueueStop
[etc]
Anyone got any ideas why it hangs?