efficient device channel enabling - was Re: fIsMixable
efficient device channel enabling - was Re: fIsMixable
- Subject: efficient device channel enabling - was Re: fIsMixable
- From: Brian Willoughby <email@hidden>
- Date: Tue, 17 Jun 2003 22:48:07 -0700
[ I have heard that CoreAudio has not yet implemented some stream
[ properties that would allow a host app to specify in some fashion
[ what channels (or groups of channels) it really needs to use, so
[ that the driver is not forced to transfer data for possibly dozens
[ of channels that are not being used at all by the host app. This
[ I believe corresponds to channel enabling functionality which in
[ ASIO is implemented on a driver-by-driver basis, so that a driver
[ who wants there product to perform efficiently in this regard is
[ able to achieve this.
[
[ My understanding is that similar functionality with CoreAudio is
[ not yet possible, so that manufacturers can in many cases expect
[ worse performance than was possible under ASIO, when host apps
[ are not using all the channels that a device offers (or set of
[ devices from the same manufacturer that are linked together to
[ function as a unit).
[
[ This is not a big deal for a stereo device, but any driver that
[ may support connection of multiple devices often with 20 or so
[ channels per device may have some significant performance issues
[ when certain groups of channels (e.g. eight ADAT channels) remain
[ unused on each device.
I do not believe that this is exactly true. There is at least one CoreAudio
device which supports configuration choices which improve efficiency when all
channels are not needed. With the kAudioStreamPropertyStreamFormatMatch and
kAudioStreamPropertyPhysicalFormatMatch properties, it is fairly easy for an
application to find the most efficient format for the device.
The Emagic EMI 2|6 supports 6 channels of audio output over USB. But that
represents a significant bandwidth usage even for high-speed USB. The Emagic
firmware has a mode which only transfers 2 channels, thus cutting the bandwidth
to a third. All that an application needs to do to take advantage of the
possibilities for more efficient channel allocation is to specify the number of
channels needed and find a matching format. The only thing missing for the
EMI 2|6 is a 4-channel mode which uses two-thirds of the maximum bandwidth.
But, if Emagic were to update their USB firmware, the CoreAudio driver could
easily be modified to list additional 4-channel formats in the palette of
possibilities.
I'm not sure what other audio devices support in their CoreAudio driver, but
even if there are a lot of permutations, it seems that the *FormatMatch
properties would save the application developer from wading through any more
possibilities than are appropriate. Perhaps this is not the most
straightforward way to configure channel usage, but I believe that it is
workable if CoreAudio driver developers support it (providing that the hardware
actually supports this).
In addition, I believe that the output callback prepares the buffers with
silence, so an application merely needs to skip unused channels without
specifically filling them with new data. This does not save the CoreAudio
engine from mixing all channels for all clients, but it represents some amount
of savings.
Since the device can only be in one mode at a time, and the real efficiency
concerns are the final transfer from CoreAudio to the device, I don't believe
that there would be any advantage to allowing individual applications to
provide fewer channels than are currently configured on the device. If this
level of efficiency is needed, I believe that applications can simply ignore
unused channels, except in computing how to skip over them in the data buffers.
There are certainly ways to code this which make N channels as efficient as
possible, whether CoreAudio is asking for N channels in the callback or N+M
channels.
Brian Willoughby
Sound Consulting
_______________________________________________
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.