Re: RemoteIO callback buffer length wonky on iphone
Re: RemoteIO callback buffer length wonky on iphone
- Subject: Re: RemoteIO callback buffer length wonky on iphone
- From: Doug McCoy <email@hidden>
- Date: Tue, 27 Apr 2010 09:16:44 -0700
Chris,
My issues were on the device. It turns out that I was
incorrectly using a Float32 value when setting the hardware sample rate.
When I switched to a Float64 value, the behavior was as expected
regarding the callback inNumberFrames.
I do recall having some issues in the simulator with inNumberFrames
at fs=16000. I do not think I ever resolved them, since the device is
really what mattered in my case. At 44k and 22k i never had issues with
inconsistent buffer length. There is an issue explained previously in
this forum in which the simulator will basically ignore the setting and
getting of the hardware buffer duration. In the simulator, you can set
the preferred buffer duration and verify the request by checking the
actual buffer duration, but this value may not correlate to the actual
inNumberFrames of the callback. Again, this is only for the simulator.
On device these values were always respected.
Hope this helps.
Doug
---
Check out my new iPhone app, FlipTalk. Once featured on the iTunes App Store "What's Hot" list!
http://fliptalkapp.com
http://itunes.com/apps/FlipTalk/http://tinyurl.com/FlipTalkYoutube
On Tue, Apr 27, 2010 at 7:51 AM, Chris Adamson
<email@hidden> wrote:
I just started encountering a similar problem to this today. I'm taking some example code that I used for a Core Audio conference presentation. This example applies a simple gain to samples pulled from remote i/o's mic input. Trying it today at home, I found that I'm getting inNumberFrames == 706 on the first callback, and inNumberFrames == 1 (or sometimes 2) on all subsequent callbacks.
This problem only appears in the simulator, not on the device (where I always get inNumberFrames == 1024).
Moreover, I think the problem is only with USB input devices. If I plug my iPhone headphones into my MacBook and use the clicker-mic, it's fine (inNumberFrames == 512). Using a Logitech USB headset shows the problem on MacBook and Mac Pro, and I also have the problem using a MacAlly iMic USB audio adapter on the Mac Pro.
Doug, were you using USB input devices for this?
I've pasted the relevant view controller's code to <
http://pastie.org/937276>. To replicate, your GUI needs a "start" button that calls this VC's handleStartTapped, and a UISlider (range 0.0 to 1.0) whose valueChanged action is connected to handleSlider1ValueChanged.
--Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden