• 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: synchronizing iMic I/O
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: synchronizing iMic I/O


  • Subject: Re: synchronizing iMic I/O
  • From: Jeff Moore <email@hidden>
  • Date: Wed, 16 Jul 2003 11:51:05 -0700

The current time here refers to the time returned by AudioDeviceGetCurrentTime() for the device you want to call AudioDeviceRead() on. The safety offset is provided by kAudioDevicePropertySafetyOffset.

If you are basing your anchor time on the times returned by AudioDeviceGetCurrentTime() for the device you want to call AudioDeviceRead() on (as opposed to any of the time stamps from the IOProc of the output device), following that recipe will work. In fact, that is what the HAL does internally for timing the IO thread.

I can't emphasize enough that the current sample time for one device is _not_ the current sample time for another device, even if they are the same physical device (ie. USB). Each device operates in it's own time space. To move between them you have to use the host times and AudioDeviceTranslateTime() in order to get the proper sample time.

On Wednesday, July 16, 2003, at 11:10 AM, email@hidden wrote:

Is the anchor when initializing so that when you call AudioDeviceRead(), the
inStartTime will be a valid time? (the buffer requested will actually be in
the devices buffers) Isn't there a possiblity the time you requested won't
be there? The description of a valid range for AudioDeviceRead() in
AudioHardware.h does not make sense (to me anyways).

current time - max buf size - safety offset to current time - safety offset

What is "the safety offset to the current time" ?

// The valid range of time that can be read is from the current time
minus
// the maximum buffer size minus the safety offset to the current time
mins
// the safety offset.

thanks
Jeff

In a message dated 07/14/03 10:10:38 PM,
email@hidden writes:


The mechanism I use (suggested by Jeff Moore) is to establish an 'anchor
time' using one of the Device 'GetTime' routines (sorry I don't recall
the full prototype) during initialization.

I then increment that time by 'n' frames (buffer size) in each IOProc
(for the output device) and call AudioDeviceRead() with the updated time.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.



--

Jeff Moore
Core Audio
Apple
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: synchronizing iMic I/O (From: email@hidden)

  • Prev by Date: Re: Mutitimbral - A clarification, sort of
  • Next by Date: Re: AudioStreamBasicDescription inconcistencies
  • Previous by thread: Re: synchronizing iMic I/O
  • Next by thread: Re: synchronizing iMic I/O
  • Index(es):
    • Date
    • Thread