I am using RemoteIO in my voice chat application. To enable echo canceling, I changed "kAudioUnitSubType_RemoteIO" to "kAudioUnitSubType_VoiceProcessingIO" after setting "kAudioSessionCategory_PlayAndRecord" as the session type. Now echo canceling works but the output volume level has dropped significantly versus the previous RemoteIO output level. Does anyone know how to get the same output volume level when using VoiceProcessingIO as when using RemoteIO?
Using VoiceProcessingIO audio unit subtype instead of RemoteIO causes unwanted drop in output volume
-
I would also be interested in knowing the underlying cause of this and any possible workarounds, since I've had this reported as an issue in my own projects. It doesn't seem like there is an intrinsic reason for VPIO to be quieter when just dropped into an otherwise-working RemoteIO unit with the same audio session settings, but that does seem to be the behavior. – Halle Sep 22 '13 at 18:41
-
I've had this problem as well. I've noticed that it was significantly more of a volume drop for iOS 6 and on as opposed to iOS 5. What iOS are you testing on? – nvrtd frst Sep 22 '13 at 18:44
-
I've also found that VPIO completely breaks on iOS 7 on iPhone models 5, 5s and I'm assuming 5c. – nvrtd frst Oct 01 '13 at 05:35
2 Answers
I realize that this hasn't been answered in a long time, but I found that if you do the following between changing audio units:
AudioComponentInstanceDispose(_ioUnit);
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:&nsError];
[[AVAudioSession sharedInstance] setActive:NO error:&nsError];
Then it seems to not create such a huge loudness problem between each unit. At this point, just reinitialize your audio unit and set the session type to what you need.

- 313
- 2
- 13
-
Chuck, if you can make this app https://github.com/winstondu/Voice-Processing-Demo run echo cancellation with lower output volume from third-party apps (e.g. spotify, I would be very grateful). – Winston Du Sep 19 '20 at 07:27
I do not think it is possible to account for the loss of output in volume. According to Recording volume drop switching between RemoteIO and VPIO
"There is no API that controls this gain (or in your case drop) level, everything is internally setup by the OS depending on Audio Session Category (for example VPIO is expected to be used with PlayAndRecord always) and which IO unit has been setup."
It would also help if you said what iOS you were testing on because they have different drops in output volume.