Created
April 3, 2012 20:21
-
-
Save bartolsthoorn/2295254 to your computer and use it in GitHub Desktop.
new error, see log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2012-04-03 22:18:26.790 MixerHost[74780:10703] The stereo stream format for the "guitar" mixer input bus: | |
2012-04-03 22:18:26.791 MixerHost[74780:10703] Sample Rate: 44100 | |
2012-04-03 22:18:26.792 MixerHost[74780:10703] Format ID: lpcm | |
2012-04-03 22:18:26.793 MixerHost[74780:10703] Format Flags: C2C | |
2012-04-03 22:18:26.793 MixerHost[74780:10703] Bytes per Packet: 4 | |
2012-04-03 22:18:26.795 MixerHost[74780:10703] Frames per Packet: 1 | |
2012-04-03 22:18:26.795 MixerHost[74780:10703] Bytes per Frame: 4 | |
2012-04-03 22:18:26.796 MixerHost[74780:10703] Channels per Frame: 2 | |
2012-04-03 22:18:26.797 MixerHost[74780:10703] Bits per Channel: 32 | |
2012-04-03 22:18:26.799 MixerHost[74780:10703] The mono stream format for the "beats" mixer input bus: | |
2012-04-03 22:18:26.799 MixerHost[74780:10703] Sample Rate: 44100 | |
2012-04-03 22:18:26.801 MixerHost[74780:10703] Format ID: lpcm | |
2012-04-03 22:18:26.801 MixerHost[74780:10703] Format Flags: C2C | |
2012-04-03 22:18:26.802 MixerHost[74780:10703] Bytes per Packet: 4 | |
2012-04-03 22:18:26.802 MixerHost[74780:10703] Frames per Packet: 1 | |
2012-04-03 22:18:26.841 MixerHost[74780:10703] Bytes per Frame: 4 | |
2012-04-03 22:18:26.875 MixerHost[74780:10703] Channels per Frame: 1 | |
2012-04-03 22:18:26.875 MixerHost[74780:10703] Bits per Channel: 32 | |
2012-04-03 22:18:26.876 MixerHost[74780:10703] readAudioFilesIntoMemory - file 0 | |
2012-04-03 22:18:26.942 MixerHost[74780:10703] Finished reading file 0 into memory | |
2012-04-03 22:18:26.943 MixerHost[74780:10703] readAudioFilesIntoMemory - file 1 | |
2012-04-03 22:18:26.972 MixerHost[74780:10703] Finished reading file 1 into memory | |
2012-04-03 22:18:26.973 MixerHost[74780:10703] Configuring and then initializing audio processing graph | |
2012-04-03 22:18:26.974 MixerHost[74780:10703] Adding nodes to audio processing graph | |
2012-04-03 22:18:26.979 MixerHost[74780:10703] Setting mixer unit input bus count to: 2 | |
2012-04-03 22:18:26.980 MixerHost[74780:10703] Setting kAudioUnitProperty_MaximumFramesPerSlice for mixer unit global scope | |
2012-04-03 22:18:26.981 MixerHost[74780:10703] Registering the render callback with mixer unit input bus 0 | |
2012-04-03 22:18:26.982 MixerHost[74780:10703] Registering the render callback with mixer unit input bus 1 | |
2012-04-03 22:18:26.984 MixerHost[74780:10703] Setting stereo stream format for mixer unit "guitar" input bus | |
2012-04-03 22:18:26.984 MixerHost[74780:10703] Setting mono stream format for mixer unit "beats" input bus | |
2012-04-03 22:18:26.985 MixerHost[74780:10703] Setting sample rate for mixer unit output scope | |
2012-04-03 22:18:26.989 MixerHost[74780:10703] Setting sample rate for EQ unit output scope | |
2012-04-03 22:18:27.011 MixerHost[74780:10703] Connecting the mixer output to the input of (before: the I/O unit output element)-, EQ!! | |
2012-04-03 22:18:27.013 MixerHost[74780:10703] Audio processing graph state immediately before initializing it: | |
AudioUnitGraph 0x1241C009: | |
Member Nodes: | |
node 1: 'auou' 'rioc' 'appl', instance 0x738d780 O | |
node 2: 'aufx' 'nbeq' 'appl', instance 0x738e850 O | |
node 3: 'aumx' 'mcmx' 'appl', instance 0x738f950 O | |
Connections: | |
node 3 bus 0 => node 2 bus 0 [ 2 ch, 44100 Hz, 'lpcm' (0x00000029) 32-bit little-endian float, deinterleaved] | |
node 2 bus 0 => node 1 bus 0 [ 2 ch, 0 Hz, 'lpcm' (0x0000000C) 16-bit little-endian signed integer] | |
Input Callbacks: | |
{0x5340, 0x7388874} => node 3 bus 0 [2 ch, 44100 Hz] | |
{0x5340, 0x7388874} => node 3 bus 1 [1 ch, 44100 Hz] | |
CurrentState: | |
mLastUpdateError=0, eventsToProcess=F, isRunning=F | |
2012-04-03 22:18:27.015 MixerHost[74780:10703] Initializing the audio processing graph | |
2012-04-03 22:18:27.016 MixerHost[74780:10703] *** AUGraphInitialize error: ˇˇ’å FFFFD58C | |
2012-04-03 22:18:27.016 MixerHost[74780:10703] Bus 0 now on | |
2012-04-03 22:18:27.017 MixerHost[74780:10703] Bus 1 now on | |
2012-04-03 22:19:24.032 MixerHost[74780:10703] Starting audio processing graph | |
2012-04-03 22:19:24.033 MixerHost[74780:10703] *** AUGraphStart error: ˇˇ’ë FF000000 | |
2012-04-03 22:19:25.248 MixerHost[74780:10703] Starting audio processing graph | |
2012-04-03 22:19:25.248 MixerHost[74780:10703] *** AUGraphStart error: ˇˇ’ë 00000004 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - | |
#pragma mark Audio processing graph setup | |
// This method performs all the work needed to set up the audio processing graph: | |
// 1. Instantiate and open an audio processing graph | |
// 2. Obtain the audio unit nodes for the graph | |
// 3. Configure the Multichannel Mixer unit | |
// * specify the number of input buses | |
// * specify the output sample rate | |
// * specify the maximum frames-per-slice | |
// 4. Initialize the audio processing graph | |
- (void) configureAndInitializeAudioProcessingGraph { | |
NSLog (@"Configuring and then initializing audio processing graph"); | |
OSStatus result = noErr; | |
//............................................................................ | |
// Create a new audio processing graph. | |
result = NewAUGraph (&processingGraph); | |
if (noErr != result) {[self printErrorMessage: @"NewAUGraph" withStatus: result]; return;} | |
//............................................................................ | |
// Specify the audio unit component descriptions for the audio units to be | |
// added to the graph. | |
// I/O unit | |
AudioComponentDescription iOUnitDescription; | |
iOUnitDescription.componentType = kAudioUnitType_Output; | |
iOUnitDescription.componentSubType = kAudioUnitSubType_RemoteIO; | |
iOUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple; | |
iOUnitDescription.componentFlags = 0; | |
iOUnitDescription.componentFlagsMask = 0; | |
// EQ unit | |
AudioComponentDescription EQUnitDescription; | |
EQUnitDescription.componentType = kAudioUnitType_Effect; | |
EQUnitDescription.componentSubType = kAudioUnitSubType_NBandEQ; | |
EQUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple; | |
EQUnitDescription.componentFlags = 0; | |
EQUnitDescription.componentFlagsMask = 0; | |
// Multichannel mixer unit | |
AudioComponentDescription MixerUnitDescription; | |
MixerUnitDescription.componentType = kAudioUnitType_Mixer; | |
MixerUnitDescription.componentSubType = kAudioUnitSubType_MultiChannelMixer; | |
MixerUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple; | |
MixerUnitDescription.componentFlags = 0; | |
MixerUnitDescription.componentFlagsMask = 0; | |
//............................................................................ | |
// Add nodes to the audio processing graph. | |
NSLog (@"Adding nodes to audio processing graph"); | |
AUNode iONode; // node for I/O unit | |
AUNode mixerNode; // node for Multichannel Mixer unit | |
AUNode EQNode; | |
// Add the nodes to the audio processing graph | |
// I/O! | |
result = AUGraphAddNode ( | |
processingGraph, | |
&iOUnitDescription, | |
&iONode); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphNewNode failed for I/O unit" withStatus: result]; return;} | |
// EQ! | |
result = AUGraphAddNode ( | |
processingGraph, | |
&EQUnitDescription, | |
&EQNode | |
); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphNewNode failed for EQ unit" withStatus: result]; return;} | |
// MIXING! | |
result = AUGraphAddNode ( | |
processingGraph, | |
&MixerUnitDescription, | |
&mixerNode | |
); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphNewNode failed for Mixer unit" withStatus: result]; return;} | |
//............................................................................ | |
// Open the audio processing graph | |
// Following this call, the audio units are instantiated but not initialized | |
// (no resource allocation occurs and the audio units are not in a state to | |
// process audio). | |
result = AUGraphOpen (processingGraph); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphOpen" withStatus: result]; return;} | |
result = AUGraphNodeInfo ( | |
processingGraph, | |
mixerNode, | |
NULL, | |
&mixerUnit | |
); | |
//............................................................................ | |
// Obtain the mixer unit instance from its corresponding node. | |
result = AUGraphNodeInfo ( | |
processingGraph, | |
EQNode, | |
NULL, | |
&EQUnit | |
); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphNodeInfo" withStatus: result]; return;} | |
//............................................................................ | |
// Obtain the EQ unit instance from its corresponding node. | |
result = AUGraphNodeInfo ( | |
processingGraph, | |
mixerNode, | |
NULL, | |
&mixerUnit | |
); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphNodeInfo" withStatus: result]; return;} | |
//............................................................................ | |
// Multichannel Mixer unit Setup | |
UInt32 busCount = 2; // bus count for mixer unit input | |
UInt32 guitarBus = 0; // mixer unit bus 0 will be stereo and will take the guitar sound | |
UInt32 beatsBus = 1; // mixer unit bus 1 will be mono and will take the beats sound | |
NSLog (@"Setting mixer unit input bus count to: %lu", busCount); | |
result = AudioUnitSetProperty ( | |
mixerUnit, | |
kAudioUnitProperty_ElementCount, | |
kAudioUnitScope_Input, | |
0, | |
&busCount, | |
sizeof (busCount) | |
); | |
if (noErr != result) {[self printErrorMessage: @"AudioUnitSetProperty (set mixer unit bus count)" withStatus: result]; return;} | |
NSLog (@"Setting kAudioUnitProperty_MaximumFramesPerSlice for mixer unit global scope"); | |
// Increase the maximum frames per slice allows the mixer unit to accommodate the | |
// larger slice size used when the screen is locked. | |
UInt32 maximumFramesPerSlice = 4096; | |
result = AudioUnitSetProperty ( | |
mixerUnit, | |
kAudioUnitProperty_MaximumFramesPerSlice, | |
kAudioUnitScope_Global, | |
0, | |
&maximumFramesPerSlice, | |
sizeof (maximumFramesPerSlice) | |
); | |
if (noErr != result) {[self printErrorMessage: @"AudioUnitSetProperty (set mixer unit input stream format)" withStatus: result]; return;} | |
// Attach the input render callback and context to each input bus | |
for (UInt16 busNumber = 0; busNumber < busCount; ++busNumber) { | |
// Setup the struture that contains the input render callback | |
AURenderCallbackStruct inputCallbackStruct; | |
inputCallbackStruct.inputProc = &inputRenderCallback; | |
inputCallbackStruct.inputProcRefCon = soundStructArray; | |
NSLog (@"Registering the render callback with mixer unit input bus %u", busNumber); | |
// Set a callback for the specified node's specified input | |
result = AUGraphSetNodeInputCallback ( | |
processingGraph, | |
mixerNode, | |
busNumber, | |
&inputCallbackStruct | |
); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphSetNodeInputCallback" withStatus: result]; return;} | |
} | |
NSLog (@"Setting stereo stream format for mixer unit \"guitar\" input bus"); | |
result = AudioUnitSetProperty ( | |
mixerUnit, | |
kAudioUnitProperty_StreamFormat, | |
kAudioUnitScope_Input, | |
guitarBus, | |
&stereoStreamFormat, | |
sizeof (stereoStreamFormat) | |
); | |
if (noErr != result) {[self printErrorMessage: @"AudioUnitSetProperty (set mixer unit guitar input bus stream format)" withStatus: result];return;} | |
NSLog (@"Setting mono stream format for mixer unit \"beats\" input bus"); | |
result = AudioUnitSetProperty ( | |
mixerUnit, | |
kAudioUnitProperty_StreamFormat, | |
kAudioUnitScope_Input, | |
beatsBus, | |
&monoStreamFormat, | |
sizeof (monoStreamFormat) | |
); | |
if (noErr != result) {[self printErrorMessage: @"AudioUnitSetProperty (set mixer unit beats input bus stream format)" withStatus: result];return;} | |
NSLog (@"Setting sample rate for mixer unit output scope"); | |
// Set the mixer unit's output sample rate format. This is the only aspect of the output stream | |
// format that must be explicitly set. | |
result = AudioUnitSetProperty ( | |
mixerUnit, | |
kAudioUnitProperty_SampleRate, | |
kAudioUnitScope_Output, | |
0, | |
&graphSampleRate, | |
sizeof (graphSampleRate) | |
); | |
if (noErr != result) {[self printErrorMessage: @"AudioUnitSetProperty (set mixer unit output stream format)" withStatus: result]; return;} | |
NSLog (@"Setting sample rate for EQ unit output scope"); | |
result = AudioUnitSetProperty ( | |
EQUnit, | |
kAudioUnitProperty_SampleRate, | |
kAudioUnitScope_Output, | |
0, | |
&graphSampleRate, | |
sizeof (graphSampleRate) | |
); | |
if (noErr != result) {[self printErrorMessage: @"AudioUnitSetProperty (set EQ unit output stream format)" withStatus: result]; return;} | |
//............................................................................ | |
// Connect the nodes of the audio processing graph | |
NSLog (@"Connecting the mixer output to the input of (before: the I/O unit output element)-, EQ!!"); | |
result = AUGraphConnectNodeInput ( | |
processingGraph, | |
mixerNode, // source node | |
0, // source node output bus number | |
EQNode, // destination node | |
0 // desintation node input bus number | |
); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphConnectNodeInput" withStatus: result]; return;} | |
result = AUGraphConnectNodeInput ( | |
processingGraph, | |
EQNode, // source node | |
0, // source node output bus number | |
iONode, // destination node | |
0 // desintation node input bus number | |
); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphConnectNodeInput" withStatus: result]; return;} | |
//............................................................................ | |
// Initialize audio processing graph | |
// Diagnostic code | |
// Call CAShow if you want to look at the state of the audio processing | |
// graph. | |
NSLog (@"Audio processing graph state immediately before initializing it:"); | |
CAShow (processingGraph); | |
NSLog (@"Initializing the audio processing graph"); | |
// Initialize the audio processing graph, configure audio data stream formats for | |
// each input and output, and validate the connections between audio units. | |
result = AUGraphInitialize (processingGraph); | |
if (noErr != result) {[self printErrorMessage: @"AUGraphInitialize" withStatus: result]; return;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment