• 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
When should takeTimeStamp() be called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

When should takeTimeStamp() be called?


  • Subject: When should takeTimeStamp() be called?
  • From: Rob Cas <email@hidden>
  • Date: Thu, 15 Aug 2002 22:59:24 +1000 (EST)

Hi,
I have a couple of questions regarding takeTimeStamp() in a
CoreAudio driver.

After the initial takeTimestamp(false) when an engine is started:
- Should takeTimestamp() be called when the stream buffer wraps (rather
than when the hardware buffer wraps)?

When is the best place to call takeTimestamp()?
For playback, currently I copy audio samples from the stream buffer
to the hardware inside clipOutputSamples() after the samples have
been converted.

- Is it safe to call takeTimestamp() from inside
clipOutputSamples() when my copy operation wraps around the stream
buffer? This would seem to give the most accurate time...

- Is there any reason that it's better to do the whole copy operation
and takeTimestamp() outside of clipOutputSamples(), perhaps in an
operation triggered by a timer? ie. Could I be interfering with
the IOAudioFamily's timing mechanisms by doing this?


The context of these questions is a driver that plays back audio
for several minutes before crackles occur, then eventually only silence
is played back - I suspect the erase head is overwriting valid data.
The problem didn't occur under earlier versions of OS X, but I
wonder if now timings have changed slightly and the way I'm taking
timestamps could be made more robust.
(Increasing the offset in setSampleOffset() postpones
the crackles so I don't think this is the problem.
I have yet to experiment with getCurrentSampleFrame(), although it
already currently reports a frame somewhat before the current
hardware position.)

Thanks in advance for any ideas,
Rob.


http://digital.yahoo.com.au - Yahoo! Digital How To
- Get the best out of your PC!
_______________________________________________
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.

  • Prev by Date: MIDI timer resolution
  • Next by Date: inOutputTime accuracy?
  • Previous by thread: Re: MIDI timer resolution
  • Next by thread: inOutputTime accuracy?
  • Index(es):
    • Date
    • Thread