• 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: timestamps/ buffering with incoming NTSC audio frames in CoreAudio driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >timestamps/ buffering with incoming NTSC audio frames in CoreAudio driver (From: Tommy Schell <email@hidden>)

  • Prev by Date: Re: any MusicDevice examples?
  • Next by Date: Re: How to use ChannelNames, CategoryNames, NumberNames?
  • Previous by thread: timestamps/ buffering with incoming NTSC audio frames in CoreAudio driver
  • Next by thread: Audio Output Units and Volume
  • Index(es):
    • Date
    • Thread