New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output on iOS is mono #28
Comments
That'd be weird. I thought I always let the device decide what to output... On Tue, Aug 14, 2012 at 2:38 PM, Morgan Packard notifications@github.comwrote:
|
Just downloaded Novocaine fresh from github to make sure and am getting only one channel of TLC. |
What in the what On Tue, Aug 14, 2012 at 2:59 PM, Morgan Packard notifications@github.comwrote:
|
I'm not sure I trust the ASBD that the iPhone provides. After this bit:
inputFormat.mNumberChannels is 2. I'd expect it to be 1. |
also after this bit:
inputFormat.mNumberChannels is 2. I tried explicitly setting the ASBD for kAudioUnitScope_Input, bus 0, which seems like it should control the number of channels in the render callback, but it had no effect. I also threw my phone out the window, and that didn't help either. I will toss my computer after it and see if that helps. |
Gosh diggity darn it On Tue, Aug 14, 2012 at 3:13 PM, Morgan Packard notifications@github.comwrote:
|
Mono out of my phone running the demo ios app in the latest from github, stereo from simulator (running an older version of novocaine, but I suspect a newer would also be stereo). My phone is working correctly. I'm getting audio in stereo from other apps. |
Aight. Gotta think about that. On Tue, Aug 14, 2012 at 3:24 PM, Morgan Packard notifications@github.comwrote:
|
I will do the same. |
Closing in on the problem (maybe). Looks like the render callback is expecting non-interleaved data. Does that square with your understanding Alex? I'm going to take a closer look and see if that could explain why the audio is coming through clean, but mono. |
Interesting. The render callback was designed to always ask for interleaved data, and then inside the machinery of Novocaine, everything gets massaged into exactly what the hardware expects, which can be any number of things (interleaved, non-interleaved, mono, stereo, SInt16 or float). On Aug 15, 2012, at 9:29 AM, Morgan Packard wrote:
|
Ok, so my previous comment about knowing things are busted because Next potential problem:
Even if thisNumChannels was 2, the starting point on the destination buffer is ioData->mBuffers[iBuffer].mData on every iteration. Wouldn't successive iterations just overwrite data in the same place here? Based on what I"m seeing here and what I think I understand, I'd expect the audio to be either noise/glitch in the right channel, or maybe pitched 2x too fast, but I'm hearing clean audio, just the same in each channel. EDIT Nevermind. Bear with me while I de-stupid myself. |
Still keep ignoring me please. |
On it On Wed, Aug 15, 2012 at 10:35 AM, Morgan Packard
|
Ok. Found the problem. Give me a cookie.
With interleaved data,
|
thanks morganpackard for saving lots of time 👍 |
Reviving an old thread, but there still seems to be a problem with stereo non-interleaved output on iOS devices, at least with iPhone 4/iOS6. The problem lies here: for (int iBuffer=0; iBuffer < ioData->mNumberBuffers; ++iBuffer) {
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);
}
} For non-interleaved stereo output, there will be 2 mBuffers each with one channel of non-interleaved output. The existing code will loop through both of these, but copies the first (left) channel from the interleaved Fix is something like this: if (sm.isInterleaved){
for (int iBuffer=0; iBuffer < ioData->mNumberBuffers; ++iBuffer) {
int thisNumChannels = ioData->mBuffers[iBuffer].mNumberChannels;
for (int iChannel = 0; iChannel < thisNumChannels; ++iChannel) {
vDSP_vsadd(sm.outData+iChannel, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iBuffer].mData, thisNumChannels, inNumberFrames);
}
}
}
else{
for (int iChannel = 0; iChannel < sm.numOutputChannels; iChannel++){
if (iChannel > ioData->mNumberBuffers) break; // this shouldn't happen
vDSP_vsadd(sm.outData+iChannel, sm.numOutputChannels, &zero, (float *)ioData->mBuffers[iChannel].mData, 1, inNumberFrames);
}
} The I have it working on another project (collab with @morganpackard actually). Happy to submit a pull request if this looks good. |
Or what morgan said 7 months ago also works... |
I would totally love a pull request. Nick and Morgan — you guys are some of On Wed, Mar 20, 2013 at 7:41 PM, Nick D. notifications@github.com wrote:
|
I don't see why not. I'll be gentle, I promise. On Wed, Mar 20, 2013 at 8:52 PM, Alex Wiltschko notifications@github.comwrote:
Morgan Packard |
Ok Morgan and Nick. You're contributors and stewards. Nick, we haven't met (I don't think...) but Morgan says you're a smarty pants and a half, so you're in too. |
Thanks Alex! Sent from my iPhone On Mar 24, 2013, at 6:23 PM, Alex Wiltschko notifications@github.com Ok Morgan and Nick. You're contributors and stewards. Nick, we haven't met — |
I"m experiencing this same problem. |
Morgan, if you find the time, can you pull in your changes that fix this? On Fri, Mar 29, 2013 at 12:17 PM, David Solberg notifications@github.comwrote:
|
Sorry, how can I unsubscribe from this list? On Mar 29, 2013, at 12:18 PM, Alex Wiltschko notifications@github.com wrote:
Hans Tutschku |
FYI, either suggested fix worked for me on an iPad with iOS 6 using a .m4a file. |
Will do. On Fri, Mar 29, 2013 at 12:18 PM, Alex Wiltschko
Morgan Packard |
Is this pulled in yet? |
@morganpackard Is this a dead issue? |
I think so. Sent from my iPhone On Nov 14, 2013, at 11:36 PM, Alex Wiltschko notifications@github.com @morganpackard https://github.com/morganpackard Is this a dead issue? — |
Hi, Am novocain addicted new ios developer. Am using novocain in an ios project. App is recording 2 channel audio. Client records audio with a sensor device. That sensor also can work as receiver. Client's requirement is to send a tone to sensor not speaker while recording from sensor. Please help me how to send tone to sensor. |
Am I crazy? Has this always been the case and nobody noticed until now? Novocaine is outputting audio in mono through headphones.
ioData->mBuffers[0].mNumberChannels
is 1.If I figure out why, I'll make a note, and, with luck and a good attitude, commit some code.
The text was updated successfully, but these errors were encountered: