~ubuntu-branches/ubuntu/gutsy/audacity/gutsy-backports

« back to all changes in this revision

Viewing changes to lib-src/portaudio-v19/src/hostapi/coreaudio/notes.txt

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-18 21:58:19 UTC
  • mfrom: (13.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080218215819-tmbcf1rx238r8gdv
Tags: 1.3.4-1.1ubuntu1~gutsy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
pa_mac_core.c with pa_mac_core_old.c (eg. "cp pa_mac_core_auhal.c
12
12
pa_mac_core.c"), then run configure and make as usual.
13
13
 
14
 
----------------------------------------
15
 
 
16
 
Notes on Original implementation:
17
 
 
18
 
by Phil Burk and Darren Gibbs
19
 
 
20
 
Last updated March 20, 2002
21
 
 
22
 
WHAT WORKS
23
 
 
24
 
Output with very low latency, <10 msec.
25
 
Half duplex input or output.
26
 
Full duplex on the same CoreAudio device.
27
 
The paFLoat32, paInt16, paInt8, paUInt8 sample formats.
28
 
Pa_GetCPULoad()
29
 
Pa_StreamTime()
30
 
 
31
 
KNOWN BUGS OR LIMITATIONS
32
 
 
33
 
We do not yet support simultaneous input and output on different 
34
 
devices. Note that some CoreAudio devices like the Roland UH30 look 
35
 
like one device but are actually two different CoreAudio devices. The 
36
 
Built-In audio is typically one CoreAudio device.
37
 
 
38
 
Mono doesn't work.
39
 
 
40
 
DEVICE MAPPING
41
 
 
42
 
CoreAudio devices can support both input and output. But the sample 
43
 
rates supported may be different. So we have map one or two PortAudio 
44
 
device to each CoreAudio device depending on whether it supports 
45
 
input, output or both.
46
 
 
47
 
When we query devices, we first get a list of CoreAudio devices. Then 
48
 
we scan the list and add a PortAudio device for each CoreAudio device 
49
 
that supports input. Then we make a scan for output devices.
50
 
 
51
14
-------------------------------------------
52
15
 
53
16
Notes on Newer/Default AUHAL implementation:
104
67
other programs playing back audio, or simple use a sample-rate coversion,
105
68
which allows for friendlier sharing of the device ("Play Nice" mode).
106
69
 
 
70
Additionally, the user may define a "channel mapping" by calling
 
71
paSetupMacCoreChannelMap() on their stream info structure before opening
 
72
the stream with it. See below for creating a channel map.
107
73
 
108
74
Known issues:
109
75
 
120
86
to match the expected values.
121
87
 
122
88
- Timing info. It reports on stream time, but I'm probably doing something
123
 
wrong since patest_sine_time often reports negative latency numbers.
 
89
wrong since patest_sine_time often reports negative latency numbers. Also,
 
90
there are currently issues with some devices whehn plugging/unplugging
 
91
devices.
124
92
 
125
93
- xrun detection: The only xrun detection performed is when reading
126
94
and writing the ring buffer. There is probably more that can be done.
130
98
unnecessary. Apple clarifies its AudioOutputUnitStop() call here:
131
99
http://lists.apple.com/archives/coreaudio-api/2005/Dec/msg00055.html
132
100
 
133
 
- blocking interface: Not implemented.
 
101
- blocking interface: should work fine.
134
102
 
135
103
- multichannel: It has been tested successfully on multichannel hardware
136
 
from MOTU: traveler and 896HD.
 
104
from MOTU: traveler and 896HD. Also Presonus firepod and others. It is
 
105
believed to work with all Core Audio devices, including virtual devices
 
106
such as soundflower.
137
107
 
138
108
- sample rate conversion quality: By default, SR conversion is the maximum
139
109
available. This can be tweaked using flags pa_mac_core.h. Note that the AU
140
 
render quyality property is used to set the sample rat conversion quality
 
110
render quyality property is used to set the sample rate conversion quality
141
111
as "documented" here:
142
112
http://lists.apple.com/archives/coreaudio-api/2004/Jan/msg00141.html
143
113
 
144
 
- x86: I haven't tested it on an x86 Mac myself, but users have reported 
145
 
being able to comiple and run it.
 
114
- x86/Universal Binary: to build a universal binary, be sure to use
 
115
the darwin makefile and not the usual configure && make combo.
 
116
 
 
117
 
 
118
 
 
119
Creating a channel map:
 
120
 
 
121
How to create the map array -  Text taken From AUHAL.rtfd :
 
122
[3] Channel Maps
 
123
Clients can tell the AUHAL units which channels of the device they are interested in.  For example, the client may be processing stereo data, but outputting to a six-channel device.  This is done by using the kAudioOutputUnitProperty_ChannelMap property.  To use this property:
 
124
 
 
125
For Output:
 
126
Create an array of SInt32 that is the size of the number of channels of the device (Get the Format of the AUHAL's output Element == 0)
 
127
Initialize each of the array's values to -1 (-1 indicates that that channel is NOT to be presented in the conversion.)
 
128
 
 
129
Next, for each channel of your app's output, set:
 
130
channelMapArray[deviceOutputChannel] = desiredAppOutputChannel.
 
131
 
 
132
For example: we have a 6 channel output device and our application has a stereo source it wants to provide to the device.  Suppose we want that stereo source to go to the 3rd and 4th channels of the device. The channel map would look like this: { -1, -1, 0, 1, -1, -1 }
 
133
 
 
134
Where the formats are:
 
135
Input Element == 0: 2 channels (- client format - settable)
 
136
Output Element == 0: 6 channels (- device format - NOT settable)
 
137
 
 
138
So channel 2 (zero-based) of the device will take the first channel of output and channel 3 will take the second channel of output. (This translates to the 3rd and 4th plugs of the 6 output plugs of the device of course!)
 
139
 
 
140
For Input:
 
141
Create an array of SInt32 that is the size of the number of channels of the format you require for input.  Get (or Set in this case as needed) the AUHAL's output Element == 1.
 
142
 
 
143
Next, for each channel of input you require, set:
 
144
channelMapArray[desiredAppInputChannel] = deviceOutputChannel;
 
145
 
 
146
For example: we have a 6 channel input device from which we wish to receive stereo input from the 3rd and 4th channels. The channel map looks like this: { 2, 3 }
 
147
 
 
148
Where the formats are:
 
149
Input Element == 0: 2 channels (- device format - NOT settable)
 
150
Output Element == 0: 6 channels (- client format - settable)
 
151
 
 
152
 
 
153
 
 
154
----------------------------------------
 
155
 
 
156
Notes on Original implementation:
 
157
 
 
158
by Phil Burk and Darren Gibbs
 
159
 
 
160
Last updated March 20, 2002
 
161
 
 
162
WHAT WORKS
 
163
 
 
164
Output with very low latency, <10 msec.
 
165
Half duplex input or output.
 
166
Full duplex on the same CoreAudio device.
 
167
The paFLoat32, paInt16, paInt8, paUInt8 sample formats.
 
168
Pa_GetCPULoad()
 
169
Pa_StreamTime()
 
170
 
 
171
KNOWN BUGS OR LIMITATIONS
 
172
 
 
173
We do not yet support simultaneous input and output on different 
 
174
devices. Note that some CoreAudio devices like the Roland UH30 look 
 
175
like one device but are actually two different CoreAudio devices. The 
 
176
Built-In audio is typically one CoreAudio device.
 
177
 
 
178
Mono doesn't work.
 
179
 
 
180
DEVICE MAPPING
 
181
 
 
182
CoreAudio devices can support both input and output. But the sample 
 
183
rates supported may be different. So we have map one or two PortAudio 
 
184
device to each CoreAudio device depending on whether it supports 
 
185
input, output or both.
 
186
 
 
187
When we query devices, we first get a list of CoreAudio devices. Then 
 
188
we scan the list and add a PortAudio device for each CoreAudio device 
 
189
that supports input. Then we make a scan for output devices.
 
190