I'm trying to use a remote IO connection and route the audio input through the built in filter effect (iOS 5 only) and then back out of the hardware. I can make it route straight from the input to the output but I can't get the filter to work. I'm not sure whether it's the filter Audio Unit or the routing that I've got wrong.

This bit is just my attempt at setting up the filter and changing the routing so that the data is processed by it.

Any help is appreciated.

```
// ******* BEGIN FILTER ********

NSLog(@"Begin filter");

// Creates Audio Component Description - Output Filter    
AudioComponentDescription filterCompDesc;
filterCompDesc .componentType = kAudioUnitType_Effect;
filterCompDesc.componentSubType = kAudioUnitSubType_LowPassFilter;
filterCompDesc.componentManufacturer = kAudioUnitManufacturer_Apple;
filterCompDesc.componentFlags = 1;
filterCompDesc.componentFlagsMask = 1;

// Create Filter Unit
AudioUnit lpFilterUnit;
AudioComponent filterComponent = AudioComponentFindNext(NULL, &filterCompDesc);
setupErr = AudioComponentInstanceNew(filterComponent, &lpFilterUnit);
NSAssert(setupErr == noErr, @"No instance of filter");

AudioUnitElement bus2 = 2;
setupErr = AudioUnitSetProperty(lpFilterUnit, kAudioUnitSubType_LowPassFilter, kAudioUnitScope_Output, bus2, &oneFlag, sizeof(oneFlag));

AudioUnitElement bus3 = 3;
setupErr = AudioUnitSetProperty(lpFilterUnit, kAudioUnitSubType_LowPassFilter, kAudioUnitScope_Input, bus3, &oneFlag, sizeof(oneFlag));

// ******** END FILTER ******** //

AudioUnitConnection hardInToLP;
hardInToLP.sourceAudioUnit    = remoteIOunit;
hardInToLP.sourceOutputNumber = 1;
hardInToLP.destInputNumber    = 3;

setupErr = AudioUnitSetProperty (
                      remoteIOunit,                     // connection destination
                      kAudioUnitProperty_MakeConnection,  // property key
                      kAudioUnitScope_Input,              // destination scope
                      bus3,                // destination element
                      &hardInToLP,                // connection definition
                      sizeof (hardInToLP)
                      );

AudioUnitConnection LPToHardOut;
LPToHardOut.sourceAudioUnit    = lpFilterUnit;
LPToHardOut.sourceOutputNumber = 1;
LPToHardOut.destInputNumber    = 3;

setupErr = AudioUnitSetProperty (
                      remoteIOunit,                     // connection destination
                      kAudioUnitProperty_MakeConnection,  // property key
                      kAudioUnitScope_Input,              // destination scope
                      bus3,                // destination element
                      &hardInToLP,                // connection definition
                      sizeof (hardInToLP)
                      );

/*
// Sets up the Audio Units Connection - new instance called connection
AudioUnitConnection connection;

// Connect Audio Input's out to Audio Out's in
connection.sourceAudioUnit = remoteIOunit;
connection.sourceOutputNumber = bus1;
connection.destInputNumber = bus0;

setupErr = AudioUnitSetProperty(remoteIOunit, kAudioUnitProperty_MakeConnection, kAudioUnitScope_Input, bus0, &connection, sizeof(connection));
*/ 

NSAssert(setupErr == noErr, @"No RIO connection");

```