Re: "Channel" confusion
Re: "Channel" confusion
- Subject: Re: "Channel" confusion
- From: Jeff Moore <email@hidden>
- Date: Thu, 14 Jun 2001 12:18:01 -0700
I think you are a bit confused about the object hierarchy in the HAL. Here's
a high level summary:
The System has Devices.
Devices represent a time line and a thread that wakes up to perform IO
according to that time line.
Devices have Streams.
A Stream represents a unidirectional, n-channel, interleaved stream of data.
You find out about the Streams using
kAudioDevicePropertyStreamConfiguration. The returned AudioBufferList
describes the current stream layout.
Devices have Controls.
Controls are things like volume and mute which are associated with either
the whole device, or a particular channel on one of the Device's Streams.
You address a Control using it's device channel number, or 0 which means the
device's master Control of that type.
on 6/13/01 6:52 PM, Scott Lehman <email@hidden> wrote:
>
So what is a "device channel"?
A device channel is the absolute 1-based channel number on a device as
opposed to a stream channel which is the 1-based channel number within a
single stream.
For instance if you have a device whose stream layout is 4 streams with 2
channels each, the second channel of the third stream would have a device
channel number of 6 but a stream channel number of 2.
So what this means in terms of the HAL API is that you can address things
like volume and mute at the device level using device channel numbers in the
AudioDeviceXXXPropertyXXX routines.
>
Are there Apple guidelines as to how devices and channels are supposed
>
to present the hardware?
The only guideline is to express your hardware as you see fit through the
IOAudio family API.
>
For example, should the driver for a sound card with analog and digital
>
outs present itself as one output device? How many channels?
>
>
And if I have a PCI card with a single TOSLINK output that supports say
>
S/PDIF, AC-3, and ADAT, what would be the "expected" devices and
>
channels present? One output device with a channel for S/PDIF, one for
>
AC-3, and 8 for ADAT?
It all depends on how the hardware works. Some cards let you use the analog
and the digital IO simultaneously and some don't. In the former case, it
would probably be a single device with multiple streams. In the latter case,
it would likely be a single device that could switch between the two sources
of data.
--
Jeff Moore
Core Audio
Apple