On Apr 10, 2009, at 1:48 PM, Chris Adamson wrote: OK, I've given up on thinking I can just connect the RemoteIOUnit's bus 1 output to an input of my MultiChannelMixer like this:
setupErr = AUGraphConnectNodeInput(auGraph, remoteIONode, 1, mixerNode, 0);
Instead, I've set up an input render callback on the RemoteIOUnit, similar to the CAPlayThrough example and Technical Note TN2091 < http://developer.apple.com/technotes/tn2002/tn2091.html>. Eventually, I'll copy samples received in this callback to a render callback on the mixer's input bus 0.
So, of course, that's proving difficult too. Here's where I set the callback:
FWIW, AudioInputState is a struct that I'm using to hold a pointer to the RemoteIOUnit and the received AudioBufferList*.
Problem now is in the callback method. It's almost identical to TN2091, except that it gets the RemoteIOUnit from my struct: Basically, what the debugger tells me is that every time I get the callback, inNumberFrames is passed in as 0. I assume that's the reason that the call to AudioUnitRender always returns -50, paramErr.
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
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
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
By comparison, CAPlayThrough seems to always get called back with 800 frames to render.
right - that's why I think you might be missing some session set up - you don't have this complexity on the desktop
So, is there anything obviously stupid about how I've set up this callback?
Also, I don't see callbacks at all when running on the Simulator. Can I assume audio input only works on the device?
I think that's more evidence that the category isn't set properly. aurioTouch works in the Sim as well I believe
Bill
|