From a0db75b14cbbeda7a8d582537a5c33b720016c7a Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 17 Jun 2020 20:30:33 +0100 Subject: [PATCH] Build portaudio with all possible winapis Signed-off-by: falkTX --- build-jack.sh | 15 ++++- .../02_fix-wdmks-wasapi-dsound.patch | 67 +++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch diff --git a/build-jack.sh b/build-jack.sh index 42e8eba..8bdeb32 100755 --- a/build-jack.sh +++ b/build-jack.sh @@ -115,7 +115,20 @@ if [ "${WIN32}" -eq 1 ]; then export EXTRA_CXXFLAGS="-I${ASIO_DIR}" export EXTRA_MAKE_ARGS="-j 1" download portaudio19 "${PORTAUDIO_VERSION}" "http://deb.debian.org/debian/pool/main/p/portaudio19" "orig.tar.gz" - build_autoconf portaudio19 "${PORTAUDIO_VERSION}" "--enable-cxx --with-asiodir="${ASIO_DIR}" --with-winapi=asio" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/audioclient.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/devicetopology.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/endpointvolume.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/functiondiscoverykeys.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksguid.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksproxy.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/ksuuids.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/mmdeviceapi.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propkeydef.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/propsys.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/rpcsal.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/sal.h" + remove_file portaudio19 "${PORTAUDIO_VERSION}" "src/hostapi/wasapi/mingw-include/structuredquery.h" + build_autoconf portaudio19 "${PORTAUDIO_VERSION}" "--enable-cxx --with-asiodir="${ASIO_DIR}" --with-winapi=asio,directx,wasapi,wdmks,wmme" fi # --------------------------------------------------------------------------------------------------------------------- diff --git a/patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch b/patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch new file mode 100644 index 0000000..6a1b1c3 --- /dev/null +++ b/patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch @@ -0,0 +1,67 @@ +diff -Naur configure.in configure.in +--- a/configure.in 2016-10-30 02:23:04.000000000 +0100 ++++ b/configure.in 2017-05-29 22:20:15.000000000 +0200 +@@ -346,7 +346,7 @@ + add_objects src/hostapi/wasapi/pa_win_wasapi.o src/common/pa_ringbuffer.o src/os/win/pa_win_hostapis.o src/os/win/pa_win_util.o src/os/win/pa_win_coinitialize.o src/os/win/pa_win_waveformat.o + LIBS="${LIBS} -lwinmm -lm -lole32 -luuid" + DLL_LIBS="${DLL_LIBS} -lwinmm -lole32" +- CFLAGS="$CFLAGS -I\$(top_srcdir)/src/hostapi/wasapi/mingw-include -UPA_USE_WASAPI -DPA_USE_WASAPI=1" ++ CFLAGS="$CFLAGS -UPA_USE_WASAPI -DPA_USE_WASAPI=1" + fi + ;; + +diff -Naur src/hostapi/dsound/pa_win_ds.c src/hostapi/dsound/pa_win_ds.c +--- a/src/hostapi/dsound/pa_win_ds.c 2016-10-30 02:23:04.000000000 +0100 ++++ b/src/hostapi/dsound/pa_win_ds.c 2017-05-29 22:20:15.000000000 +0200 +@@ -904,7 +904,10 @@ + case DSSPEAKER_STEREO: count = 2; break; + case DSSPEAKER_SURROUND: count = 4; break; + case DSSPEAKER_5POINT1: count = 6; break; +- case DSSPEAKER_7POINT1: count = 8; break; ++#ifndef DSSPEAKER_7POINT1 ++#define DSSPEAKER_7POINT1 0x00000007 ++#endif ++ case DSSPEAKER_7POINT1: count = 8; break; + #ifndef DSSPEAKER_7POINT1_SURROUND + #define DSSPEAKER_7POINT1_SURROUND 0x00000008 + #endif +@@ -2136,7 +2139,7 @@ + } + else + { +- CalculateBufferSettings( &stream->hostBufferSizeFrames, &pollingPeriodFrames, ++ CalculateBufferSettings( (unsigned long*)&stream->hostBufferSizeFrames, &pollingPeriodFrames, + /* isFullDuplex = */ (inputParameters && outputParameters), + suggestedInputLatencyFrames, + suggestedOutputLatencyFrames, +diff -Naur src/hostapi/wasapi/pa_win_wasapi.c src/hostapi/wasapi/pa_win_wasapi.c +--- a/src/hostapi/wasapi/pa_win_wasapi.c 2016-10-30 02:23:04.000000000 +0100 ++++ b/src/hostapi/wasapi/pa_win_wasapi.c 2017-05-29 22:20:15.000000000 +0200 +@@ -54,16 +54,22 @@ + #endif + + // WASAPI ++// using adjustments for MinGW build from @mgeier/MXE ++// https://github.com/mxe/mxe/commit/f4bbc45682f021948bdaefd9fd476e2a04c4740f + #include // must be before other Wasapi headers +-#if defined(_MSC_VER) && (_MSC_VER >= 1400) +- #include ++#if defined(_MSC_VER) && (_MSC_VER >= 1400) || defined(__MINGW64_VERSION_MAJOR) ++ #include + #define COBJMACROS +- #include ++ #include + #include + #define INITGUID // Avoid additional linkage of static libs, excessive code will be optimized out by the compiler + #include +- #include +- #include // Used to get IKsJackDescription interface ++#ifndef _MSC_VER ++ #include ++#endif ++ #include ++ #include ++ #include // Used to get IKsJackDescription interface + #undef INITGUID + #endif + #ifndef __MWERKS__