I have a working AUGraph where I need to be able to change the number of mixer buses. The buses are connected to callbacks.
On iOS within Audiosession, I can successfully close the graph and then rebuild a new copy. On Mac, the same code results in Bad_Access errors (com.apple.IOthread.client EX_Bad_Access), I assume because the callbacks seem to still run even after the graph has been stopped.
In a test senario with 3 active buses going into the mixer AU, AUGraphDisconnectNodeInput succeeds the first time it is called, but then fails on the second attempt. No error code is returned.
I have been reading that calls that change the structure of the AUGraph need to be on the main thread, not the core audio thread. So I have been attempting to use:
[self performSelectorOnMainThread:@selector(resetMixerBuses:) withObject:self waitUntilDone:YES];
or
dispatch_sync(dispatch_get_main_queue(), ^{ [self testResetMixerBuses];
Where resetMixerBuses is a method that should disconnect the input bus callbacks, or clear all AUGraph connections….
This has been a frustrating issue for several months now. Any suggestions would be greatly appreciated.
thanks
rob
Robert Carroll RSM Records Toronto
|