Re: Canonical format max amp limits?
Re: Canonical format max amp limits?
- Subject: Re: Canonical format max amp limits?
- From: Mark Cookson <email@hidden>
- Date: Wed, 14 Jul 2004 18:35:38 -0500
On Jul 14, 2004, at 5:09 PM, Steve Checkoway wrote:
On Jul 14, 2004, at 11:42 AM, Mark Cookson wrote:
The clip routines in the audio kernel extensions don't use AltiVec.
It's possible, but not encouraged, to use AltiVec in the kernel (just
like it's possible, but not encouraged to use floating point in the
kernel, only more so).
Now I'm a little confused. Is this code handled in kernel space or
user space? "This code" being the AudioConverter code.
All things considered, what is the best way to convert audio samples
from 16 bit integer to 32 bit float? By hand, taking into account all
of the previously mentioned potential pitfalls, or using the
AudioConverter, or perhaps some other method?
The converter routines that run for AudioUnits use AltiVec (I'm almost
certain of that).
The clipping routines that kernel drivers use, like AppleOnboardAudio,
AppleUSBAudio, and AppleFWAudio use to take the floating point samples
from the application and send to the hardware DO NOT use AltiVec,
though they do use highly optimized floating point and integer
routines.
Third party device driver developers probably use the same routines
that AppleOnboardAudio uses (because that's what is also in the sample
code PhantomAudioDriver).
Why would you want to convert from floating point to integer within an
application at super fast speed? Don't you want to keep everything
floating point? If you do need to convert for file storage, who cares
about the float->int conversion? The hard disk is the limiting factor
there. I suppose that you could use AudioUnits and then the hardware
in Hog mode and send it integer values, but usually you do that because
you're generating integer samples to begin with.
The original question had to with amp limits, and that, to me, a driver
writer, says "How loud can the hardware go? What's the floating point
value that corresponds to the maximum hardware value, assuming that the
hardware is integer based?" If that's the question you are asking,
then you are talking about the float->int conversion that happens in
the kernel, in the device driver, that takes a floating point value
from user space and turns it into the integer value that your chosen
D/A converter can handle.
I think somewhere in between the start of the question, and my answer,
the thread morphed into something related to AudioUnits and not analog
hardware.
I was just trying to report that in the kernel, where you probably care
the most about float->int conversion speed, that it's NOT using
AltiVec.
Cheers,
Mark
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.