Thanks for the extensive follow-up, Bill. I am now able to connect RemoteIO's bus 1 output (ie, captured mic data) to the mixer unit via the AUGraph APIs, and it works great on the device (but not the simulator, see below). This has been very helpful advice, and I've learned a few things along the way that are probably worth sharing on-list.
For anyone who wants to look, my current code is pasted to < http://pastie.org/445149>. It gets RemoteIO device input, connects it through a mixer (an experiment so I can mix in other sources in later apps), and connects that to RemoteIO h/w output, all in an AUGraph.
On Apr 10, 2009, at 6:43 PM, William Stewart wrote: That generally means that you don't have any input.
What you should do is:
Make sure your audio category is play and record make the session active initialise the remote io
Looks like my big mistake was not doing AudioSessionSetActive(true); Well, that and depending too much on the Simulator...
check the sample rates on the device side of the AU (input el 1, output el 0) - this gives you the sample rate of the device. This should be the same sample rate as reported by the audio session, current hardware sample rate
Interesting point there. I check the input ASBD after enabling RemoteIO input (bus 1, input scope): Output is: 2009-04-13 13:37:58.260 AudioInputThrowaway1[698:107] got RIO bus 1 input ASBD. rate: 0.000000, 2 channels, 16 bits per channel
I've checked with the debugger and mSampleRate really is 0. Fortunately, the AudioSession property returns 44100.0, which is what I was already depending on. For the direct connection:
If your client formats on the remote io (output el 1, input el 0) match these sample rates, then we believe (and will try to verify in the next few days) that the connection described above would work
Attending to sample rates is the big thing I'm working through now, which brings us to the Simulator. The first problem I had with the simulator is that it apparently does not work with the FireWire iSight for audio input. Using System Prefs to pick a USB device got me some audio.
Unfortunately, the simulator's audio was pitch-shifted and noisy. The code above showed the problem: the simulator reports an ASBD with 32-bit samples for RemoteIO's bus 1 input. Yet, I'm still setting an ASBD with 16-bit for bus 1's output (which goes into the mixer).
The mixer won't take 32-bit input (OSStatus -10868, format not supported, when setting the mixer's input format), so I tried adding an AUConverter to downsample 32-to-16 on the simulator (presumably a nice future-proof defense for future hardware changes). However, once I added a converter node to the graph, AUGraphOpen started failing with OSStatus -2005 (badComponentType).
Anyways, I've got something that works as advertised on the device, and that's enough to unblock me, though I need to research the converter issue further, because I know I'll want to do LPCM format conversion later.
Thanks again!
--Chris
|