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 us on the PortAudio mailing list.
8
Building PortAudio with ASIO support
9
------------------------------------
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 src/common/ and platform specific files from src/os/win/ (for Win32)
14
or src/os/mac/ (for Macintosh).
16
If you are compiling with a non-Microsoft compiler on Windows, also
17
compile and link with iasiothiscallresolver.cpp (see below for
20
For some platforms (MingW, possibly Mac), you may simply
23
./configure --with-host_os=mingw --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2]
26
./configure --with-host_os=darwin --with-winapi=asio [--with-asiodir=/usr/local/asiosdk2]
29
and life will be good.
32
Obtaining the ASIO SDK
33
----------------------
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.
40
NOTE: In some cases the ASIO SDK may require patching, see below
43
http://www.steinberg.de/329+M52087573ab0.html
45
If the above link is broken search Google for:
46
"download steinberg ASIO SDK"
50
Building the ASIO SDK on Macintosh
51
----------------------------------
53
To build the ASIO SDK on Macintosh you need to compile and link with the
54
following files from the ASIO SDK:
57
host/mac/asioshlib.cpp
58
host/mac/codefragements.cpp
60
You may also need to adjust your include paths to support inclusion of
61
header files from the above directories.
65
Building the ASIO SDK on Windows
66
--------------------------------
68
To build the ASIO SDK on Windows you need to compile and link with the
69
following files from the ASIO SDK:
71
asio_sdk\common\asio.cpp
72
asio_sdk\host\asiodrivers.cpp
73
asio_sdk\host\pc\asiolist.cpp
75
You may also need to adjust your include paths to support inclusion of
76
header files from the above directories.
78
The ASIO SDK depends on the following COM API functions:
79
CoInitialize, CoUninitialize, CoCreateInstance, CLSIDFromString
80
For compilation with MinGW you will need to link with -lole32, for
81
Borland compilers link with Import32.lib.
85
Non-Microsoft (MSVC) Compilers on Windows including Borland and GCC
86
-------------------------------------------------------------------
88
Steinberg did not specify a calling convention in the IASIO interface
89
definition. This causes the Microsoft compiler to use the proprietary
90
thiscall convention which is not compatible with other compilers, such
91
as compilers from Borland (BCC and C++Builder) and GNU (gcc).
92
Steinberg's ASIO SDK will compile but crash on initialization if
93
compiled with a non-Microsoft compiler on Windows.
95
PortAudio solves this problem using the iasiothiscallresolver library
96
which is included in the distribution. When building ASIO support for
97
non-Microsoft compilers, be sure to compile and link with
98
iasiothiscallresolver.cpp. Note that iasiothiscallresolver includes
99
conditional directives which cause it to have no effect if it is
100
compiled with a Microsoft compiler, or on the Macintosh.
102
If you use configure and make (see above), this should be handled
103
automatically for you.
105
For further information about the IASIO thiscall problem see this page:
106
http://www.audiomulch.com/~rossb/code/calliasio
110
Macintosh ASIO SDK Bug Patch
111
----------------------------
113
There is a bug in the ASIO SDK that causes the Macintosh version to
114
often fail during initialization. Below is a patch that you can apply.
116
In codefragments.cpp replace getFrontProcessDirectory function with
117
the following one (GetFrontProcess replaced by GetCurrentProcess).
120
bool CodeFragments::getFrontProcessDirectory(void *specs)
122
FSSpec *fss = (FSSpec *)specs;
124
ProcessSerialNumber psn;
126
memset(&psn,0,(long)sizeof(ProcessSerialNumber));
127
// if(GetFrontProcess(&psn) == noErr) // wrong !!!
128
if(GetCurrentProcess(&psn) == noErr) // correct !!!
131
pif.processAppSpec = fss;
132
pif.processInfoLength = sizeof(ProcessInfoRec);
133
if(GetProcessInformation(&psn, &pif) == noErr)