Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Device channel output fix #60

Merged
merged 2 commits into from

2 participants

@ndonald2
Collaborator

Fix for issue #52 where audio output on device speaker is broken.

This fix is based on the current implementation where Novocaine requests a buffer fill for only the number of available output channels on the device, but the AU render callback always expects a stereo buffer fill.

@alexbw not sure if this is the best long-term solution but it fixes the issue for now.

@alexbw alexbw merged commit 277539b into master
@ndonald2 ndonald2 deleted the DeviceChannelOutputFix branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 18, 2013
  1. @ndonald2
Commits on Sep 9, 2013
  1. @ndonald2
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 2 deletions.
  1. +15 −2 Novocaine/Novocaine.m
View
17 Novocaine/Novocaine.m
@@ -792,7 +792,14 @@ OSStatus renderCallback (void *inRefCon,
int thisNumChannels = ioData->mBuffers[iBuffer].mNumberChannels;
for (int iChannel = 0; iChannel < thisNumChannels; ++iChannel) {
- vDSP_vsadd(sm.outData+iChannel+iBuffer, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iBuffer].mData, thisNumChannels, inNumberFrames);
+
+ int interleaveOffset = iChannel;
+ if (iBuffer < sm.numOutputChannels){
+ interleaveOffset += iBuffer;
+ }
+
+ vDSP_vsadd(sm.outData+interleaveOffset, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iBuffer].mData, thisNumChannels, inNumberFrames);
+
}
}
}
@@ -806,7 +813,13 @@ OSStatus renderCallback (void *inRefCon,
int thisNumChannels = ioData->mBuffers[iBuffer].mNumberChannels;
for (int iChannel = 0; iChannel < thisNumChannels; ++iChannel) {
- vDSP_vfix16(sm.outData+iChannel, sm.numOutputChannels, (SInt16 *)ioData->mBuffers[iBuffer].mData+iChannel, thisNumChannels, inNumberFrames);
+
+ int interleaveOffset = iChannel;
+ if (iBuffer < sm.numOutputChannels){
+ interleaveOffset += iBuffer;
+ }
+
+ vDSP_vfix16(sm.outData+interleaveOffset, sm.numOutputChannels, (SInt16 *)ioData->mBuffers[iBuffer].mData+iChannel, thisNumChannels, inNumberFrames);
}
}
Something went wrong with that request. Please try again.