Re: Re(2): CoreMIDI (drivers)
Re: Re(2): CoreMIDI (drivers)
- Subject: Re: Re(2): CoreMIDI (drivers)
- From: Jeff Moore <email@hidden>
- Date: Mon, 08 Oct 2001 15:27:02 -0700
on 10/8/01 2:57 PM, Sean Morrell <email@hidden> wrote:
>
The AppleUSBAudio driver does indeed add the allowable formats and sample
>
rates of any given channel. And this works fine if the device supports
>
all the channels run at each channel's highest bit depth and sample rate.
>
With our device however, we can't just add all possible formats and sample
>
rates of each channel. The device will certainly support the highest bit
>
depth and sample rate on any channel, but only one channel. For multiple
>
channels to be used, either the bit depth or sample rate must be lowered,
>
across ALL channels. I don't see the AppleUSBAudio driver coded to handle
>
this situation, where the available format and sample rate for any channel
>
is dependent on the current format and sample rate of other enabled
>
channels.
The HAL and the drivers only deal with formats as a whole unit consisting of
sample rate, number of channels, bit depth, and sample format. When the
format is changed, all of these items are changed as a whole. They cannot be
changed piece meal.
For instance, I have a device here that supports the following configs (note
that this isn't all of them, but they suffice to demonstrate the principal):
2 channels, 16 bit, 44100, lpcm
6 channels, 16 bit, 44100, lpcm
2 channels, 24 bit, 44100, lpcm
When you enumerate the available formats for this device using the HAL, you
will get a list of 3 AudioStreamBasicDescription structs. When you change
the format of the device, you have to pick one of the valid 3 formats.
Anything not explicitly listed, isn't supported.
In my example, 6 channel, 24 bit, 44100, lpcm data is an illegal choice and
would generate an error.
The driver is responsible for generating the list of discrete formats each
of its IOAudioStream objects supports and storing it in the place where the
HAL can find it.
No matter what, the driver has the opportunity to return an error to the HAL
when it detects an attempt to set a format to something it doesn't support
and it can rest assured that the error will be passed on to the client
trying to set the illegal format.
>
Does CoreAudio provide applications the ability to load a custom device
>
configuration dialog implemented by the driver?
The HAL doesn't address any UI elements. If you want to distribute a custom
configuration app for your device, you can do so using a normal application
that talks to your driver either via the HAL or via your own custom user
client for the driver.
--
Jeff Moore
Core Audio
Apple