Re: PCI Audio Driver and takeTimeStamp
Re: PCI Audio Driver and takeTimeStamp
- Subject: Re: PCI Audio Driver and takeTimeStamp
- From: Peter Johnson <email@hidden>
- Date: Tue, 9 Dec 2008 01:59:04 -0800 (PST)
Hi David
You have to call takeTimeStamp periodically so that IOAudioFamily knows where the engine currently is in the output buffer and to predict where it will be in the future. Typically takeTimeStamp will be called off of your hardware interrupt, e.g. when your hardware buffer fills or wraps, or off a timer. takeTimeStamp also increments a loop counter, effectively the number of times the buffer has cycled.
What's interesting me is why the AppleReflectorDriver doesn't call takeTimeStamp from within performAudioEngineStart. It seems that the "right thing to do" in performAudioEngineStart is to take an AbsoluteTime and call takeTimeStamp(false, now). I can only guess that this is so that IOAudioFamily can reset the loop count to zero and record the starting time, otherwise I guess the first "real" time stamp would anywhere in the buffer.....
cheers
peter
----- Original Message ----
From: David Tan <email@hidden>
To: Peter Johnson <email@hidden>; email@hidden
Sent: Tuesday, 9 December, 2008 17:47:05
Subject: RE: PCI Audio Driver and takeTimeStamp
Hi Peter,
Actually I'm also working on it now. As I understanding, takeTimeStamp() can
be called anywhere in the driver. And in my audio driver, I even have to
call it periodically based on the data I have processed.
Best Regards,
David Tan,
Software Engineer,
Dextrys Co., Ltd.
-----Original Message-----
From: coreaudio-api-bounces+david.tan=email@hidden
[mailto:coreaudio-api-bounces+david.tan=email@hidden] On
Behalf Of Peter Johnson
Sent: Tuesday, December 09, 2008 2:11 PM
To: email@hidden
Subject: PCI Audio Driver and takeTimeStamp
Hi
I'm writing a PCI audio driver for an audio/video capture card. I'm a little
confused by the usage of takeTimeStamp(). For instance, the documentation
and the SamplePCIAudioDriver example calls takeTimeStamp(false) from within
the audio engine performAudioEngineStart(), however, the
AudioReflectorDriver does not. Is there a reason for this?
This is further confusing me because the IOAudioFamily is reporting "missed
samples" (I built a debug version the kext) when my own driver calls
takeTimeStamp(false) from my performAudioEngineStart().
So, is it necessary to call takeTimeStamp(false) when the engine starts and
therefore reset the loop count and start the engine from the beginning of
the sample buffer, and is the IOAudioFamily spuriously reporting missed
samples because the buffer indices have jumped to the start? (in other
words, should I just ignore those messages).
cheers
peter
_______________________________________________
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
_______________________________________________
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