Re: HALOutputUnit (Pt 2)
Re: HALOutputUnit (Pt 2)
- Subject: Re: HALOutputUnit (Pt 2)
- From: Doug Wyatt <email@hidden>
- Date: Tue, 24 Feb 2004 11:55:12 -0800
On Feb 23, 2004, at 18:33, Bob Stuller wrote:
Doug, Jeff, Greetings!
Hi Bob,
Most of the headsets that we are interested in for speech do 16k so
that's cool. My experimenting since your fix came through shows that
the HAL is doing a good job with passing the format through to the
device... And yet... this leads to another question. Since I've
given the HALAU a channel map specifying a single channel, should I
also be modifying the 'best-match' format to reflect that fact if the
format specifies multiple channels as most do? That would seem to go
along with setting the non-interleaved bit.
You could try asking for a mono format, sure ...
Meanwhile:
At 2:59 PM -0800 2/23/04, Jeff Moore wrote:
To answer Doug's question, setting
kLinearPCMFormatFlagIsNonInterleaved on an ASBD that gets passed to
the HAL is illegal. The HAL doesn't support any formats where
kLinearPCMFormatFlagIsNonInterleaved needs to be set.
... because the HALAU always de-interleaves the channels into separate
buffers??
As Jeff said, the non-interleaved bit is illegal as far as the HAL is
concerned. (I knew it was "don't do this," but wasn't sure whether the
HAL would ignore it or generate errors or what.)
The bit is only used in our other API's, to express the deinterleaved
float32 "canonical" AU format. AUHAL will actually let you use
interleaved formats, so that you don't get unnecessary conversions for
simple cases like feeding it an interleaved 16-bit integer stream
straight from an audio file, but it's the exception -- in general
AUConverter is the only other Apple AU that works with non-canonical
formats.
Now, interestingly, when I look through my usage of
AudioUnitSetProperty, I see that I have been getting away with using
kAudioDevicePropertyBufferFrameSizeRange &
kAudioDevicePropertyBufferFrameSize with the HALAU. These calls have
been working to give me the buffers that I want. Go figure. Are
there AudioUnit analogs for these device constants?
No. You're using AUHAL as a delegate to the HAL, and that's fine. It's
only for the stream format that the semantics are tricky and it's
important to use the AU property -- when you use the HAL property,
you're talking to the HAL about the device's logical format. When you
use the AU property, you're talking about the "flattened" format
(across all of the device's streams).
Doug
--
Doug Wyatt
Core Audio, Apple
_______________________________________________
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.