Re: DefaultOutputDevice timestamps
Re: DefaultOutputDevice timestamps
- Subject: Re: DefaultOutputDevice timestamps
- From: Bill Stewart <email@hidden>
- Date: Tue, 9 Oct 2001 12:01:57 -0700
Have a look at the code in
/Developer/Examples/CoreAudio/Services/DefaultOutput/
There's two pieces of code there - one that uses the
AudioConverter, and what the expects the output unit to do the
conversion for you
If you run the code that uses the AudioConverter directly you
should see that the host time field marches happily along - in this
case it just passes it from the AudioDevice.
Bill
On Monday, October 8, 2001, at 11:02 PM, email@hidden wrote:
Hey,
First, I am using 10.1 (I spent a good three or fours of my
time to get
it, too) so that shouldn't be cause for anything unless it could be
caused by upgrading to 10.1 rather than doing a full wipe and
install. I'm
not used to using flags but I assume that this would be how:
if ((flags & kAudioTimeStampHostTimeValid) ==
kAudioTimeStampHostTimeValid)
{
//do stuff assuming a valid mHostTime
}
Is this correct? If it is, then I'm registering that the
inOutputTime->mHostTime field is supposed to be valid (the mFlags
field is
3 so sampleTime and hostTime are marked valid) and yet it still doesn't
update - or at least not when run for only 10 or 15 seconds. So
again I'm
lost as to what to do to get a valid host time. I'm trying to think of
ways I could mess this up but since I just take the value given to the
callback function (and log and use it) it seems like this should
be idiot
proof. Any ideas on what to do are appreciated as this is pretty
important
to my progress.
Thanks much,
Ben
On Mon, 8 Oct 2001, Doug Wyatt wrote:
I suspect that you're on 10.0.x and that the flags in the timestamp
structure are indicating that the host time is not valid.
This has been changed for 10.1 - you should see that the
valid-hosttime
flag is set and you have valid host times.
See <CoreAudio/HostTime.h> for details about the units, and
routines to
convert to/from nanoseconds.
hth,
Doug
On Sunday, October 7, 2001, at 03:15 , email@hidden wrote:
Hey,
I'm trying to figure out how to write different signals as output
in a
good synchronized manner but I've hit a snag. For the AudioTimeStamp
inputTime and outputTime I receive as parameters to the IOProc I give
the
default output device, the mHostTime field doesn't seem to really
work.
Judging from the NSLogs made while writing to the
defaultoutputdevice,
the
mHostTime rarely ever changes. I just ran it where the initial input
sample time was 563.000000 and the input sample time where the
mHostTime
(for both input and output) changed was 6605737.000000 - that's 2 and
1/2
minutes given 44.1Khz sample rate. The mHostTime went from
1224094414600
to 1228389381896 which begs the question (and I know I should know
this) -
what exactly is the unit the mHostTime measured in and what is its
starting reference point (0) based on? In other words, is it based on
the
unix clock (1971) or is it prone to rollover, etc.?
What is it that I'm doing wrong to get mHostTime
to not update? I use the values the default output device gives me in
the
callback method/IOProc that I give it. Since we're supposed to
use the
inputTime and the outputTimes as the clock references for our
audio I'd
like to figure out how to get it to update properly (and what
units it's
in) as I want to try using it for resynchronizing waveform generators
and
wavetable readers.
Thanks,
Ben
p.s. Sorry for any poor form but it's 3am.
_______________________________________________
coreaudio-api mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden http://www.sonosphere.com
"He was the sort of person who stood on mountaintops during
thunderstorms in
wet copper armour shouting 'All the Gods are bastards.'"
-- Terry Pratchett
_______________________________________________
coreaudio-api mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
_______________________________________________
coreaudio-api mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
Cat: "Leave me alone, I'm trying to nap... Ah, What's that clicking
noise?"
__________________________________________________________________________