• 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: Audio buffers in user-land audio driver
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Audio buffers in user-land audio driver


  • Subject: Re: Audio buffers in user-land audio driver
  • From: Jeff Moore <email@hidden>
  • Date: Tue, 06 Jan 2009 12:42:36 -0800

That's entirely up to you.

BTW, mixing is one of the main reasons why the HAL supports both virtual format and a physical format for a stream. All the mixing and other signal processing is done in the virtual format (Float32) and then converted to the physical format only when we are ready to transfer the data to the hardware.

The great thing about using Float32's for mixing is that generally the only API you need is the addition operator =)

On Dec 17, 2008, at 2:41 AM, Mike Kluev wrote:

On Fri, 21 Mar 2008 14:07:57 Jeff Moore wrote:
On Mar 21, 2008, at 1:56 PM, Dave Addey wrote:
First up, many thanks to Jeff for the SampleHardwarePlugin example code. Like others on this list recently, I’m looking to create a device driver based on the example code.
It’s making a lot of sense, but in trying to use it I think I’m missing something fairly fundamental about how the audio buffers are stored and passed around.
I’m not too familiar with IOProc operations, and I can’t see how I might access the contents of the output audio buffer in the WriteOutputData stage of the IO cycle defined in CallIOProcs. Is this the correct stage to be doing so, and if so, how would I retrieve the buffer? Apologies if this is a dumb question, but since the sample code obviously doesn’t do anything at this stage, I’m a little stumped.

The SampleHardwarePlugIn code supports multiple IOProcs where each IOProc has it's own set of output buffers. So to access the output buffers after they have been filled by the IOProcs, you need to iterate through the IOProcs in mIOProcList using
HP_IOProcList::GetNumberIOProcs() and HP_IOProcList::GetIOProcByIndex() and retrieve the buffers individually for each IOProc for processing using HP_IOProc::GetAudioBufferList().
That said, you can also achieve this by doing the work in the
SHP_Device::PreProcessOutputData() method. This method is called as soon as the IOProc in question returns, so you'll see the data for each IOProc one at a time as opposed to getting them all at once in the SHP_Device::WriteOututData() method.

What API should I use to mix these multiple buffers into a single stream? Is there sample
code that shows how to do this correctly?



--

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
  • Prev by Date: Re: HAL plugin I/O format
  • Next by Date: Re: MovieAudioExtractionFillBuffer
  • Previous by thread: Re: HAL plugin I/O format
  • Next by thread: Re: OSX 10.5.6 breaks our user-land driver
  • Index(es):
    • Date
    • Thread