Closed alex-tee closed 2 years ago
Not sure if possible, i use a git version of jack-1.9 and even though i managed to get it building with Msys2/mingw i newer got it working since it relies on the native portaudio which does not by default include ASIO support (only one that seems to work). Also it looks for config files in the wrong place for an Msys2/mingw build so look forward to a lot of patching.
hi,
@lazka this works for me (other users have tested it as well). I am using the git version though, not sure if the latest release works. I hear the new version will be released around july 15
@revelator if you just want to use the library it doesn't matter if this version doesn't include ASIO support. you can download the official JACK server binaries for windows and run the server from there with ASIO support. then your app built with this will have ASIO support because all it does is connect to the jack server.
# Maintainer: Alexandros Theodotou <alex at zrythm dot org>
_realname=jack2
_commit=5f1b2be0dc509469a072041643c3e45bfa406b9a
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.9.14.r1
pkgrel=1
arch=('any')
pkgdesc='jack2'
depends=("$MINGW_PACKAGE_PREFIX-portaudio")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-python3")
options=('strip' 'staticlibs')
license=("GPL2")
url="https://jackaudio.org/"
source=("https://github.com/jackaudio/$_realname/archive/$_commit.zip")
sha256sums=('SKIP')
prepare() {
rm -rf ${_realname}-${pkgver}
mv ${_realname}-${_commit} ${_realname}-${pkgver}
cd ${_realname}-${pkgver}
[[ -x ./waf ]] || /usr/bin/python ./bootstrap.py
sed -i 's:bin/env python$:bin/env python:' waf
}
build() {
cd "${srcdir}/${_realname}-${pkgver}"
DEST_OS=win32 \
TARGET=${MINGW_CHOST} \
PKG_CONFIG=${MINGW_PREFIX}/bin/pkg-config \
CC=gcc CXX=g++ PERL=/usr/bin/perl \
AR=${MINGW_PREFIX}/bin/ar \
WINDRES=${MINGW_PREFIX}/bin/windres \
RST2MAN=${MINGW_PREFIX}/bin/rst2man3 \
/usr/bin/python3 ./waf configure \
--prefix=${MINGW_PREFIX} \
--check-c-compiler=gcc \
--check-cxx-compiler=g++
/usr/bin/python ./waf build
}
package() {
cd "${srcdir}/${_realname}-${pkgver}"
export PYTHON=${MINGW_PREFIX}/bin/python
/usr/bin/python ./waf install --destdir="${pkgdir}"
}
Thanks. If you want the package to be in the the repo you need to create a PR and use a release.
As an sdk for interfacing that should do it, though it should also be possible to make a working package. I have a few things to iron out still in my build but i got it to accept config paths that work fine with Msys2/MinGW64 environment. But i just moved and the only internet i have atm. is from my smartphone and not very fast, but when i get internet up again in my new hovel ill see about fixing up my patchset so you can look it over.
FWIW, vcpkg only builds the JackWeakAPI which dynamically loads the real JACK library and forwards API calls to it. I am working on getting this to work with the portaudio port in vcpkg so PortAudio applications can use the JACK PortAudio backend on Windows. I hope to make use of this in Mixxx and Tenacity. You might consider a similar approach for MINGW of only building JackWeakAPI.
I am working on getting this to work with the portaudio port in vcpkg so PortAudio applications can use the JACK PortAudio backend on Windows.
It turns out this does not work due to a missing regex.h POSIX header in MinGW (Windows of course has no POSIX headers to use with MSVC). In my rewrite of PortAudio's build system I have avoided artificial restrictions based on the platform. If the JACK library and POSIX headers are found, it will build with JACK support. So if MinGW does provide regex.h then PortAudio should be able to build with JACK support.
libtre or libgnurx supllies a standard regex library with regex.h we prefer libtre i noticed which incidently relies on libsystre also. could possibly also use pcre as that one also supplies regex functions, but may have to change the header name from regex.h.
I did get PortAudio building with JACK support on Windows with the help of TRE. I had to use TRE for both MinGW and MSVC. I also needed to link pthreads4w for MSVC.
I do not know if this will be helpful to you, but I wrote a CMake find module for regex.h that first checks for a POSIX regex.h header then falls back to searching for TRE.
instead of linking to the old pthreads4w you can just change the pthread identifier in jack/systemdeps.h to WIN_PTHREADS_H to link to the pthread library we allready provide with mingw-w64 :). A cmake script for building it would indeed be cool, waf tends to be a bit picky when it comes to windows ;)
That may be useful for building JACK itself but the issue I ran into with PortAudio is that it uses the POSIX pthreads API and has #include <pthreads.h>
.
both are just simulating the posix pthreads api so either is fine though using our own would make things simpler :)
Yes, MinGW's pthreads.h
works. It is with MSVC where pthreads4w is needed. TRE is needed for both though.
I have compiled jack2 project. Is there any way to test it in Windows?
I don't think packaging libjack is really appropriate for MSYS2 because applications shouldn't ship their own copy of libjack, but rather use the system copy from https://jackaudio.org/ I have an open PR to fix JackWeakAPI for Windows. Alternatively you can use weakjack, but note that is GPL licensed whereas JackWeakAPI is LGPL licensed (same as libjack).
because applications shouldn't ship their own copy of libjack
Would you like to explain that please?
Refer to the explanation here: https://github.com/RustAudio/rust-jack/blob/63e3e69612b0b6af138f18d5ab407faf78f2c3e9/src/lib.rs#L4
Will not the mingw jack2 package become as a system library? If a package requires libjack then it will be installed as a dependency by pacman.
I presume just about anyone wanting to use a jack2 package from MSYS2 would be doing so to build a JACK application for Windows, not installing a JACK server on Windows.
Can Jack server from mingw package be used with other application?
Yes, if those applications all link to the same libjack that the server uses. But Windows users install the JACK server from the build hosted at https://jackaudio.org/downloads/
yeah the correct way is to use weak jack on windows https://github.com/x42/weakjack, see also https://github.com/thestk/rtaudio/issues/340#issuecomment-1026243379
OK, then. Should this issue be closed now?
Why should it be closed? The package was not added.
As you've mentioned this
I don't think packaging libjack is really appropriate for MSYS2 because applications shouldn't ship their own copy of libjack
JackWeakAPI should be packaged as the jack package like vcpkg does.
I have added a pull request to add the package. Would anyone like to test the packages from GitHub Actions artifacts of that pull request? The test packages can be downloaded from here https://github.com/msys2/MINGW-packages/actions/runs/1841595672
Is it possible to route audio over network from a VM to host Windows OS? I want to test the package. I've used the mingw-w64-pulseaudio package with WSL2 and a VM and expecting something like that with Jack.
I thought about this a bit more, and there are 2 ways MSYS can decide to go about this:
/bin/jackd
)IIUC, MSYS is supposed to be a system on its own, so option 1 makes more sense to me. If a developer wishes to use the system JACK server outside of MSYS, that's the developer's problem - he/she is better off using weakjack in that case. But building a JACK MSYS package normally (the full distribution) means you don't even need a system installation outside MSYS and you can run JACK inside MSYS without any external dependencies.
So it's up to MSYS maintainers to decide which one they prefer, but my suggestion is to go with 1 (i.e., my original patch above)
EDIT: option 1 is what Homebrew uses (it packages the whole JACK distribution that includes the server): https://formulae.brew.sh/formula/jack
it builds JACK normally and the resulting package can be used as a JACK server inside an msys terminal
The linked pull request builds jack server. jackd can be run but I don't know any way to test it. Feel free to grab the packages from that pull request.
Those options aren't mutually exclusive. There could be packages for both a JACK server and weakjack. If MSYS does ship a JACK server, it would be good to also ship QJackCtl.
it builds JACK normally and the resulting package can be used as a JACK server inside an msys terminal
The linked pull request builds jack server. jackd can be run but I don't know any way to test it. Feel free to grab the packages from that pull request.
Like @Be-ing said, it would be a good idea to package QJackCtl at the same time, like homebrew does, so you can manage the JACK graph via a GUI. Also, it would be best to package JALV (official LV2 reference host), which runs LV2 plugins through JACK. Then you can just download some LV2 plugins (like ZPlugins/DHISTRO ports/DPF plugins/etc.) and run them via jalv. You could run a synthesizer in one terminal and a meter in another terminal, and connect them via QJackCtl, and if you see output in the meter it's probably working fine.
I already have the package recipes for lv2/serd/sord/sratom/lilv here (https://git.sr.ht/~alextee/zrythm-installer/tree/master/item/windows-msys) so you'd only need to write the recipe for jalv (https://github.com/drobilla/jalv/)
Any command to test without GUI?
I haven't used JACK command line tools so I'm not sure but you might find something here https://github.com/jackaudio/jack2/tree/develop/tools or here https://github.com/jackaudio/example-clients
I have added qjackctl in that pull request. Please test the packages.
Packaging request for JACK audio. Many audio apps use it.