Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 5/6: low volume after first usage of CoreAudio

I work on a VoIP app. The AudioSession's mode is set to kAudioSessionMode_VoiceChat.

For a call, I open a CoreAudio AudioUnit with subtype kAudioUnitSubType_VoiceProcessingIO . Everything works fine. After the first call, I close the AudioUnit with AudioUnitUninitialize() and I deactivate the audio session.

Now, however, it seems as if the audio device is not correctly released: the ringer volume is very low, the media player's volume is lower than usual. And for a subsequent call, I cannot activate kAudioUnitSubType_VoiceProcessingIO anymore. It works to create an AudioUnit with kAudioUnitSubType_RemoteIO instead, but also the call's volume is very low (both receiver and speaker).

This first occured on iOS 5. With the iPhone 5 on iOS 6, it is even worse (even lower volume).

Has anyone seen this? Do I need to do more than AudioUnitUninitialize() to release the Voice Processing unit?

like image 783
Florian Avatar asked Oct 02 '12 10:10

Florian


People also ask

Why is my phone volume suddenly low iPhone?

Go to Settings > Sounds (or Settings > Sounds & Haptics), and drag the Ringer and Alerts slider back and forth a few times. If you don't hear any sound, or if your speaker button on the Ringer and Alerts slider is dimmed, your speaker might need service.

How do I increase media volume on iPhone?

When you're on the phone or listening to songs, movies, or other media on iPhone, you can use the buttons on the side of your device to adjust the audio volume. Otherwise, the buttons control the volume for the ringer, alerts, and other sound effects. You can also use Siri to turn the volume up or down.

Why does my phone volume sound low?

Check Volume Settings Go to Settings > Sound & Vibration > Volume. Adjust the individual sliders and make sure none of them are muted.

Why is my volume so low on my iPhone 12?

Apple has determined that a very small percentage of iPhone 12 and iPhone 12 Pro devices may experience sound issues due to a component that might fail on the receiver module. Affected devices were manufactured between October 2020 and April 2021.


2 Answers

I've found the solution: I've incorrectly used AudioUnitUninitialize() to free the audio component retrieved with AudioComponentInstanceNew(). Correct is to use AudioComponentInstanceDispose().

like image 111
Florian Avatar answered Oct 21 '22 06:10

Florian


Yes, you need to dispose the audioUnit when using voiceProcessingIO. For some reason there is no problem when using RemoteIO subtype. So whenever you get OSStatus -66635 (kAudioQueueErr_MultipleVoiceProcessors), check for missing AudioComponentInstanceDispose() calls.

like image 40
MrJ Avatar answered Oct 21 '22 07:10

MrJ