Build Host and Sofware Versions:
- PortAudio SVN r1891 (as of May 05, 2013)
- Visual Studio 2012 on Windows 7 (x64), Service Pack 2
- Windows SDK for Windows 8 (November 15, 2012)
- Provides the DirectX SDK
- All components downloaded
- Microsoft Windows SDK for Windows 7 and .NET Framework 4, Version 7.1 (May 19, 2010)
- Windows Driver Kit (WDK) 8 (August 15, 2012)
- Required for the WDM/KS driver
- Windows Driver Frameworks Co-Installers (August 17, 2012)
- Appears required for older OSes
- Steinberg's ASIO SDK version 2.2
Modified from the original PortAudio documentation for building on Windows.
- Install Visual Studio 2012 on a 64-bit Windows 7 host.
- Install the Windows 8 Sofware Development Kit.
- Install the Driver development kit. The "WDF Co-Installers" will be installed next.
- Install the Windows Driver Frameworks Co-Installers.
- From the ASIO SDK archive, copy the
ASIOSDK2
folder tosrc\hostapi\asio\
. - Rename the copied
ASIOSDK2
folder toASIOSDK
. - Open
build\msvc\portaudio.sln
and allow the VS Wizard to update it. - Verify that no errors were encountered in the conversion. The warnings appear safe to ignore.
- Edit the
portaudio
projectProperties
.- Select
All Platforms
for the following changes - For the
Release
andReleaseMinDependency
configurations:- Set
C/C++ / Code Generation / Floating Point Model
toFast
- Set
C/C++ / Optimization / Omit Frame Pointers
toYes
- Set
- Select
- Save and close Visual Studio.
You will have a freshly-created portaudio.vcxproj
file. Open it in a text editor. Be careful to not open the old portaudio.vcproj
by mistake. In fact, you should probably delete portaudio.vcproj
specifically to prevent this.
In portaudio.vcxproj
, using a text editor (because it is way easier than trying to do it via Visual Studio), make the following changes:
- Replace all occurences of
PA_USE_ASIO=0
withPA_USE_ASIO=1
- Replace all occurences of
PA_USE_DS=0
withPA_USE_DS=1
- Remove the
PA_WDMKS_NO_KSGUID_LIB
andPAWIN_WDMKS_NO_KSGUID_LIB
definitions.
For all configurations the PA_USE_ASIO
, PA_USE_DS
(DirectSound), PA_USE_WMME
(MME), PA_USE_WASAPI
, and PA_USE_WDMKS
(WDM/KS) should all be defined and set to 1
. The PAWIN_USE_WDMKS_DEVICE_INFO
preprocessor symbol should also be defined.
Next, and again in the portaudio.vcxproj
file, replace all <AdditionalDependencies>
blocks with the following. For x86 targets, use
<AdditionalDependencies>\Program Files\Microsoft SDKs\Windows\v7.1\Lib\ksuser.lib;\Program Files\Microsoft SDKs\Windows\v7.1\Lib\ksguid.lib;%(AdditionalDependencies)</AdditionalDependencies>`
and for x64 targets, use
<AdditionalDependencies>\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64\ksuser.lib;\Program Files\Microsoft SDKs\Windows\v7.1\Lib\x64\ksguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
or whatever paths actually point to the ksguid.lib
and ksuser.lib
import libraries.
Re-open portaudio.sln
and batch-clean then batch-build all configurations.
All six targets should build with no errors, and only harmless warnings.
Note that in the ASIO SDK asiolist.cpp
file, there are two "conversion from 'size_t' to 'DWORD', possible loss of data"
warnings. These are caused by strlen
being used as an argument to CharLowerBuffer
at lines 24 and 31. In practice, the truncation should (ha!) never be an issue since the first comparison is for a CLSID and the second is for a registry key name.