I want to post what I was able to figure out. Maybe it will be helpfull for someone.
To enable the feature which avoid playing on the speaker located right next to the microphone you have to do two things.
Set Audio Unit Subtype to kAudioUnitSubType_VoiceProcessingIO.
Set AVAudioSession mode to AVAudioSessionModeVoiceChat - this is default value when you use VPIO Audio Unit, but when you switch between different Audio Unit subtypes It should be set explicitly.
One disadvantage of using VOIP is that it only supports mono, so if you want to switch to Headphones and have stereo, you must use RemoteIO Audio Unit.
Remember that you should set explicitly AVAudioSession category and mode every time when switching Audio Unit. I've notice some audio problems (low input level, audio on headphones was heard like mono but it was configured as stereo).
BTW: VPIO Audio Unit can also be used on OS X but only for Built-in Speaker and Microphone. Thanks to that you will take advantage from system echo canceler which cut off very nicely voice which comes from the speaker and was capture by the micophone (microphone is located right next to the speaker so it is important for those who don't have their own echo canceler alghorimt implemented).
I am having difficult time with new 2017 iPad Pro. Our customer purchased new 2017 ones and it's causing echo. I carefully looked again to make sure that both kAudioUnitSubType_VoiceProcessingIO and AVAudioSessionModeVoiceChat are being used yet still there is clearly echo produced. I even made very simple test app that has nothing but to record and play back with some delay and it still produces echo. Same code is working fine with iPhone 6S using loudspeaker mode. Not sure what kind of mode Facetime is using to avoid this issue..
We were experiencing the same difficulty (willing to choose Speaker channels on iPadPro) and I saw your post!
I just switched to kAudioUnitSubType_VoiceProcessingIO and AVAudioSessionModeVoiceChat but they do not seem to "turn off" the top or bottom speakers on any configuration at all but just activate the Echo Suppression algorithm.
Did you ever manage to see/hear the speaker routing using this setup?
Thanks in advance for sharing your experience,
do you find it ,if you use the ipad pro which have four speaker,use voiceprosessingIO , the voice will smaller than iphone?and smaller than remoteIO?
but i use mini 5 (vpio) is bigger than this ipad ,when i play sound (vpio)
do yuo have some method?