I have a VOIP application that uses AudioUnit. On iOS 9, I see an error message that says the following. I do not see this in iOS 8:
mediaserverd[43] : 13:16:38.880 ERROR: [0x1f72d000] >va> 500: Error 'what' getting client format for physical format [ 16/44100/2; flags: 0xc; bytes/packet: 4; frames/packet: 1; bytes/frame: 4; ]
Does anyone know what this means? The audio seems to work fine, but I'm still a bit irked by it and would like to address it if I can. My AudioUnit setup code is below. Help appreciated. Thanks.
CheckError(NewAUGraph(&audioState.graph), "NewAUGraph failed");
AUNode rioNode;
AudioComponentDescription desc;
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_VoiceProcessingIO;
desc.componentFlags = 0; // Documentation states "Set this value to zero"
desc.componentFlagsMask = 0; // Documentation states "Set this value to zero"
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
CheckError(AUGraphAddNode(audioState.graph, &desc, &rioNode), "AUGraphAddNode failed for RIO");
CheckError(AUGraphOpen(audioState.graph),"Failed to open graph");
CheckError(AUGraphNodeInfo(audioState.graph, rioNode, NULL, &audioState.rio),"Failed to get rio node info");
UInt32 flag = 1;
CheckError(AudioUnitSetProperty(audioState.rio,
kAudioOutputUnitProperty_EnableIO,
kAudioUnitScope_Input,
1,
&flag,
sizeof(flag)), "Enable IO Failed");
AudioStreamBasicDescription audioFormat;
size_t bytesPerSample = sizeof(SInt16);
audioFormat.mSampleRate = 8000;
audioFormat.mFormatID = kAudioFormatLinearPCM;
audioFormat.mFormatFlags = kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked;
audioFormat.mFramesPerPacket = 1;
audioFormat.mChannelsPerFrame = 1;
audioFormat.mBitsPerChannel = 8 * (UInt32)bytesPerSample;
audioFormat.mBytesPerPacket = (UInt32)bytesPerSample;
audioFormat.mBytesPerFrame = (UInt32)bytesPerSample;
CheckError(AudioUnitSetProperty(audioState.rio,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,
INPUT_BUS,
&audioFormat,
sizeof(audioFormat)), "Could not set RIO input stream format");
CheckError(AudioUnitSetProperty(audioState.rio,
kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Input,
OUTPUT_BUS,
&audioFormat,
sizeof(audioFormat)), "Could not set RIO output stream format");
AURenderCallbackStruct callbackStruct;
// Set input callback
callbackStruct.inputProc = &recordingCallback;
callbackStruct.inputProcRefCon = &audioState;
CheckError(AudioUnitSetProperty(audioState.rio,
kAudioOutputUnitProperty_SetInputCallback,
kAudioUnitScope_Global,
INPUT_BUS,
&callbackStruct,
sizeof(callbackStruct)), "Could not set callback for recording");
// Set output callback
callbackStruct.inputProc = &playbackCallback;
callbackStruct.inputProcRefCon = &audioState;
CheckError(AudioUnitSetProperty(audioState.rio,
kAudioUnitProperty_SetRenderCallback,
kAudioUnitScope_Global,
OUTPUT_BUS,
&callbackStruct,
sizeof(callbackStruct)), "Could not set callback for playback");