From d537f19a1c35bdd63b2dccec76338a7731a0e0e7 Mon Sep 17 00:00:00 2001 From: Anthony Samms Date: Tue, 16 Sep 2025 01:18:25 -0400 Subject: [PATCH] build portaudio directly to support ASIO --- .github/workflows/python-app.yml | 25 ++++++++++++++++++++++++- libs/audio/Makefile | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index a97844a..14e70ad 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -25,7 +25,6 @@ jobs: brew update brew install portaudio libsndfile libsamplerate pkg-config - # Use MSYS2 for Windows audio library build with all codec dependencies - name: Set up MSYS2 (Windows) if: runner.os == 'Windows' uses: msys2/setup-msys2@v2 @@ -44,6 +43,30 @@ jobs: mingw-w64-x86_64-mpg123 mingw-w64-x86_64-lame mingw-w64-x86_64-speex + mingw-w64-x86_64-cmake + + - name: Build PortAudio with ASIO (Windows) + if: runner.os == 'Windows' + shell: msys2 {0} + run: | + # Download PortAudio source + curl -L http://files.portaudio.com/archives/pa_stable_v190700_20210406.tgz -o portaudio.tgz + tar -xzf portaudio.tgz + cd portaudio + + # Configure with ASIO support + mkdir build && cd build + cmake .. \ + -DCMAKE_BUILD_TYPE=Release \ + -DPA_USE_ASIO=ON \ + -DPA_USE_DS=ON \ + -DPA_USE_WMME=ON \ + -DPA_USE_WASAPI=ON \ + -DCMAKE_INSTALL_PREFIX=/mingw64 + + # Build and install + make -j$(nproc) + make install - name: Build static audio library (Windows) if: runner.os == 'Windows' diff --git a/libs/audio/Makefile b/libs/audio/Makefile index ab776ae..819116e 100644 --- a/libs/audio/Makefile +++ b/libs/audio/Makefile @@ -18,7 +18,7 @@ endef ifneq (,$(findstring MINGW,$(UNAME_S))) CC = x86_64-w64-mingw32-gcc LIBNAME = libaudio.dll - CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99 -I/mingw64/include -m64 + CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99 -I/mingw64/include -m64 -DPA_USE_ASIO=1 LDFLAGS = -shared -Wl,--export-all-symbols -static-libgcc -static-libstdc++ -L/mingw64/lib -m64 # Core libraries with full dependency chain (order is critical!)