Update of /cvsroot/pure-data/pd/portaudio/pa_mac_core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12672/pd/portaudio/pa_mac_core
Modified Files: notes.txt pa_mac_core.c Log Message: FFT package selection
Zmoelnig's multi-'$' patch
big-soundfile support
Patch to set open directories (openpanel, savepanel)
patch to allow funny characters in extern names
fixed makefile.in to support intel mac
Index: notes.txt =================================================================== RCS file: /cvsroot/pure-data/pd/portaudio/pa_mac_core/notes.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** notes.txt 6 Sep 2004 20:44:39 -0000 1.3 --- notes.txt 3 Jun 2006 19:13:06 -0000 1.4 *************** *** 1,7 **** ! Notes on Core Audio Implementation of PortAudio
by Phil Burk and Darren Gibbs
! Document last updated March 20, 2002
WHAT WORKS --- 1,22 ---- ! Notes on status of CoreAudio Implementation of PortAudio ! ! Document Last Updated December 9, 2005 ! ! There are currently two implementations of PortAudio for Mac Core Audio. ! ! The original is in pa_mac_core_old.c, and the newer, default implementation ! is in pa_mac_core.c. ! Only pa_mac_core.c is currently developed and supported as it uses apple's ! current core audio technology. To select use the old implementation, replace ! pa_mac_core.c with pa_mac_core_old.c (eg. "cp pa_mac_core_auhal.c ! pa_mac_core.c"), then run configure and make as usual. ! ! ---------------------------------------- ! ! Notes on Original implementation:
by Phil Burk and Darren Gibbs
! Last updated March 20, 2002
WHAT WORKS *************** *** 19,23 **** devices. Note that some CoreAudio devices like the Roland UH30 look like one device but are actually two different CoreAudio devices. The ! BuiltIn audio is typically one CoreAudio device.
Mono doesn't work. --- 34,38 ---- devices. Note that some CoreAudio devices like the Roland UH30 look like one device but are actually two different CoreAudio devices. The ! Built-In audio is typically one CoreAudio device.
Mono doesn't work. *************** *** 33,34 **** --- 48,145 ---- we scan the list and add a PortAudio device for each CoreAudio device that supports input. Then we make a scan for output devices. + + ------------------------------------------- + + Notes on Newer/Default AUHAL implementation: + + by Bjorn Roche + + Last Updated December 9, 2005 + + Principle of Operation: + + This implementation uses AUHAL for audio I/O. To some extent, it also + operates at the "HAL" Layer, though this behavior can be limited by + platform specific flags (see pa_mac_core.h for details). The default + settings should be reasonable: they don't change the SR of the device and + don't cause interruptions if other devices are using the device. + + Major Software Elements Used: Apple's HAL AUs provide output SR + conversion transparently, however, only on output, so this + implementation uses AudioConverters to convert the sample rate on input. + A PortAudio ring buffer is used to buffer input when sample rate + conversion is required or when separate audio units are used for duplex + IO. Finally, a PortAudio buffer processor is used to convert formats and + provide additional buffers if needed. Internally, interleaved floating + point data streams are used exclusively - the audio unit converts from + the audio hardware's native format to interleaved float PCM and + PortAudio's Buffer processor is used for conversion to user formats. + + Simplex Input: Simplex input uses a single callback. If sample rate + conversion is required, a ring buffer and AudioConverter are used as + well. + + Simplex output: Simplex output uses a single callback. No ring buffer or + audio converter is used because AUHAL does its own output SR conversion. + + Duplex, one device (no SR conversion): When one device is used, a single + callback is used. This achieves very low latency. + + Duplex, separate devices or SR conversion: When SR conversion is + required, data must be buffered before it is converted and data is not + always available at the same times on input and output, so SR conversion + requires the same treatment as separate devices. The input callback + reads data and puts it in the ring buffer. The output callback reads the + data off the ring buffer, into an audio converter and finally to the + buffer processor. + + Platform Specific Options: + + By using the flags in pa_mac_core.h, the user may specify several options. + For example, the user can specify the sample-rate conversion quality, and + the extent to which PA will attempt to "play nice" and to what extent it + will interrupt other apps to improve performance. For example, if 44100 Hz + sample rate is requested but the device is set at 48000 Hz, PA can either + change the device for optimal playback ("Pro" mode), which may interrupt + other programs playing back audio, or simple use a sample-rate coversion, + which allows for friendlier sharing of the device ("Play Nice" mode). + + + Known issues: + + - Latency: Latency settings are ignored in most cases. Exceptions are when + doing I/O between different devices and as a hint for selecting a realtively + low or relatively high latency in conjunction with + paHostFramesPerBufferUnspecified. Latency settings are always automatically + bound to "safe" values, however, so setting extreme values here should not be + an issue. + + - Buffer Size: paHostFramesPerBufferUnspecified and specific host buffer sizes + are supported. paHostFramesPerBufferUnspecified works best in "pro" mode, + where the buffer size and sample rate of the audio device is most likely + to match the expected values. + + - Timing info. It reports on stream time, but I'm probably doing something + wrong since patest_sine_time often reports negative latency numbers. + + - xrun detection: The only xrun detection performed is when reading + and writing the ring buffer. There is probably more that can be done. + + - abort/stop issues: stopping a stream is always a complete operation, + but latency should be low enough to make the lack of a separate abort + unnecessary. Apple clarifies its AudioOutputUnitStop() call here: + http://lists.apple.com/archives/coreaudio-api/2005/Dec/msg00055.html + + - blocking interface: Not implemented. + + - multichannel: It has been tested successfully on multichannel hardware + from MOTU: traveler and 896HD. + + - sample rate conversion quality: By default, SR conversion is the maximum + available. This can be tweaked using flags pa_mac_core.h. Note that the AU + render quyality property is used to set the sample rat conversion quality + as "documented" here: + http://lists.apple.com/archives/coreaudio-api/2004/Jan/msg00141.html + + - x86: I haven't tested it on an x86 Mac myself, but users have reported + being able to comiple and run it.
Index: pa_mac_core.c =================================================================== RCS file: /cvsroot/pure-data/pd/portaudio/pa_mac_core/pa_mac_core.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pa_mac_core.c 6 Nov 2005 01:49:43 -0000 1.11 --- pa_mac_core.c 3 Jun 2006 19:13:06 -0000 1.12 *************** *** 1,12 **** /* ! * $Id$ ! * pa_mac_core.c ! * Implementation of PortAudio for Mac OS X CoreAudio ! * ! * PortAudio Portable Real-Time Audio Library ! * Latest Version at: http://www.portaudio.com * ! * Authors: Ross Bencina and Phil Burk ! * Copyright (c) 1999-2000 Ross Bencina and Phil Burk [...2928 lines suppressed...] ! error: ! if( macCoreHostApi ) { ! CleanUp(macCoreHostApi); ! } ! ! return result; } --- 2094,2105 ---- static signed long GetStreamWriteAvailable( PaStream* s ) { ! PaMacCoreStream *stream = (PaMacCoreStream*)s; ! VVDBUG(("GetStreamWriteAvailable()\n"));
! /* suppress unused variable warnings */ ! (void) stream;
! /* IMPLEMENT ME, see portaudio.h for required behavior*/
! return 0; }