JACK development files for Pipewire

Hi everyone

This is my first time installing SuperCollider on a computer which is using PipeWire. I’m following the instructions here: Installing SuperCollider from source on Ubuntu · supercollider/supercollider Wiki · GitHub

I haven’t installed JACK at all because the distro already had PipeWire. When I run the command:

cmake ..

I get the error:

CMake Error at server/scsynth/CMakeLists.txt:43 (message):
  Jack selected as audio API, but development files not found

I assume this is because I don’t have the equivalent of libjack-jackd2-dev. Is this the right package to install if I’m using PipeWire? Or do I need something else?

Thanks

Hi. No-one has built supercollider on Ubuntu using Pipewire (i.e. any Ubuntu from 22.10)?

I build supercollider on arch linux with pipewire/wireplumber and didn’t need to install anything special for building. Just the regular jack development stuff. If I understand correctly, pipewire offers a library that is binary compatible with jack (in other words, it can disguise itself as jack to applications who want to use jack).

1 Like

Yes - I thought that package (on Ubuntu) was pipewire-jack, but I can still can’t build SC.

Looks like I have to install relevant-looking packages at random and keep trying. If I find the right one I’ll post the answer.

Admittedly I’m guessing here, but I think what shiihs is saying is that to build SC, you need the JACK dev package, even if you’re planning to run pipewire – “didn’t need to install anything special for building. Just the regular jack development stuff” – this quote to me looks like it’s saying to build using the documented dependencies, without adjusting for pipewire.

If I’m reading that correctly, then pipewire-jack would not satisfy the libjack-dev dependency, but pipewire-jack might be used at runtime so that scsynth thinks it’s connecting to a JACK server.

Or I could be wrong… but I think it’s worth a shot this way before randomly adding a bunch of stuff.

hjh

Hi jamshark

So we are definitely talking about packages needed to build SC here. :slight_smile:

So I get that pipewire-jack is basically a fake JACK from SC’s point of view - it is for SC to work with at runtime. I thought that possibly it also provided the headers or whatever that are needed at compile time too (I’m very naive about such things), but that appears not to be the case since I’ve installed pipewire-jack and still can’t build SC.

Are you saying that perhaps I should install libjack-jackd2-dev as mentioned here? So far I’ve avoided doing that, as I assumed it would pull in JACK2 itself and I’d end up in all sorts of confusion about what flavour of JACK I’m running. Is that what you mean?

If not, I guess I just need to find out what is the ‘dev’ JACK package that corresponds to Pipewire and install that first.

I believe building with Pipewire is a known issue.
The fix hasn’t been merged yet. See https://github.com/supercollider/supercollider/issues/5678#issuecomment-1003818125 and the rest of this issue for background information. You can try building a branch in the unmerged/linked PR or try Patrick’s workaround.

Oh, thank you so much for finding this. I’ll post back once I’ve tried it.

I’m very sorry for creating confusion. I should never rely on my flaky memory when replying to questions like these.

This time I checked properly: on arch linux, the pipewire-jack package provides both the libs and the include files that are needed to build supercollider with jack.

Not at all! If there’s any confusion it’s probably me mucking the build up.

I got further this time! I searched for libjack.so and found it in /usr/lib/x86_64-linux-gnu/pipewire-0.3/jack. Then I used the following command:

cmake -DCMAKE_BUILD_TYPE=Release -DNATIVE=ON -DSC_EL=OFF -DAUDIOAPI=jack -DJACK_LIBRARY=/usr/lib/x86_64-linux-gnu/pipewire-0.3/jack/libjack.so ..

Now I get this:

CMake Error in server/scsynth/CMakeLists.txt:
  Found relative path while evaluating include directories of "libscsynth":

    "JACK_INCLUDE_DIR-NOTFOUND"

CMake Error in server/scsynth/CMakeLists.txt:
  Found relative path while evaluating include directories of "scsynth":

    "JACK_INCLUDE_DIR-NOTFOUND"

I guess this means there’s something else that the build process can’t find.

Looking at Patrick’s solution, it wasn’t clear whether it actually fixed the problem on a recent distro.

I’d suggest looking at the linked PR #5680 - either check out that branch (can be done fairly easily using Github Desktop app) or possibly manually apply the changes to the relevant CMake files…

EDIT: to double check - can you try again after clearing out the build directory?

Clearing build and trying again didn’t work.

I manually made the changes to CMakeLists.txt in both /server/scsynth and /server/supernova.

Different error now when I run cmake:

CMake Error at /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
  server/scsynth/CMakeLists.txt:42 (pkg_check_modules)

Have you also removed cmake_modules/FindJack.cmake?

Thanks, I just tried that. Same error message as the one above.

And you’re right, I didn’t notice that the file was deleted in the diff, so thank you. But it I have now deleted it from my clone, and double checked the file changes to the two CMakeLists.txt files. Still the same error.

I see that the changes to the CMakeLists.txt files are now in master, so I’ve pulled, deleted and recreated the build directory and tried again. This fixes the original problem with finding the development files, but I still get the same later error:

CMake Error at /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
  server/scsynth/CMakeLists.txt:47 (pkg_check_modules)

Is this something I need to install?

I’ll keep working on this and if I find a solution I’ll post it here.

I missed something important. FindPkgConfig.cmake is telling me what package it can’t find. A fuller output from running cmake is below:

-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found fftw3f: /usr/lib/x86_64-linux-gnu/libfftw3f.so
-- FFT library (scsynth): FFTW
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Checking for module 'jack'
--   No package 'jack' found
CMake Error at /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:607 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:829 (_pkg_check_modules_internal)
  server/scsynth/CMakeLists.txt:47 (pkg_check_modules)

So it’s unable to find a package called jack.

Hello @bad-numbers
I’ve just tried this on Fedora 34. It seems that you need to install package pipewire-jack-audio-connection-kit-devel.

I came across the same error when working in an alpine docker container. I fixed this by

After this you can start SuperCollider with pipewire :slight_smile:

Here is my SC setup command command

# apply submodule fix
# see https://github.com/supercollider/supercollider/issues/5695#issuecomment-1072263846
git clone \
    --depth 1 \
    --branch 3.12 \
    https://github.com/SuperCollider/SuperCollider.git && \
    cd SuperCollider && \
    sed -i "s|git://|https://|g" .gitmodules && \
    git submodule update --init --recursive && \
    mkdir -p build && \
    cd build

and here the build flags

cmake \
	-DCMAKE_BUILD_TYPE=Debug \
	-DSUPERNOVA=OFF \
	-DSC_ED=OFF \
	-DSC_EL=OFF \
	-DSC_VIM=ON \
	-DNATIVE=ON \
	-DSC_IDE=OFF \
	-DNO_X11=ON \
	-DSC_ABLETON_LINK=OFF \
	-DSC_QT=OFF .. && \
	cmake --build . --config Debug --target all -j${MAKE_JOBS} && \
    cmake --build . --config Debug --target install -j${MAKE_JOBS} && \
    rm -rf /root/SuperCollider

Maybe this helps you in some way, but this is more a hack than a proper solution.

If you are interested I can share my Dockerfile.