Browse Source

Build portaudio with all possible winapis

Signed-off-by: falkTX <falktx@falktx.com>
tags/v1.0
falkTX 4 years ago
parent
commit
a0db75b14c
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 81 additions and 1 deletions
  1. +14
    -1
      build-jack.sh
  2. +67
    -0
      patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch

+ 14
- 1
build-jack.sh View File

@@ -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

# ---------------------------------------------------------------------------------------------------------------------


+ 67
- 0
patches/portaudio19/02_fix-wdmks-wasapi-dsound.patch View File

@@ -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 <mmreg.h> // must be before other Wasapi headers
-#if defined(_MSC_VER) && (_MSC_VER >= 1400)
- #include <Avrt.h>
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) || defined(__MINGW64_VERSION_MAJOR)
+ #include <avrt.h>
#define COBJMACROS
- #include <Audioclient.h>
+ #include <audioclient.h>
#include <endpointvolume.h>
#define INITGUID // Avoid additional linkage of static libs, excessive code will be optimized out by the compiler
#include <mmdeviceapi.h>
- #include <functiondiscoverykeys.h>
- #include <devicetopology.h> // Used to get IKsJackDescription interface
+#ifndef _MSC_VER
+ #include <functiondiscoverykeys_devpkey.h>
+#endif
+ #include <functiondiscoverykeys.h>
+ #include <mmdeviceapi.h>
+ #include <devicetopology.h> // Used to get IKsJackDescription interface
#undef INITGUID
#endif
#ifndef __MWERKS__

Loading…
Cancel
Save