Skip to content

Conversation

@umbertov
Copy link

@umbertov umbertov commented Sep 14, 2025

Hey, stumbled across this project the other day, good to see the effort.

This PR aims to introduce suport for compiling the ASIO driver using the MinGW toolchain.

Code to support MinGW is behind a if(MSVC) check, so it should not impact building with the MS Visual Studio toolchain.

There's two parts to the solution:

  • adding extern "C" __declspec(dlexport) to DllRegisterServer & DllUnregisterServer's headers. This should not interfere with VS compiler.
  • achieving sort of the same effect that pwarASIO.def achieves in windows/asio/CMakeLists.txt using a bunch of cmake and linker directives

Context:

I wanted to use this software on a setup with Archlinux + a Windows VM (with the dockur/windows docker image), but wasn't ablet to run either the nix flake, nor the pre-built ASIO driver, so i resorted to build them myself.

While there were no issues building the linux executable, I wanted to avoid setting up Visual Studio on the VM, something i'm not familiar with, and seemed like a much longer process than installing the MinGW toolchain.

Some questions after my experience:

  • i'm getting a lot of sound artifacts, presumably due to XRUNS or or under-runs; generally the solution is just increasing latency by increasing buffer size. On the linux side, there's only 64 & 128 "Chunk Size" which i'm not sure is the same thing. Switching to either didn't matter much. The oneshot mode made it worse or equal. On the windows side, the "settings panel" of the ASIO driver showed a "Current Buffer Size", which i've traced down to being set to the hard-coded value kDefaultBlockFrames = 128. Tried increasing it to 512, things got a bit better. Tried increasing the kBlockFramesGranularity from 64 to 128, got no audio at all. What do you recommend changing, in order to trade off latency for audio quality (i.e. no artifacts)?
  • I also tried modifying the linux program to accept larger "chunk sizes", by editing the qml & also increasing the PWAR_PACKET_MAX_CHUNK_SIZE constant. Then rebuilt both the linux & the windows programs. This resulted in no audio being played, even if the passthrough test worked fine. Do you think i was missing something?
  • Another thing is that i removed the final copy for PWARASIO.DLL to Z:\music_production. If that belongs to your workflow, you should really do it outside of cmake, otherwise it will not work on other ppl's systems.

@umbertov
Copy link
Author

If you want to test this locally, you can just install the mingw toolchain (either by the link in the previous post or choco install -y mingw if you use chocolatey), then mkdir build, cmake -B build -G "MingGW Makefiles", cmake --build build --parallel

@umbertov umbertov changed the base branch from master to alsa September 27, 2025 15:58
@umbertov
Copy link
Author

@ripxorip just changed the base branch to your most recent PR, so that it could be merged right away into #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant