build with JACK on Windows + macOS; use vcpkg?

Be.

New Member
Hi OBS developers,
I am a developer of Mixxx as well as Tenacity. Both of these applications use the PortAudio cross platform audio I/O library. I recently rewrote PortAudio's CMake build system. As part of that, I got PortAudio to build with JACK support on macOS. I got it building on Windows too although I have not gotten it working in Mixxx yet.

This got me thinking what would be useful to connect to Mixxx via JACK on Windows and macOS and my first thought was OBS. Users on both our forums have asked for this unfortunately with no response:

So I took a look at how you build OBS and unfortunately it does not look like you build with JACK support on macOS or Windows. For applications to support JACK on these operating systems is a bit different than Linux. On Linux, the JACK library is generally installed from the system package manager and applications can directly link to it. But on Windows and macOS, the JACK server and library are installed separate from the OS so applications don't link to it directly; rather, applications use a shim that dynamically loads the real JACK library and forwards API calls. Refer to this discussion for more details.

The other issue is that building OBS' dependencies on Windows and macOS looks really cumbersome to maintain. I found the obs-deps repository and it looks like you use a giant GitHub Actions workflow file manually building every dependency for macOS. It might not be a ton of work to add a new dependency to that; I'm not sure. For Windows, I see on the build instructions you tell developers to download some prebuilt dependencies, but I can't find any information about how those builds are made. Did someone just build them locally once and put them on your server?

This may be a good impetus to switch to a better system for managing your dependencies on Windows and macOS. I see you are in the midst of overhauling your CMake build system so maybe this would be a good next step to improve your infrastructure. In Mixxx we recently invested about a month of work to get all our Windows dependencies building with vcpkg. Similarly the impetus to start working on that for Mixxx was adding a new dependency on Windows. vcpkg is quite nice to work with and so much easier to maintain than the custom Windows batch scripts and Visual Studio project files we used for Windows before and the custom shell scripts we used for macOS dependencies. We're almost done with setting up vcpkg for macOS for Mixxx. I've spent the last month getting Tenacity building with vcpkg on macOS and Windows (and optionally building with vcpkg on Linux too). The `jack2` port in vcpkg builds the JackWeakAPI shim which you could link OBS to.

For Mixxx, we are using the classic mode of vcpkg to install a big list of packages on GitHub Actions then using `vcpkg archive` to export a ZIP of the built dependencies and upload that to our server, which then gets downloaded and cached on GitHub Actions for the application builds. We have a Windows batch script in the application repository which reads a plain text file indicating the file name of the dependency ZIP to download from our server. This works exactly the same on GitHub Actions as it does for local development, which makes it much easier for people to contribute on Windows.

I tried setting up vcpkg's binary caching feature with Azure Artifacts' free service with 2GB storage hoping that developers could use the binaries built on GitHub Actions for local development. Unfortunately that doesn't work yet because vcpkg hashes the compiler as part of the cache key to maximize reproducibility and ABI compatibility. Work has started to optionally disable that constraint. The `vcpkg archive` to produce a ZIP archive of the built libraries does not work in the newer manifest mode where the dependencies are specified in a vcpkg.json manifest file similar to a Cargo.toml for Cargo or packages.json file for NPM, so the binary caching feature is the only way to reuse prebuilt binaries from build servers in manifest mode. For Tenacity, I set it up to use a vcpkg.json file because the cost of building all the dependencies is only about one hour. By contrast, Mixxx's dependencies take about 4 hours to build on GitHub Actions, with about half of that being Qt, so asking developers to build all the dependencies locally would be a higher barrier to getting started.

I hope we can get these applications working with JACK and expand the JACK ecosystem on macOS and Windows. I'm happy to give you advise setting up vcpkg if you're interested.
 
Top