• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Input callback only getting called every couple of
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Input callback only getting called every couple of


  • Subject: Re: Input callback only getting called every couple of
  • From: "Bill Cunning" <email@hidden>
  • Date: Mon, 11 Dec 2006 10:50:42 -0500
  • Thread-topic: Input callback only getting called every couple of



HI,

And thanks for the response.


>>As far as I can tell, my iSight only supports a sample rate of 48K.
>>So, I'd expect that you'd get a kAudioDeviceUnsupportedFormatError
>>error trying to set the sample rate to 8K. Did you get an error? If
>>not, you should file a bug.

No, I got the error and for now changed the code to just set it to 48k,
Which works with no error.

>>In fact, you might want to do that anyway in the name of being
>>compatible with lots of input devices rather than just assuming the
>>rate you want is supported. Very few devices are going to support a
>>sample rate of 8K these days.

Yup, plan to do it this way, but the isight is actually the first to
not support it that I have run into.

I tried to run ComplexPlayThru (most of my code is derived from this
sample and the defaultoutput sample) and it does not work correctly
either, displaying the same problem.

Basically my initialization and startup code follows what complex
playthrough does

First I do the setupAUHAL which finds and opens the component, calls the
enableIO calls, sets the device as current and does the callback setup
all with no error and then calls audiounitintialize with no error.

I then call setupBuffers which is where I set nominal frame rate etc.
the one difference I have here from ComplexPlaythrough is I set up the
output side of the audio unit to the format the rest of the system
expects like so:

PropertySize = sizeof(Asbd);
Asbd.mSampleRate = (rate of input side) == 48000 (will downsample later)
Asbd.mFormatID = kAudioFormatLinearPCM
Asbd.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger |
kLinearPCMFormatFlagIsnoninterleaved | kLinearPCMFormatFlagIsBigEndian |
kLinearPCMFormatFlagIsPacked

Asbd.mBytesPerPacket = 2;
Asbd.mBytesPerFrame = 2;
Asbd.mBitsPerCahnnel = 16;

The call to
AudiUnitSetProperty(inputUnit,kAudioUnitProperty_StreamFormat,
kAudioUnitScope_Output,1,$Asbd,propertySize) works with no error.

Thinking this was the problem I eliminated this (what I imagine is an )
internal stream conversion but that did not help.

The problem lies with my application not getting fed data fast enough
from the callback I set up in the callback setup.
With the other devices, my input proc gets called every x milliseconds,
as expected, with the isight, it is only getting called every couple of
seconds, and I do not have a clue why. This is the behavior I am
observing in ComplexPlaythrough as well.

Thanks.












 _______________________________________________
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

  • Follow-Ups:
    • Re: Input callback only getting called every couple of
      • From: Jeff Moore <email@hidden>
  • Prev by Date: Re: Issues with Intel Macs and writing MIDI files from MusicSequence
  • Next by Date: AU Parameters not appearing in Logic or Live
  • Previous by thread: Re: Issues with Intel Macs and writing MIDI files from MusicSequence
  • Next by thread: Re: Input callback only getting called every couple of
  • Index(es):
    • Date
    • Thread