| 1 |
ASIO-README.txt |
| 2 |
|
| 3 |
This document contains information to help you compile PortAudio with |
| 4 |
ASIO support. If you find any omissions or errors in this document |
| 5 |
please notify Ross Bencina <[email protected]>. |
| 6 |
|
| 7 |
|
| 8 |
Building PortAudio with ASIO support |
| 9 |
------------------------------------ |
| 10 |
|
| 11 |
To build PortAudio with ASIO support you need to compile and link with |
| 12 |
pa_asio.c, and files from the ASIO SDK (see below), along with the common |
| 13 |
files from pa_common/ and platform specific files from pa_win/ (for Win32) |
| 14 |
or pa_mac/ (for Macintosh). |
| 15 |
|
| 16 |
If you are compiling with a non-Microsoft compiler on windows, also |
| 17 |
compile and link with iasiothiscallresolver.cpp (see below for |
| 18 |
an explanation). |
| 19 |
|
| 20 |
For some platforms (MingW, possibly Mac), you may simply |
| 21 |
be able to type: |
| 22 |
|
| 23 |
./configure --with-host_os=mingw --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2] |
| 24 |
make |
| 25 |
|
| 26 |
./configure --with-host_os=darwin --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2] |
| 27 |
make |
| 28 |
|
| 29 |
and life will be good. |
| 30 |
|
| 31 |
|
| 32 |
Obtaining the ASIO SDK |
| 33 |
---------------------- |
| 34 |
|
| 35 |
In order to build PortAudio with ASIO support, you need to download |
| 36 |
the ASIO SDK (version 2.0) from Steinberg. Steinberg makes the ASIO |
| 37 |
SDK available to anyone free of charge, however they do not permit its |
| 38 |
source code to be distributed. |
| 39 |
|
| 40 |
NOTE: In some cases the ASIO SDK may require patching, see below |
| 41 |
for further details. |
| 42 |
|
| 43 |
http://www.steinberg.net/en/ps/support/3rdparty/asio_sdk/ |
| 44 |
|
| 45 |
If the above link is broken search Google for: |
| 46 |
"download steinberg ASIO SDK" |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
Building the ASIO SDK on Macintosh |
| 51 |
---------------------------------- |
| 52 |
|
| 53 |
To build the ASIO SDK on Macintosh you need to compile and link with the |
| 54 |
following files from the ASIO SDK: |
| 55 |
|
| 56 |
host/asiodrivers.cpp |
| 57 |
host/mac/asioshlib.cpp |
| 58 |
host/mac/codefragements.cpp |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
Building the ASIO SDK on Windows |
| 63 |
-------------------------------- |
| 64 |
|
| 65 |
To build the ASIO SDK on Windows you need to compile and link with the |
| 66 |
following files from the ASIO SDK: |
| 67 |
|
| 68 |
asio_sdk\common\asio.cpp |
| 69 |
asio_sdk\host\asiodrivers.cpp |
| 70 |
asio_sdk\host\pc\asiolist.cpp |
| 71 |
|
| 72 |
You may also need to adjust your include paths to support inclusion of |
| 73 |
header files from the above directories. |
| 74 |
|
| 75 |
The ASIO SDK depends on the following COM API functions: |
| 76 |
CoInitialize, CoUninitialize, CoCreateInstance, CLSIDFromString |
| 77 |
For compilation with MinGW you will need to link with -lole32, for |
| 78 |
Borland link with Import32.lib. |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
Non-Microsoft (MSVC) Compilers on Windows including Borland and GCC |
| 83 |
------------------------------------------------------------------- |
| 84 |
|
| 85 |
Steinberg did not specify a calling convention in the IASIO interface |
| 86 |
definition. This causes the Microsoft compiler to use the proprietary |
| 87 |
thiscall convention which is not compatible with other compilers, such |
| 88 |
as compilers from Borland (BCC and C++Builder) and GNU (gcc). |
| 89 |
Steinberg's ASIO SDK will compile but crash on initialization if |
| 90 |
compiled with a non-Microsoft compiler on Windows. |
| 91 |
|
| 92 |
PortAudio solves this problem using the iasiothiscallresolver library |
| 93 |
which is included in the distribution. When building ASIO support for |
| 94 |
non-Microsoft compilers, be sure to compile and link with |
| 95 |
iasiothiscallresolver.cpp. Note that iasiothiscallresolver includes |
| 96 |
conditional directives which cause it to have no effect if it is |
| 97 |
compiled with a Microsoft compiler, or on the Macintosh. |
| 98 |
|
| 99 |
If you use configure and make (see above), this should be handled |
| 100 |
automatically for you. |
| 101 |
|
| 102 |
For further information about the IASIO thiscall problem see this page: |
| 103 |
http://www.audiomulch.com/~rossb/code/calliasio |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
Macintosh ASIO SDK Bug Patch |
| 108 |
---------------------------- |
| 109 |
|
| 110 |
There is a bug in the ASIO SDK that causes the Macintosh version to |
| 111 |
often fail during initialization. Below is a patch that you can apply. |
| 112 |
|
| 113 |
In codefragments.cpp replace getFrontProcessDirectory function with |
| 114 |
the following one (GetFrontProcess replaced by GetCurrentProcess). |
| 115 |
|
| 116 |
|
| 117 |
bool CodeFragments::getFrontProcessDirectory(void *specs) |
| 118 |
{ |
| 119 |
FSSpec *fss = (FSSpec *)specs; |
| 120 |
ProcessInfoRec pif; |
| 121 |
ProcessSerialNumber psn; |
| 122 |
|
| 123 |
memset(&psn,0,(long)sizeof(ProcessSerialNumber)); |
| 124 |
// if(GetFrontProcess(&psn) == noErr) // wrong !!! |
| 125 |
if(GetCurrentProcess(&psn) == noErr) // correct !!! |
| 126 |
{ |
| 127 |
pif.processName = 0; |
| 128 |
pif.processAppSpec = fss; |
| 129 |
pif.processInfoLength = sizeof(ProcessInfoRec); |
| 130 |
if(GetProcessInformation(&psn, &pif) == noErr) |
| 131 |
return true; |
| 132 |
} |
| 133 |
return false; |
| 134 |
} |
| 135 |
|
| 136 |
|
| 137 |
--- |