Pulseeffects: Link libzita-convolver as an external library

Created on 14 Jul 2018  路  11Comments  路  Source: wwmm/pulseeffects

Why did you decide to include libzita-convolver into PulseEffects' code? This library is available as an independent package in both Arch and Debian/Ubuntu (https://packages.debian.org/search?keywords=zita&searchon=names&suite=all&section=all), usually open source projects do not carry with them what can be linked dynamically to not double the code. Your variant does not seem to be its fork.

Or may be you have plans to fork it...


I've looked at zita-convolver source package in Debian. I contains zita-convolver.cc, zita-convolver.h and a Makefile + debian's patch for Makefile. During building this package (https://packages.debian.org/sid/libzita-convolver3) is devided into a binary package and a -dev package, what is a standard practice in most distributions (but not Arch, because it's packaging system is awful :-) )

The package with debug symbols libzita-convolver3-dbgsym is automatically created by Debian's build system, the same way pulseeffects-dbgsym is also created, see https://launchpad.net/~mikhailnov/+archive/ubuntu/pulseeffects/+packages

I'm not sure and did not try to build it, but https://github.com/wwmm/pulseeffects/blob/master/src/convolver/meson.build seems to install all the resulting files into pulseeffects' directory, including those ones that must be a -dev package, I think.

enhancement question

All 11 comments

Also, Debian maintains buildability of zita-convolver for many different architectures:
alpha amd64 arm64 armel armhf hppa hurd-i386 i386 kfreebsd-amd64 kfreebsd-i386 m68k mips mips64el mipsel powerpcspe ppc64 ppc64el s390x sh4 sparc64 x32

Both zita-convolver and pulseeffects are currently buildable for most of them (https://launchpad.net/~mikhailnov/+archive/ubuntu/pulseeffects/+packages) without any additional efforts, but the situation may change, and maintaining buildability may become a pain. Even now calf-plugins 0.90.0 can be build only for x86 and x86_64 (I did not investigate why), while 0.0.60 in Debian is built for all those architectures.

Also, a e2k port is currently in progress in ALT Linux, and as e2k is a VLIW-like architecture without a gcc port, but with a gcc partly compatible compiler instead (because compiler optimizations are by far more important for e2k/VLIW, than non-VLIW architectures) building for it often requires some patches, and it's not currently upstreamed (glibc probably does have upstream support already). Of course, building pulseeffects and all its dependencies is not a priority, I just wrote it... well, I don't know what for, but probably to show how uneasy the situation may be :)

We would also like this on NixOS. Meson subprojects could be used if you still want to vendor it for distributions that lack it.

Hi guys! I do not intend to fork zita. I don't have the knowledge for that :D. The problem is that in order to support different zita versions I have to make a few changes to the plugin source code and I did not want to focus on that in this first release. I wanted to make an early release so that I could have users feedback like @jtojnar is already doing in #263.

Based on what I saw in the source code of a few projects like the ones I linked in the changelog updates to zita have the history of breaking api. In PE I am using zita 4 and a few functions have different arguments and behave in a different way when compared to zita 3. And zita 3 has its differences when compared to zita 2. So in other to compile with different zita versions these projects have a few preprocessor if/def throughout the code to choose the appropriate function calls and methods at compilation time. As I am not aware of all the relevant differences between these versions yet the best course of action was to ship zita with PE.

I am also not sure about how to deal with a system wide zita in meson. Zita does not come with the pkg-config files meson usually uses to check if a library is installed and in case it is which version is present. The convolver plugin could be optional based on the availability of the zita package and on its version. I will probably support only zita 3 and 4 so just checking if zita is installed is not enough. It would be good that meson checked that one of these two version is installed. But how can I tell meson to do that without using pkg-config files? Any ideas @jtojnar?

Maybe @AsavarTzeth has a few ideas about the best way to use a library without pkg-config files in meson.

I would just support zita 4, let it be packager's responsibility to provide it.

Regarding meson, you should be able to do something like the following.

cxx = meson.get_compiler('cpp')
zita_convolver = cxx.find_library('zita-convolver')
if not cxx.compiles('''
    #include <zita-convolver.h>
    #if ZITA_CONVOLVER_MAJOR_VERSION != 4
        #error "This programs requires zita-convolver 4.x.x"
    #endif
''',
dependencies: [zita_convolver])
    error('Missing dependency zita-convolver 4.x.x')
endif

I see, zita-convolver 4.0 is only in staging in Arch Linux: https://www.archlinux.org/packages/community-staging/x86_64/zita-convolver/
But it was not updated for ages before 4.0: https://packages.debian.org/search?keywords=libzita-convolver3

it will not be the of the world to build PulseEffects with built in zita

I would just support zita 4, let it be packager's responsibility to provide it.

Than it will not work even on Arch at the moment

Thank you for the meson code @jtojnar. About the zita version I think supporting only version 4 is not good. Like @mikhailnov said even Arch Linux is not using version 4 yet.

As far as I could see changing the source code to support both version 3 and 4 should not be difficult.

As Debian includes library major version into package name (libzita-convolver3), I will probably be able to package zita-convolver 4.0 in the PPA, build PulseEffects with it and co-install libzita-convolver3 and libzita-convolver4 in parallel, but it will not be the solution for upstream Debian if pulseeffects gets there one day (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=902700)

I released PE 4.1.6 without the embedded zita. Unless I have made a mistake it should compile with both zita 3 and 4.

If you want to make the convolver optional, you will need to make the library required: false, otherwise the following error is thrown instead of the message:

src/convolver/meson.build:3:0: ERROR:  C++ library 'zita-convolver' not found

One disadvantage of this approach is that meson does not add libraries found with compiler.find_library to rpath, which kind of breaks things for us on NixOS. Until the meson bug https://github.com/mesonbuild/meson/issues/3882 is fixed, we will just patch the rpath manually.

I did not notice that. Thanks!

Was this page helpful?
0 / 5 - 0 ratings