I've created a simple AUGraph - Remote IO, mixer and one callback (to write the mic input to a file) - however I don't think it's configured the way I think it is. I'm trying to use CAShow() to understand what I've actually created, but I'm struggling to reconcile its output with what I think I've configured and what's actually happening when I run the app.
I believe my AUGraph consists of the following connections (working backwards from speaker to mic):
Here's the output of CAShow() after configuring and initializing the AUGraph:
AudioUnitGraph 0x8EA7000:
Member Nodes:
node 1: 'auou' 'rioc' 'appl', instance 0xa87f530 O I
node 2: 'aumx' 'mcmx' 'appl', instance 0xa880420 O I
Connections:
node 2 bus 0 => node 1 bus 0 [ 1 ch, 44100 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer]
Input Callbacks:
{0x28c0, 0xa87df40} => node 2 bus 0 [1 ch, 44100 Hz]
CurrentState:
mLastUpdateError=0, eventsToProcess=F, isRunning=F
It seems like it should show a connection from the output bus of the Remote IO input element to the callback, yet it doesn't. I know it's working as I can hear audio when starting the AUGraph and my callback is writing the samples to an ExtAudioFile, as designed.
I think I'm misunderstanding something fundamental about either AUGraphs, Callbacks or both.
The connection from the RemoteIO input (e.g. the mic) to your program's input callback is entirely external to the AUGraph, so it doesn't show up in the CAShow()
output. As far as the AUGraph is concerned, the entry point is the mixer's render callback and the exit point is the RemoteIO output. The AUGraph doesn't have any knowledge of how your program is laid out, and what happens before samples are fed to the mixer in its render callback.
In ASCII (assuming you're using a ring buffer):
Outside AUGraph Inside AUGraph
+-------------------------------+-----------------------------------------+
| RemoteIO Input -> Ring Buffer | Ring Buffer -> Mixer -> RemoteIO Output |
+-------------------------------+-----------------------------------------+
"the output bus of the Remote IO input element connected to the callback" - could you explain what you mean? As far as i know this isn't a thing, so that seems to be where your problem lies.
In your mixer input callback you can access samples from the the remoteIO input and feed them to the mixer, but their is no connection, at least as far as the AUGraph is concerned.
If you post some code i'll update the answer.
User contributions licensed under CC BY-SA 3.0