diff --git a/CMakeLists.txt b/CMakeLists.txt
index 11c0dd07f65d1eb6d1c1b82aed2b1fdc69f5ac52..69800be5242ed5e99265db670692f338e2e2bdb0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,6 +163,7 @@ if(MSVC)
            "${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjmedia/include"
            "${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/speexdsp/include;"
            "${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/webrtc-audio-processing"
+           "${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/portaudio/include"
        )
    endif()
 
@@ -171,18 +172,16 @@ if(MSVC)
    ################################################################################
    if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
        target_compile_definitions(${PROJECT_NAME} PRIVATE
-           "$<$<CONFIG:ReleaseLib_win32>:"
-               "_WIN32_WINNT=0x0A00;"
-               "ASIO_STANDALONE;"
-               "STATIC_GETOPT;"
-               "LIBARCHIVE_STATIC;"
-               "OPENDHT_PROXY_CLIENT;"
-               "OPENDHT_PROXY_SERVER;"
-               "OPENDHT_PUSH_NOTIFICATIONS;"
-               "NATPMP_STATICLIB;"
-               "ENABLE_PLUGIN;"
-               "NDEBUG;"
-           ">"
+           "_WIN32_WINNT=0x0A00;"
+           "ASIO_STANDALONE;"
+           "STATIC_GETOPT;"
+           "LIBARCHIVE_STATIC;"
+           "OPENDHT_PROXY_CLIENT;"
+           "OPENDHT_PROXY_SERVER;"
+           "OPENDHT_PUSH_NOTIFICATIONS;"
+           "NATPMP_STATICLIB;"
+           "ENABLE_PLUGIN;"
+           "NDEBUG;"
            "_USE_MATH_DEFINES;"
            "_SCL_SECURE_NO_WARNINGS;"
            "_CRT_SECURE_NO_WARNINGS;"
@@ -200,18 +199,16 @@ if(MSVC)
    ################################################################################
    if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
        target_compile_options(${PROJECT_NAME} PRIVATE
-           $<$<CONFIG:ReleaseLib_win32>:
-               /O2;
-               /Oi;
-               ${DEFAULT_CXX_RUNTIME_LIBRARY};
-               /Gy;
-               /MP;
-               /Oy-;
-               /sdl-;
-               /W0;
-               /FC;
-               /FS
-           >
+           /O2;
+           /Oi;
+           ${DEFAULT_CXX_RUNTIME_LIBRARY};
+           /Gy;
+           /MP;
+           /Oy-;
+           /sdl-;
+           /W0;
+           /FC;
+           /FS
            /nologo;
            /Zi;
            /wd4996;
@@ -224,11 +221,9 @@ if(MSVC)
    endif()
    if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
        target_link_options(${PROJECT_NAME} PRIVATE
-           $<$<CONFIG:ReleaseLib_win32>:
-               /MACHINE:X86;
-               /OPT:REF;
-               /OPT:ICF
-           >
+           /MACHINE:X64;
+           /OPT:REF;
+           /OPT:ICF
            /VERBOSE:LIB;
            /NODEFAULTLIB:libcmtd;
            /NODEFAULTLIB:libcmt;
@@ -243,42 +238,41 @@ if(MSVC)
    ################################################################################
 
    set(libAdditionalDependencies "${CMAKE_STATIC_LINKER_FLAGS} /LTCG
-   ws2_32.lib 
-   advapi32.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avcodec.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avdevice.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avfilter.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avformat.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avutil.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/swresample.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/swscale.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libgnutls.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/lib_json.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/opendht/build/Release/libopendht.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/argon2/vs2015/Argon2Ref/vs2015/build/Argon2Ref.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/secp256k1.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/yaml-cpp/msvc/Release/libyaml-cppmd.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/portaudio.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libupnp.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/natpmp/msvc/Release/natpmp.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/archive_static.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-core-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-simple-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsua2-lib-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsua-lib-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-ua-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjmedia/lib/pjmedia-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib-util/lib/pjlib-util-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib/lib/pjlib-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjnath/lib/pjnath-x86_64-x64-vc15-Release.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/fmt/msvc/Release/fmt.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/http_parser/x64/Release/http-parser.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/openssl/libcrypto.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/openssl/libssl.lib 
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/speexdsp/lib/libspeexdsp.lib
-   ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/webrtc-audio-processing/build/Release/webrtc-audio-processing.lib
-   /ignore:4006 
-   "
+        ws2_32.lib 
+        advapi32.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avcodec.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avdevice.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avfilter.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avformat.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/avutil.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/swresample.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/ffmpeg/Build/win32/x64/bin/swscale.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libgnutls.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/lib_json.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/opendht/build/Release/libopendht.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/argon2/vs2015/Argon2Ref/vs2015/build/Argon2Ref.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/secp256k1.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/yaml-cpp/msvc/Release/libyaml-cppmd.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/libupnp.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/natpmp/msvc/Release/natpmp.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/msvc/lib/x64/archive_static.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-core-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-simple-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsua2-lib-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsua-lib-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjsip/lib/pjsip-ua-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjmedia/lib/pjmedia-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib-util/lib/pjlib-util-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjlib/lib/pjlib-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/pjproject/pjnath/lib/pjnath-x86_64-x64-vc15-Release.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/fmt/msvc/Release/fmt.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/http_parser/x64/Release/http-parser.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/openssl/libcrypto.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/openssl/libssl.lib 
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/speexdsp/lib/libspeexdsp.lib
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/webrtc-audio-processing/build/Release/webrtc-audio-processing.lib
+        ${CMAKE_CURRENT_SOURCE_DIR}/contrib/build/portaudio/build/Release/portaudio_static_x64.lib
+        /ignore:4006"
    )
 
    set ( CMAKE_STATIC_LINKER_FLAGS ${libAdditionalDependencies} )
diff --git a/compat/msvc/winmake.py b/compat/msvc/winmake.py
index 7647148ad07218d5add97798faa952b5622b1d01..182bbaaf1dc19ee6c6af63e6905a9ab95a435649 100644
--- a/compat/msvc/winmake.py
+++ b/compat/msvc/winmake.py
@@ -283,11 +283,11 @@ def make(pkg_info, force, sdk_version, toolset, isPlugin):
         if use_cmake:
             cmake_defines = ""
             for define in pkg_info.get('defines', []):
-                cmake_defines += " -D" + define + " "
+                cmake_defines += " -D" + define
             if not pkg_up_to_date or current_version is None or force:
                 cmake_conf_script = "cmake -G " + getCMakeGenerator(getLatestVSVersion(
                 )) + cmake_defines + " -S '" + pkg_build_path + "' -B '" + pkg_build_path + "\\build'"
-                log.debug("Configuring with Cmake", cmake_conf_script)
+                log.debug("Configuring with Cmake")
                 result = getSHrunner().exec_batch(cmake_conf_script)
                 if result[0] != 0:
                     log.error("Error configuring with CMake")
diff --git a/contrib/src/portaudio/dsound_utf8.patch b/contrib/src/portaudio/dsound_utf8.patch
deleted file mode 100644
index 5704c027d5cb056c877aa62dd1cc8478137100b5..0000000000000000000000000000000000000000
--- a/contrib/src/portaudio/dsound_utf8.patch
+++ /dev/null
@@ -1,62 +0,0 @@
---- portaudio/src/hostapi/dsound/pa_win_ds.c	2012-11-09 21:55:20.000000000 -0500
-+++ pa_win_ds.c	2016-03-17 16:49:30.106201019 -0400
-@@ -208,9 +208,9 @@
-     PaUtil_SetLastHostErrorInfo( paDirectSound, hr, "DirectSound error" )
- 
- /************************************************* DX Prototypes **********/
--static BOOL CALLBACK CollectGUIDsProcA(LPGUID lpGUID,
--                                     LPCSTR lpszDesc,
--                                     LPCSTR lpszDrvName,
-+static BOOL CALLBACK CollectGUIDsProcW(LPGUID lpGUID,
-+                                     LPCWSTR lpszDesc,
-+                                     LPCWSTR lpszDrvName,
-                                      LPVOID lpContext );
- 
- /************************************************************************************/
-@@ -389,16 +389,18 @@
- ** A NULL string is converted to a zero length string.
- ** If memory cannot be allocated, NULL is returned.
- **/
--static char *DuplicateDeviceNameString( PaUtilAllocationGroup *allocations, const char* src )
-+static char *DuplicateDeviceNameString( PaUtilAllocationGroup *allocations, const wchar_t* src )
- {
-     char *result = 0;
-     
-     if( src != NULL )
-     {
--        size_t len = strlen(src);
-+        size_t len = WideCharToMultiByte(CP_UTF8, 0, src, -1, NULL, 0, NULL, NULL);
-         result = (char*)PaUtil_GroupAllocateMemory( allocations, (long)(len + 1) );
-         if( result )
--            memcpy( (void *) result, src, len+1 );
-+	  if (WideCharToMultiByte(CP_UTF8, 0, src, -1, result, (int)len, NULL, NULL) == 0) {
-+		result = 0;
-+          }
-     }
-     else
-     {
-@@ -513,9 +515,9 @@
- /************************************************************************************
- ** Collect preliminary device information during DirectSound enumeration 
- */
--static BOOL CALLBACK CollectGUIDsProcA(LPGUID lpGUID,
--                                     LPCSTR lpszDesc,
--                                     LPCSTR lpszDrvName,
-+static BOOL CALLBACK CollectGUIDsProcW(LPGUID lpGUID,
-+                                     LPCWSTR lpszDesc,
-+                                     LPCWSTR lpszDrvName,
-                                      LPVOID lpContext )
- {
-     DSDeviceNameAndGUIDVector *namesAndGUIDs = (DSDeviceNameAndGUIDVector*)lpContext;
-@@ -1211,9 +1213,9 @@
-     if( result != paNoError )
-         goto error;
- 
--    paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateA( (LPDSENUMCALLBACKA)CollectGUIDsProcA, (void *)&deviceNamesAndGUIDs.inputNamesAndGUIDs );
-+    paWinDsDSoundEntryPoints.DirectSoundCaptureEnumerateW( (LPDSENUMCALLBACKW)CollectGUIDsProcW, (void *)&deviceNamesAndGUIDs.inputNamesAndGUIDs );
- 
--    paWinDsDSoundEntryPoints.DirectSoundEnumerateA( (LPDSENUMCALLBACKA)CollectGUIDsProcA, (void *)&deviceNamesAndGUIDs.outputNamesAndGUIDs );
-+    paWinDsDSoundEntryPoints.DirectSoundEnumerateW( (LPDSENUMCALLBACKW)CollectGUIDsProcW, (void *)&deviceNamesAndGUIDs.outputNamesAndGUIDs );
- 
-     if( deviceNamesAndGUIDs.inputNamesAndGUIDs.enumerationError != paNoError )
-     {
diff --git a/contrib/src/portaudio/pa-dsound-aecns.patch b/contrib/src/portaudio/pa-dsound-aecns.patch
deleted file mode 100644
index 80d0bcd18d595948512d04c517961abde8472788..0000000000000000000000000000000000000000
--- a/contrib/src/portaudio/pa-dsound-aecns.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- a/src/hostapi/dsound/pa_win_ds.c
-+++ b/src/hostapi/dsound/pa_win_ds.c
-@@ -1520,12 +1520,33 @@ static HRESULT InitFullDuplexInputOutputBuffers( PaWinDsStream *stream,
-                 hostInputSampleFormat, PaWin_SampleFormatToLinearWaveFormatTag( hostInputSampleFormat ),
-                 nFrameRate, inputChannelMask );
- 
-+    // aec and noise suppression
-+    DSCEFFECTDESC dscfx[2];
-+    ZeroMemory(&dscfx[0], sizeof(DSCEFFECTDESC));
-+    dscfx[0].dwSize = sizeof(DSCEFFECTDESC);
-+    dscfx[0].dwFlags = DSCFX_LOCSOFTWARE;
-+    dscfx[0].guidDSCFXClass = GUID_DSCFX_CLASS_AEC;
-+    dscfx[0].guidDSCFXInstance = GUID_DSCFX_MS_AEC;
-+    dscfx[0].dwReserved1 = 0;
-+    dscfx[0].dwReserved2 = 0;
-+
-+    ZeroMemory(&dscfx[1], sizeof(DSCEFFECTDESC));
-+    dscfx[1].dwSize = sizeof(DSCEFFECTDESC);
-+    dscfx[1].dwFlags = DSCFX_LOCSOFTWARE;
-+    dscfx[1].guidDSCFXClass = GUID_DSCFX_CLASS_NS;
-+    dscfx[1].guidDSCFXInstance = GUID_DSCFX_MS_NS;
-+    dscfx[1].dwReserved1 = 0;
-+    dscfx[1].dwReserved2 = 0;
-+
-     ZeroMemory(&captureDesc, sizeof(DSCBUFFERDESC));
-     captureDesc.dwSize = sizeof(DSCBUFFERDESC);
--    captureDesc.dwFlags = 0;
-     captureDesc.dwBufferBytes = bytesPerInputBuffer;
-     captureDesc.lpwfxFormat = (WAVEFORMATEX*)&captureWaveFormat;
- 
-+    captureDesc.dwFlags = DSCBCAPS_CTRLFX;
-+    captureDesc.dwFXCount = 2;
-+    captureDesc.lpDSCFXDesc = dscfx;
-+
-     // render buffer description
- 
-     PaWin_InitializeWaveFormatExtensible( &renderWaveFormat, outputChannelCount, 
-@@ -1551,6 +1572,24 @@ static HRESULT InitFullDuplexInputOutputBuffers( PaWinDsStream *stream,
-             NULL /* pUnkOuter must be NULL */ 
-         );
- 
-+    if (hr != DS_OK) {
-+        PA_DEBUG(("DirectSoundFullDuplexCreate(with AEC/NS) failed. hr=%d\n", hr));
-+        // try removing AEC/NS
-+        captureDesc.dwFlags = 0;
-+        captureDesc.dwFXCount = 0;
-+        captureDesc.lpDSCFXDesc = NULL;
-+        hr = paWinDsDSoundEntryPoints.DirectSoundFullDuplexCreate8(
-+            inputDevice->lpGUID, outputDevice->lpGUID,
-+            &captureDesc, &secondaryRenderDesc,
-+            GetDesktopWindow(), /* see InitOutputBuffer() for a discussion of whether this is a good idea */
-+            DSSCL_EXCLUSIVE,
-+            &stream->pDirectSoundFullDuplex8,
-+            &pCaptureBuffer8,
-+            &pRenderBuffer8,
-+            NULL /* pUnkOuter must be NULL */
-+        );
-+    }
-+
-     if( hr == DS_OK )
-     {
-         PA_DEBUG(("DirectSoundFullDuplexCreate succeeded!\n"));
--- 
-2.19.0.windows.1
-
diff --git a/contrib/src/portaudio/pa-dsound.patch b/contrib/src/portaudio/pa-dsound.patch
deleted file mode 100644
index fdb224e464d3f04145e40678d978b524c734a925..0000000000000000000000000000000000000000
--- a/contrib/src/portaudio/pa-dsound.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/MSVC/portaudio.vcxproj
-+++ b/MSVC/portaudio.vcxproj
-@@ -109,7 +109,7 @@
-       <IntrinsicFunctions>true</IntrinsicFunctions>
-       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-       <AdditionalIncludeDirectories>..\src\common;..\include;.\;..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
--      <PreprocessorDefinitions>PA_WDMKS_NO_KSGUID_LIB;WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <PreprocessorDefinitions>PA_ENABLE_DEBUG_OUTPUT;PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE;PA_WDMKS_NO_KSGUID_LIB;WIN32;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=1;PA_USE_WMME=0;PA_USE_WASAPI=0;PA_USE_WDMKS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-       <StringPooling>true</StringPooling>
-       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-       <FunctionLevelLinking>true</FunctionLevelLinking>
-@@ -161,7 +161,7 @@ xcopy /S /Y $(ProjectDir)..\include\*.h "$(OutDir)"include</Command>
-       <IntrinsicFunctions>true</IntrinsicFunctions>
-       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-       <AdditionalIncludeDirectories>..\src\common;..\include;.\;..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
--      <PreprocessorDefinitions>PA_WDMKS_NO_KSGUID_LIB;_WIN64;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <PreprocessorDefinitions>PA_ENABLE_DEBUG_OUTPUT;PAWIN_USE_DIRECTSOUNDFULLDUPLEXCREATE;PA_WDMKS_NO_KSGUID_LIB;_WIN64;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=1;PA_USE_WMME=0;PA_USE_WASAPI=0;PA_USE_WDMKS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-       <StringPooling>true</StringPooling>
-       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-       <FunctionLevelLinking>true</FunctionLevelLinking>
--- 
-2.19.0.windows.1
-
diff --git a/contrib/src/portaudio/pa-uwp.patch b/contrib/src/portaudio/pa-uwp.patch
deleted file mode 100644
index 1072595d2417cccbf9d1fe95c0426669b7eeaabd..0000000000000000000000000000000000000000
--- a/contrib/src/portaudio/pa-uwp.patch
+++ /dev/null
@@ -1,297 +0,0 @@
---- /dev/null
-+++ b/MSVC/uwp/portaudio.vcxproj
-@@ -0,0 +1,242 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-+  <ItemGroup Label="ProjectConfigurations">
-+    <ProjectConfiguration Include="Debug|Win32">
-+      <Configuration>Debug</Configuration>
-+      <Platform>Win32</Platform>
-+    </ProjectConfiguration>
-+    <ProjectConfiguration Include="Debug|x64">
-+      <Configuration>Debug</Configuration>
-+      <Platform>x64</Platform>
-+    </ProjectConfiguration>
-+    <ProjectConfiguration Include="Release|Win32">
-+      <Configuration>Release</Configuration>
-+      <Platform>Win32</Platform>
-+    </ProjectConfiguration>
-+    <ProjectConfiguration Include="Release|x64">
-+      <Configuration>Release</Configuration>
-+      <Platform>x64</Platform>
-+    </ProjectConfiguration>
-+  </ItemGroup>
-+  <PropertyGroup Label="Globals">
-+    <ProjectGuid>{23913386-5333-4c93-b3f0-0227aff77b49}</ProjectGuid>
-+    <Keyword>StaticLibrary</Keyword>
-+    <RootNamespace>portaudio_UWP</RootNamespace>
-+    <DefaultLanguage>en-US</DefaultLanguage>
-+    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
-+    <AppContainerApplication>true</AppContainerApplication>
-+    <ApplicationType>Windows Store</ApplicationType>
-+    <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
-+    <WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
-+    <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
-+  </PropertyGroup>
-+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <UseDebugLibraries>true</UseDebugLibraries>
-+    <PlatformToolset>v141</PlatformToolset>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <UseDebugLibraries>true</UseDebugLibraries>
-+    <PlatformToolset>v141</PlatformToolset>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <UseDebugLibraries>false</UseDebugLibraries>
-+    <WholeProgramOptimization>true</WholeProgramOptimization>
-+    <PlatformToolset>v141</PlatformToolset>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <UseDebugLibraries>false</UseDebugLibraries>
-+    <WholeProgramOptimization>true</WholeProgramOptimization>
-+    <PlatformToolset>v141</PlatformToolset>
-+  </PropertyGroup>
-+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-+  <ImportGroup Label="ExtensionSettings">
-+  </ImportGroup>
-+  <ImportGroup Label="Shared">
-+  </ImportGroup>
-+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+  </ImportGroup>
-+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+  </ImportGroup>
-+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+  </ImportGroup>
-+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+  </ImportGroup>
-+  <PropertyGroup Label="UserMacros" />
-+  <PropertyGroup />
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-+    <GenerateManifest>false</GenerateManifest>
-+    <OutDir>$(ProjectDir)..\..\..\..\msvc\</OutDir>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-+    <GenerateManifest>false</GenerateManifest>
-+    <OutDir>$(ProjectDir)..\..\..\..\msvc\</OutDir>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-+    <GenerateManifest>false</GenerateManifest>
-+    <OutDir>$(ProjectDir)..\..\..\..\msvc\</OutDir>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-+    <GenerateManifest>false</GenerateManifest>
-+    <OutDir>$(ProjectDir)..\..\..\..\msvc\</OutDir>
-+  </PropertyGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-+    <ClCompile>
-+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-+      <CompileAsWinRT>false</CompileAsWinRT>
-+      <SDLCheck>true</SDLCheck>
-+      <PreprocessorDefinitions>COBJMACROS;CINTERFACE;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <AdditionalIncludeDirectories>$(ProjectDir)..\..\include;$(ProjectDir)..\..\src\common;$(ProjectDir)..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x86\$(ProjectName).pdb</ProgramDataBaseFileName>
-+    </ClCompile>
-+    <Link>
-+      <SubSystem>Console</SubSystem>
-+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
-+    </Link>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
-+    </Lib>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\..\include\*.h "$(OutDir)"include
-+del "$(OutDir)"portaudio_UWP.pri
-+</Command>
-+    </PostBuildEvent>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-+    <ClCompile>
-+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-+      <CompileAsWinRT>false</CompileAsWinRT>
-+      <SDLCheck>true</SDLCheck>
-+      <PreprocessorDefinitions>COBJMACROS;CINTERFACE;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <AdditionalIncludeDirectories>$(ProjectDir)..\..\include;$(ProjectDir)..\..\src\common;$(ProjectDir)..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x86\$(ProjectName).pdb</ProgramDataBaseFileName>
-+    </ClCompile>
-+    <Link>
-+      <SubSystem>Console</SubSystem>
-+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
-+    </Link>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
-+    </Lib>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\..\include\*.h "$(OutDir)"include
-+del "$(OutDir)"portaudio_UWP.pri
-+</Command>
-+    </PostBuildEvent>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm'">
-+    <ClCompile>
-+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-+      <CompileAsWinRT>false</CompileAsWinRT>
-+      <SDLCheck>true</SDLCheck>
-+      <PreprocessorDefinitions>COBJMACROS;CINTERFACE;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+    </ClCompile>
-+    <Link>
-+      <SubSystem>Console</SubSystem>
-+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
-+    </Link>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm'">
-+    <ClCompile>
-+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-+      <CompileAsWinRT>false</CompileAsWinRT>
-+      <SDLCheck>true</SDLCheck>
-+      <PreprocessorDefinitions>COBJMACROS;CINTERFACE;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+    </ClCompile>
-+    <Link>
-+      <SubSystem>Console</SubSystem>
-+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
-+    </Link>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-+    <ClCompile>
-+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-+      <CompileAsWinRT>false</CompileAsWinRT>
-+      <SDLCheck>true</SDLCheck>
-+      <PreprocessorDefinitions>COBJMACROS;CINTERFACE;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <AdditionalIncludeDirectories>$(ProjectDir)..\..\include;$(ProjectDir)..\..\src\common;$(ProjectDir)..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x64\$(ProjectName).pdb</ProgramDataBaseFileName>
-+    </ClCompile>
-+    <Link>
-+      <SubSystem>Console</SubSystem>
-+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
-+    </Link>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
-+      <TargetMachine>MachineX64</TargetMachine>
-+    </Lib>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\..\include\*.h "$(OutDir)"include
-+del "$(OutDir)"portaudio_UWP.pri</Command>
-+    </PostBuildEvent>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-+    <ClCompile>
-+      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-+      <CompileAsWinRT>false</CompileAsWinRT>
-+      <SDLCheck>true</SDLCheck>
-+      <PreprocessorDefinitions>COBJMACROS;CINTERFACE;WIN32;NDEBUG;_CRT_SECURE_NO_DEPRECATE;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=0;PA_USE_WASAPI=1;PA_USE_WDMKS=0;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <AdditionalIncludeDirectories>$(ProjectDir)..\..\include;$(ProjectDir)..\..\src\common;$(ProjectDir)..\..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <DisableSpecificWarnings>4005;</DisableSpecificWarnings>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x64\$(ProjectName).pdb</ProgramDataBaseFileName>
-+    </ClCompile>
-+    <Link>
-+      <SubSystem>Console</SubSystem>
-+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
-+      <GenerateWindowsMetadata>false</GenerateWindowsMetadata>
-+    </Link>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\..\include\*.h "$(OutDir)"include
-+del "$(OutDir)"portaudio_UWP.pri</Command>
-+    </PostBuildEvent>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
-+      <TargetMachine>MachineX64</TargetMachine>
-+    </Lib>
-+  </ItemDefinitionGroup>
-+  <ItemGroup>
-+    <ClCompile Include="..\..\src\common\pa_allocation.c" />
-+    <ClCompile Include="..\..\src\common\pa_converters.c" />
-+    <ClCompile Include="..\..\src\common\pa_cpuload.c" />
-+    <ClCompile Include="..\..\src\common\pa_debugprint.c" />
-+    <ClCompile Include="..\..\src\common\pa_dither.c" />
-+    <ClCompile Include="..\..\src\common\pa_front.c" />
-+    <ClCompile Include="..\..\src\common\pa_process.c" />
-+    <ClCompile Include="..\..\src\common\pa_ringbuffer.c" />
-+    <ClCompile Include="..\..\src\common\pa_stream.c" />
-+    <ClCompile Include="..\..\src\common\pa_trace.c" />
-+    <ClCompile Include="..\..\src\hostapi\skeleton\pa_hostapi_skeleton.c" />
-+    <ClCompile Include="..\..\src\hostapi\wasapi\pa_win_wasapi.c" />
-+    <ClCompile Include="..\..\src\os\win\pa_win_coinitialize.c" />
-+    <ClCompile Include="..\..\src\os\win\pa_win_hostapis.c" />
-+    <ClCompile Include="..\..\src\os\win\pa_win_util.c" />
-+    <ClCompile Include="..\..\src\os\win\pa_win_waveformat.c" />
-+    <ClCompile Include="..\..\src\os\win\pa_win_wdmks_utils.c">
-+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
-+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
-+    </ClCompile>
-+    <ClCompile Include="..\..\src\os\win\pa_x86_plain_converters.c" />
-+  </ItemGroup>
-+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-+  <ImportGroup Label="ExtensionTargets">
-+  </ImportGroup>
-+</Project>
-\ No newline at end of file
---- a/src/hostapi/wasapi/pa_win_wasapi.c
-+++ b/src/hostapi/wasapi/pa_win_wasapi.c
-@@ -252,7 +252,7 @@ typedef struct _pa_AudioClientProperties {
- #endif // __IAudioClient2_INTERFACE_DEFINED__
- 
- /* use CreateThread for CYGWIN/Windows Mobile, _beginthreadex for all others */
--#if !defined(__CYGWIN__) && !defined(_WIN32_WCE)
-+#if !defined(__CYGWIN__) && !defined(_WIN32_WCE) && !defined(PA_WINRT)
- 	#define CREATE_THREAD(PROC) (HANDLE)_beginthreadex( NULL, 0, (PROC), stream, 0, &stream->dwThreadId )
- 	#define PA_THREAD_FUNC static unsigned WINAPI
- 	#define PA_THREAD_ID unsigned
-@@ -1355,14 +1355,18 @@ static HRESULT ActivateAudioInterface_WINRT(const PaWasapiDeviceInfo *deviceInfo
- 	PaActivateAudioInterfaceCompletionHandler *handlerImpl = (PaActivateAudioInterfaceCompletionHandler *)handler;
- 	OLECHAR devicePath[PA_WASAPI_DEVICE_PATH_LEN] = { 0 };
- 
-+    const GUID guid1 = { 0xe6327cad, 0xdcec, 0x4949, 0xae, 0x8a, 0x99, 0x1e, 0x97, 0x6a, 0x79, 0xd2 };
-+    const GUID guid2 = { 0x2eef81be, 0x33fa, 0x4800, 0x96, 0x70, 0x1c, 0xd4, 0x74, 0x97, 0x2c, 0x3f };
- 	// Get device path in form L"{DEVICE_GUID}"
- 	switch (deviceInfo->flow)
- 	{
- 	case eRender:
--		StringFromGUID2(&DEVINTERFACE_AUDIO_RENDER, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
-+		//StringFromGUID2(&DEVINTERFACE_AUDIO_RENDER, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
-+        StringFromGUID2(&guid1, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
- 		break;
- 	case eCapture:
--		StringFromGUID2(&DEVINTERFACE_AUDIO_CAPTURE, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
-+		//StringFromGUID2(&DEVINTERFACE_AUDIO_CAPTURE, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
-+        StringFromGUID2(&guid2, devicePath, PA_WASAPI_DEVICE_PATH_LEN - 1);
- 		break;
- 	default:
- 		return S_FALSE;
-@@ -1404,15 +1408,6 @@ static HRESULT ActivateAudioInterface(const PaWasapiDeviceInfo *deviceInfo, IAud
- }
- 
- // ------------------------------------------------------------------------------------------
--#ifdef PA_WINRT
--static DWORD SignalObjectAndWait(HANDLE hObjectToSignal, HANDLE hObjectToWaitOn, DWORD dwMilliseconds, BOOL bAlertable)
--{
--	SetEvent(hObjectToSignal);
--	return WaitForSingleObjectEx(hObjectToWaitOn, dwMilliseconds, bAlertable);
--}
--#endif
--
--// ------------------------------------------------------------------------------------------
- PaError PaWasapi_Initialize( PaUtilHostApiRepresentation **hostApi, PaHostApiIndex hostApiIndex )
- {
-     PaError result = paNoError;
--- 
-2.10.2.windows.1
-
diff --git a/contrib/src/portaudio/pa-vs2017.patch b/contrib/src/portaudio/pa-vs2017.patch
deleted file mode 100644
index f03c27b66f55c0a4f4c6efd3f3d624dbe8715ac4..0000000000000000000000000000000000000000
--- a/contrib/src/portaudio/pa-vs2017.patch
+++ /dev/null
@@ -1,349 +0,0 @@
---- /dev/null
-+++ b/MSVC/portaudio.vcxproj
-@@ -0,0 +1,342 @@
-+<?xml version="1.0" encoding="utf-8"?>
-+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-+  <ItemGroup Label="ProjectConfigurations">
-+    <ProjectConfiguration Include="Debug|Win32">
-+      <Configuration>Debug</Configuration>
-+      <Platform>Win32</Platform>
-+    </ProjectConfiguration>
-+    <ProjectConfiguration Include="Debug|x64">
-+      <Configuration>Debug</Configuration>
-+      <Platform>x64</Platform>
-+    </ProjectConfiguration>
-+    <ProjectConfiguration Include="Release|Win32">
-+      <Configuration>Release</Configuration>
-+      <Platform>Win32</Platform>
-+    </ProjectConfiguration>
-+    <ProjectConfiguration Include="Release|x64">
-+      <Configuration>Release</Configuration>
-+      <Platform>x64</Platform>
-+    </ProjectConfiguration>
-+  </ItemGroup>
-+  <PropertyGroup Label="Globals">
-+    <ProjectGuid>{0A18A071-125E-442F-AFF7-A3F68ABECF99}</ProjectGuid>
-+    <RootNamespace>portaudio</RootNamespace>
-+    <WindowsTargetPlatformVersion>$(LatestTargetPlatformVersion)</WindowsTargetPlatformVersion>
-+  </PropertyGroup>
-+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
-+    <UseOfMfc>false</UseOfMfc><CharacterSet>Unicode</CharacterSet>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
-+    <UseOfMfc>false</UseOfMfc><CharacterSet>Unicode</CharacterSet>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
-+    <UseOfMfc>false</UseOfMfc><CharacterSet>Unicode</CharacterSet>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-+    <ConfigurationType>StaticLibrary</ConfigurationType>
-+    <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
-+    <UseOfMfc>false</UseOfMfc><CharacterSet>Unicode</CharacterSet>
-+  </PropertyGroup>
-+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-+  <ImportGroup Label="ExtensionSettings">
-+  </ImportGroup>
-+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-+  </ImportGroup>
-+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-+  </ImportGroup>
-+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-+  </ImportGroup>
-+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
-+  </ImportGroup>
-+  <PropertyGroup Label="UserMacros" />
-+  <PropertyGroup>
-+    <_ProjectFileVersion>14.0.25123.0</_ProjectFileVersion>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-+    <OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
-+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-+    <LinkIncremental>false</LinkIncremental>
-+    <TargetExt>.lib</TargetExt>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-+    <OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
-+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-+    <LinkIncremental>false</LinkIncremental>
-+    <TargetExt>.lib</TargetExt>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-+    <OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
-+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-+    <LinkIncremental>true</LinkIncremental>
-+    <TargetExt>.lib</TargetExt>
-+    <TargetName>$(ProjectName)d</TargetName>
-+  </PropertyGroup>
-+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-+    <OutDir>$(ProjectDir)..\..\..\msvc\</OutDir>
-+    <IntDir>$(Platform)\$(Configuration)\</IntDir>
-+    <LinkIncremental>true</LinkIncremental>
-+    <TargetExt>.lib</TargetExt>
-+    <TargetName>$(ProjectName)d</TargetName>
-+  </PropertyGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-+    <Midl>
-+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <MkTypLibCompatible>true</MkTypLibCompatible>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <TargetEnvironment>Win32</TargetEnvironment>
-+      <TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
-+      <HeaderFileName>
-+      </HeaderFileName>
-+    </Midl>
-+    <ClCompile>
-+      <Optimization>MaxSpeed</Optimization>
-+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-+      <IntrinsicFunctions>true</IntrinsicFunctions>
-+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-+      <AdditionalIncludeDirectories>..\src\common;..\include;.\;..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <PreprocessorDefinitions>PA_WDMKS_NO_KSGUID_LIB;WIN32;NDEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <StringPooling>true</StringPooling>
-+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-+      <FunctionLevelLinking>true</FunctionLevelLinking>
-+      <PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)/portaudio.pch</PrecompiledHeaderOutputFile>
-+      <AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
-+      <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDataBaseFileName>
-+      <WarningLevel>Level3</WarningLevel>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+    </ClCompile>
-+    <ResourceCompile>
-+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <Culture>0x0409</Culture>
-+    </ResourceCompile>
-+    <Link>
-+      <AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
-+      <OutputFile>$(Platform)\$(Configuration)\portaudio_x86.dll</OutputFile>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
-+      <ProgramDatabaseFile>$(Platform)\$(Configuration)\portaudio_x86.pdb</ProgramDatabaseFile>
-+      <ImportLibrary>$(Platform)\$(Configuration)\portaudio_x86.lib</ImportLibrary>
-+      <TargetMachine>MachineX86</TargetMachine>
-+    </Link>
-+    <Bscmake>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
-+    </Bscmake>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\include\*.h "$(OutDir)"include</Command>
-+    </PostBuildEvent>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
-+    </Lib>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-+    <Midl>
-+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <MkTypLibCompatible>true</MkTypLibCompatible>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <TargetEnvironment>X64</TargetEnvironment>
-+      <TypeLibraryName>.\Release_x86/portaudio.tlb</TypeLibraryName>
-+      <HeaderFileName>
-+      </HeaderFileName>
-+    </Midl>
-+    <ClCompile>
-+      <Optimization>MaxSpeed</Optimization>
-+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-+      <IntrinsicFunctions>true</IntrinsicFunctions>
-+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-+      <AdditionalIncludeDirectories>..\src\common;..\include;.\;..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <PreprocessorDefinitions>PA_WDMKS_NO_KSGUID_LIB;_WIN64;NDEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <StringPooling>true</StringPooling>
-+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-+      <FunctionLevelLinking>true</FunctionLevelLinking>
-+      <PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
-+      <AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
-+      <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDataBaseFileName>
-+      <WarningLevel>Level3</WarningLevel>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+    </ClCompile>
-+    <ResourceCompile>
-+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <Culture>0x0409</Culture>
-+    </ResourceCompile>
-+    <Link>
-+      <AdditionalDependencies>ksuser.lib;%(AdditionalDependencies)</AdditionalDependencies>
-+      <OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
-+      <ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
-+      <ImportLibrary>$(Platform)\$(Configuration)/portaudio_x64.lib</ImportLibrary>
-+      <TargetMachine>MachineX64</TargetMachine>
-+    </Link>
-+    <Bscmake>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <OutputFile>$(Platform)\$(Configuration)\portaudio_x64.bsc</OutputFile>
-+    </Bscmake>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\include\*.h "$(OutDir)"include</Command>
-+    </PostBuildEvent>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
-+    </Lib>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-+    <Midl>
-+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <MkTypLibCompatible>true</MkTypLibCompatible>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <TargetEnvironment>Win32</TargetEnvironment>
-+      <TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
-+      <HeaderFileName>
-+      </HeaderFileName>
-+    </Midl>
-+    <ClCompile>
-+      <Optimization>Disabled</Optimization>
-+      <AdditionalIncludeDirectories>..\src\common;..\include;.\;..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <PreprocessorDefinitions>PA_WDMKS_NO_KSGUID_LIB;WIN32;_DEBUG;_USRDLL;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_USE_ASIO=0;PA_USE_DS=1;PA_USE_WMME=0;PA_USE_WASAPI=0;PA_USE_WDMKS=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <MinimalRebuild>true</MinimalRebuild>
-+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-+      <PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)/portaudio.pch</PrecompiledHeaderOutputFile>
-+      <AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
-+      <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x86\$(TargetName).pdb</ProgramDataBaseFileName>
-+      <WarningLevel>Level3</WarningLevel>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-+      <DisableSpecificWarnings>4996;</DisableSpecificWarnings>
-+    </ClCompile>
-+    <ResourceCompile>
-+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <Culture>0x0409</Culture>
-+    </ResourceCompile>
-+    <Link>
-+      <AdditionalDependencies>ksguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
-+      <OutputFile>$(Platform)\$(Configuration)\portaudio_x86.dll</OutputFile>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
-+      <GenerateDebugInformation>true</GenerateDebugInformation>
-+      <ProgramDatabaseFile>$(Platform)\$(Configuration)\portaudio_x86.pdb</ProgramDatabaseFile>
-+      <ImportLibrary>$(Platform)\$(Configuration)\portaudio_x86.lib</ImportLibrary>
-+      <TargetMachine>MachineX86</TargetMachine>
-+    </Link>
-+    <Bscmake>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <OutputFile>$(Platform)\$(Configuration)\portaudio.bsc</OutputFile>
-+    </Bscmake>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\include\*.h "$(OutDir)"include</Command>
-+    </PostBuildEvent>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x86\$(TargetName)$(TargetExt)</OutputFile>
-+    </Lib>
-+  </ItemDefinitionGroup>
-+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-+    <Midl>
-+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <MkTypLibCompatible>true</MkTypLibCompatible>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <TargetEnvironment>X64</TargetEnvironment>
-+      <TypeLibraryName>.\Debug_x86/portaudio.tlb</TypeLibraryName>
-+      <HeaderFileName>
-+      </HeaderFileName>
-+    </Midl>
-+    <ClCompile>
-+      <Optimization>Disabled</Optimization>
-+      <AdditionalIncludeDirectories>..\src\common;..\include;.\;..\src\os\win;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-+      <PreprocessorDefinitions>PA_WDMKS_NO_KSGUID_LIB;_WIN64;_DEBUG;_USRDLL;PA_ENABLE_DEBUG_OUTPUT;_CRT_SECURE_NO_DEPRECATE;PAWIN_USE_WDMKS_DEVICE_INFO;PA_WDMKS_NO_KSGUID_LIB;PA_USE_ASIO=0;PA_USE_DS=0;PA_USE_WMME=1;PA_USE_WASAPI=1;PA_USE_WDMKS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <MinimalRebuild>true</MinimalRebuild>
-+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-+      <PrecompiledHeaderOutputFile>$(Platform)\$(Configuration)\portaudio.pch</PrecompiledHeaderOutputFile>
-+      <AssemblerListingLocation>$(Platform)\$(Configuration)\</AssemblerListingLocation>
-+      <ObjectFileName>$(Platform)\$(Configuration)\</ObjectFileName>
-+      <ProgramDataBaseFileName>$(OutDir)\lib\x64\$(TargetName).pdb</ProgramDataBaseFileName>
-+      <WarningLevel>Level3</WarningLevel>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-+    </ClCompile>
-+    <ResourceCompile>
-+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-+      <Culture>0x0409</Culture>
-+    </ResourceCompile>
-+    <Link>
-+      <AdditionalDependencies>ksguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
-+      <OutputFile>$(Platform)\$(Configuration)\portaudio_x64.dll</OutputFile>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <ModuleDefinitionFile>.\portaudio.def</ModuleDefinitionFile>
-+      <GenerateDebugInformation>true</GenerateDebugInformation>
-+      <ProgramDatabaseFile>$(Platform)\$(Configuration)/portaudio_x64.pdb</ProgramDatabaseFile>
-+      <ImportLibrary>$(Platform)\$(Configuration)\portaudio_x64.lib</ImportLibrary>
-+      <TargetMachine>MachineX64</TargetMachine>
-+    </Link>
-+    <Bscmake>
-+      <SuppressStartupBanner>true</SuppressStartupBanner>
-+      <OutputFile>$(Platform)\$(Configuration)/portaudio_x64.bsc</OutputFile>
-+    </Bscmake>
-+    <Lib>
-+      <OutputFile>$(OutDir)\lib\x64\$(TargetName)$(TargetExt)</OutputFile>
-+    </Lib>
-+    <PostBuildEvent>
-+      <Command>mkdir "$(OutDir)"include
-+xcopy /S /Y $(ProjectDir)..\include\*.h "$(OutDir)"include</Command>
-+    </PostBuildEvent>
-+  </ItemDefinitionGroup>
-+  <ItemGroup>
-+    <ClCompile Include="..\src\common\pa_allocation.c" />
-+    <ClCompile Include="..\src\common\pa_converters.c" />
-+    <ClCompile Include="..\src\common\pa_cpuload.c" />
-+    <ClCompile Include="..\src\common\pa_debugprint.c" />
-+    <ClCompile Include="..\src\common\pa_dither.c" />
-+    <ClCompile Include="..\src\common\pa_front.c" />
-+    <ClCompile Include="..\src\common\pa_process.c" />
-+    <ClCompile Include="..\src\common\pa_ringbuffer.c" />
-+    <ClCompile Include="..\src\common\pa_stream.c" />
-+    <ClCompile Include="..\src\common\pa_trace.c" />
-+    <ClCompile Include="..\src\hostapi\dsound\pa_win_ds.c" />
-+    <ClCompile Include="..\src\hostapi\dsound\pa_win_ds_dynlink.c" />
-+    <ClCompile Include="..\src\hostapi\skeleton\pa_hostapi_skeleton.c" />
-+    <ClCompile Include="..\src\hostapi\wasapi\pa_win_wasapi.c" />
-+    <ClCompile Include="..\src\hostapi\wdmks\pa_win_wdmks.c" />
-+    <ClCompile Include="..\src\hostapi\wmme\pa_win_wmme.c" />
-+    <ClCompile Include="..\src\os\win\pa_win_coinitialize.c" />
-+    <ClCompile Include="..\src\os\win\pa_win_hostapis.c" />
-+    <ClCompile Include="..\src\os\win\pa_win_util.c" />
-+    <ClCompile Include="..\src\os\win\pa_win_waveformat.c" />
-+    <ClCompile Include="..\src\os\win\pa_win_wdmks_utils.c" />
-+    <ClCompile Include="..\src\os\win\pa_x86_plain_converters.c" />
-+  </ItemGroup>
-+  <ItemGroup>
-+    <None Include="portaudio.def" />
-+  </ItemGroup>
-+  <ItemGroup>
-+    <ClInclude Include="..\include\pa_asio.h" />
-+    <ClInclude Include="..\include\pa_win_ds.h" />
-+    <ClInclude Include="..\include\pa_win_wasapi.h" />
-+    <ClInclude Include="..\include\pa_win_waveformat.h" />
-+    <ClInclude Include="..\include\pa_win_wmme.h" />
-+    <ClInclude Include="..\include\portaudio.h" />
-+    <ClInclude Include="..\src\common\pa_gitrevision.h" />
-+  </ItemGroup>
-+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-+  <ImportGroup Label="ExtensionTargets">
-+  </ImportGroup>
-+</Project>
-\ No newline at end of file
--- 
-2.10.2.windows.1
-
diff --git a/contrib/src/portaudio/package.json b/contrib/src/portaudio/package.json
index 66b794b067d02dfaf9785ede19f112771f8f8792..254b89fa1badc9efa1106b96296215de7d7da287 100644
--- a/contrib/src/portaudio/package.json
+++ b/contrib/src/portaudio/package.json
@@ -2,18 +2,12 @@
     "name": "portaudio",
     "version": "v190600_20161030",
     "url": "http://www.portaudio.com/archives/pa_stable___VERSION__.tgz",
-    "deps": [],
-    "patches": [],
-    "win_patches": [
-        "pa-vs2017.patch",
-        "pa-dsound-aecns.patch",
-        "pa-dsound.patch"
-    ],
-    "project_paths": ["MSVC/portaudio.vcxproj"],
-    "with_env" : "",
-    "custom_scripts": {
-        "pre_build": [],
-        "build": [],
-        "post_build": []
-    }
+    "use_cmake" : true,
+    "defines": [
+        "MSVS=1",
+        "PA_USE_ASIO=0",
+        "PA_USE_DS=0",
+        "PA_USE_WMME=0",
+        "PA_USE_WDMKS=0"
+    ]
 }
\ No newline at end of file
diff --git a/src/media/audio/portaudio/portaudiolayer.cpp b/src/media/audio/portaudio/portaudiolayer.cpp
index f473c11875c9981251c18ce595c53b9a81ba25f3..7a284ab6c2b7825b1c6d0522de546d73db2eb0db 100644
--- a/src/media/audio/portaudio/portaudiolayer.cpp
+++ b/src/media/audio/portaudio/portaudiolayer.cpp
@@ -48,6 +48,7 @@ struct PortAudioLayer::PortAudioLayerImpl
     bool initInputStream(PortAudioLayer&);
     bool initOutputStream(PortAudioLayer&);
     bool initFullDuplexStream(PortAudioLayer&);
+    bool apiInitialised_ {false};
 
     std::vector<std::string> getDeviceByType(AudioDeviceType type) const;
     int getIndexByType(AudioDeviceType type);
@@ -173,6 +174,11 @@ PortAudioLayer::getIndexRingtone() const
 void
 PortAudioLayer::startStream(AudioDeviceType stream)
 {
+    if (!pimpl_->apiInitialised_) {
+        JAMI_WARN("PortAudioLayer API not initialised");
+        return;
+    }
+
     auto startPlayback = [this](bool fullDuplexMode = false) -> bool {
         std::unique_lock<std::mutex> lock(mutex_);
         if (status_.load() != Status::Idle)
@@ -407,21 +413,23 @@ PortAudioLayer::PortAudioLayerImpl::getDeviceByType(AudioDeviceType type) const
 void
 PortAudioLayer::PortAudioLayerImpl::init(PortAudioLayer& parent)
 {
-    JAMI_DBG("Init PortAudioLayer");
+    JAMI_DBG("PortAudioLayer Init");
     const auto err = Pa_Initialize();
-    if (err != paNoError) {
+    auto apiIndex = Pa_GetDefaultHostApi();
+    auto apiInfo = Pa_GetHostApiInfo(apiIndex);
+    if (err != paNoError || apiInfo == nullptr) {
         JAMI_ERR("PortAudioLayer error : %s", Pa_GetErrorText(err));
         terminate();
+        return;
     }
 
+    apiInitialised_ = true;
+    JAMI_DBG() << "Portaudio initialized using: " << apiInfo->name;
+
     initInput(parent);
     initOutput(parent);
 
     std::fill(std::begin(streams_), std::end(streams_), nullptr);
-
-    auto apiIndex = Pa_GetDefaultHostApi();
-    auto apiInfo = Pa_GetHostApiInfo(apiIndex);
-    JAMI_DBG() << "Portaudio initialized using: " << apiInfo->name;
 }
 
 int