Re: timestamps/ buffering with incoming NTSC audio frames in CoreAudio driver
Re: timestamps/ buffering with incoming NTSC audio frames in CoreAudio driver
- Subject: Re: timestamps/ buffering with incoming NTSC audio frames in CoreAudio driver
- From: Jeff Moore <email@hidden>
- Date: Thu, 6 Jan 2005 12:56:06 -0800
IOAudio drivers present their data to the HAL in a ring buffer. As
such, you need to make the buffer big enough to handle the requirements
of your device. The HAL knows where in the ring buffer to read/write
using the time stamp in the status buffer in combination with the
safety offset. This totally decouples the HAL from the vagaries of the
hardware, such as you describe. It's up to your driver to manage the
ring buffer, the time stamps, and the placement of the audio data in
the ring buffer.
Your situation is very much like the situation the USB Audio driver
finds itself in when working with sample rates that aren't an even
multiple of 1 millisecond. It too needs to handle packets of data that
vary in size and marshall the data into the ring buffer. You might want
to grab the sources for the driver from Darwin and take a peak at how
it works.
On Jan 6, 2005, at 8:01 AM, Tommy Schell wrote:
Hi,
What is a good strategy for buffering/ timestamping incoming NTSC
audio in a CoreAudio driver?
A frame of NTSC audio contains between 1600 and 1602 audio samples.
So should I make 1 buffer big enough to hold several NTSC audio
frames, and then take a timestamp when
the buffer loops back to beginning?
Or do the buffers need to be separated out?
And then if I have different size buffers, do I need more than 1 audio
engine to accomodate this?
Also, how does an application or the HAL know whether I have 1600 or
1602 audio samples for it on a
given reqest for input audio?
Or the index of the 1st sample frame for a given request?
Thanks,
Tommy Schell
_______________________________________________
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
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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