Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] Split PulseEffects and gstreamer plugins for headless usage #876

Closed
M0Rf30 opened this issue Jan 15, 2021 · 12 comments
Closed

[IDEA] Split PulseEffects and gstreamer plugins for headless usage #876

M0Rf30 opened this issue Jan 15, 2021 · 12 comments

Comments

@M0Rf30
Copy link
Contributor

M0Rf30 commented Jan 15, 2021

Poking around on my headless rpi4 configuration, I realized that it could be useful to split these resources:

/usr/lib/gstreamer-1.0/libgstpeadapter.so
/usr/lib/gstreamer-1.0/libgstpeautogain.so
/usr/lib/gstreamer-1.0/libgstpeconvolver.so
/usr/lib/gstreamer-1.0/libgstpecrystalizer.so
/usr/lib/gstreamer-1.0/libgstpernnoise.so

and the GTK stuff.
My scenario is the usage of convolver attached to a gstreamer pipeline for Mopidy usage.
So, why install toon of packages related to desktop usage if we could have pulseeffects and gst-plugins-pulseeffects packages?
I know that it's a matter of packaging refactoring, but I'm just talking about this to know if there are some limitations.

EDIT:
I drafted this:

# Maintainer: robertfoster
# Contributor: Bleuzen <supgesu@gmail.com>
# Contributor: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Wellington <wellingtonwallace@gmail.com>
pkgbase=pulseeffects-git
pkgname=("${pkgbase}" "gst-plugins-${pkgbase}")
pkgver=4.8.4.r82.g5ce47ad2
pkgrel=1
pkgdesc='Audio Effects for Pulseaudio Applications'
arch=(x86_64 i686 arm armv6h armv7h aarch64)
url='https://github.com/wwmm/pulseeffects'
license=('GPL3')
makedepends=('meson' 'boost' 'git' 'itstool' 'appstream-glib'
  'zam-plugins' 'rubberband')
source=("git+https://github.com/wwmm/pulseeffects.git")
conflicts=(pulseeffects)
provides=(pulseeffects)
sha512sums=('SKIP')

pkgver() {
  cd pulseeffects
  git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  mkdir -p pulseeffects/build
  cd pulseeffects/build

  arch-meson ..

  ninja
}

package_pulseeffects-git() {
  pkgdesc="Audio Effects for Pulseaudio Applications"
  depends=('gtk3' 'gtkmm3' 'glibmm' 'libpulse'
    'gstreamer' 'gst-plugin-gtk' 'gst-plugins-bad' 'gst-plugin-pipewire' 'gst-plugins-pulseeffects'
    'lilv' 'boost-libs' 'libsigc++' 'calf' 'lsp-plugins' 'yelp')
  optdepends=('zam-plugins: maximizer'
    'rubberband: pitch shifting')
  conflicts=(pulseeffects)
  provides=(pulseeffects)
  cd pulseeffects/build

  DESTDIR="$pkgdir" ninja install
  rm -rf $pkgdir/usr/lib
}

package_gst-plugins-pulseeffects-git() {
  pkgdesc="Audio Effects for Pulseaudio Applications - gstreamer plugins"
  depends=('gstreamer' 'gst-plugins-base' 'libebur128' 'librnnoise'
    'libsndfile' 'libsamplerate' 'zita-convolver')
  optdepends=()
  conflicts=(gst-plugins-pulseeffects)
  provides=(gst-plugins-pulseeffects)
  cd pulseeffects/build

  DESTDIR="$pkgdir" ninja install
  rm -rf $pkgdir/usr/{bin,share}
}

and, from a first attempt, adding targets in meson/ninja (one for gtk and one for gst) could do the difference in terms of packaging simplification, avoiding the ugly rms and the doubled ninja installs

@wwmm
Copy link
Owner

wwmm commented Jan 15, 2021

I'm just talking about this to know if there are some limitations.

As far as I remember there isn't. These plugins can be used independently. They still use headers from PulseEffects source for convenience. But once compilation is done it should be possible to use them independently. But this isn't something I test.

I think that on Ubuntu some of them are already in separated packages. So it can be done.

adding targets in meson/ninja

I never tried to add targets in Meson. If there is a way to keep the current behavior as default while giving the option to compile only what is wanted I do not see a reason for not doing it.

@M0Rf30
Copy link
Contributor Author

M0Rf30 commented Jan 17, 2021

Done, I uploaded pulseeffects-git on AUR. For now it uses the same instructions posted here. I only noticed different targets with ninja -t targets, but I don't dive too much

@yochananmarqos
Copy link

yochananmarqos commented Jan 20, 2021

I'm not sure what the point of this is. It's just a meta package, there's really no difference other than maybe the convenience of installing all of the optional plugins all at once.

@M0Rf30
Copy link
Contributor Author

M0Rf30 commented Jan 21, 2021

I'm not sure what the point of this is. It's just a meta package, there's really no difference other than maybe the convenience of installing all of the optional plugins all at once.

Sorry what do you mean for meta-package ? a meta-package is a package with no data in itself, that brings only other packages as dependencies (for example linux-tools-meta is a package with no data that install all the packages related to kernel management, only because of its related dependencies). Here we are not talking about meta-packages, but we are discussing about a rational splitting of dependencies (using splitted PKGBUILD in order to no install useless GTK stuff in a headless scenario. For instance these are my actual dependencies

Name            : gst-plugins-pulseeffects-git
Version         : 4.8.4.r85.gb773fad2-1
Description     : Audio Effects for Pulseaudio Applications - gstreamer plugins
Architecture    : aarch64
URL             : https://github.com/wwmm/pulseeffects
Licenses        : GPL3
Groups          : None
Provides        : gst-plugins-pulseeffects
Depends On      : gstreamer  gst-plugins-base  libebur128  librnnoise  libsndfile  libsamplerate  zita-convolver
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : gst-plugins-pulseeffects

compared to the official package

Name            : pulseeffects
Version         : 4.8.3-3
Description     : Audio Effects for Pulseaudio Applications
Architecture    : x86_64
URL             : https://github.com/wwmm/pulseeffects
Licenses        : GPL3
Groups          : None
Provides        : None
Depends On      : gtk3  gtkmm3  glibmm  libpulse  gstreamer  gst-plugin-gtk  gst-plugins-bad  lilv  boost-libs  libsigc++  libsndfile  libsamplerate
                  zita-convolver  libebur128  calf  lsp-plugins  yelp
Optional Deps   : zam-plugins: maximizer [installed]
                  rubberband: pitch shifting [installed]
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None

@yochananmarqos
Copy link

Nevermind me, I completely misunderstood. Carry on.

@wwmm
Copy link
Owner

wwmm commented Jan 23, 2021

libpulse can be removed from the dependencies list. And as this package is based on the master branch PipeWire should be a required dependency. It is also a good thing to make it conflict with Pulseaudio as they won't work together anyway. On Arch Linux a weird way to achieve that would be to add pipewire-pulse as dependency. We do not need it. But it will force Pulseaudio to be removed. And Pulseaudio's apps will need it anyway if PipeWire is used as server.

@wwmm
Copy link
Owner

wwmm commented Jan 23, 2021

That assuming that the purpose of the package is compiling the code from our master branch. If it is for the legacy Pulseaudio branch forget what I said.

@M0Rf30
Copy link
Contributor Author

M0Rf30 commented Jan 23, 2021

@wwmm according to me your idea is not weird. Looking at other packages, they declare a pulseaudio dependency because pipewire-pulse provides also pulseaudio definition (look at firefox PKGBUILD for example). That's because other apps maintain a sort of compatibility between them. And so pipewire-pulse should be the one that accomplishes this purpose for PulseEffects, if master is only compatible with pipewire. You will find a just up-to-date PKGBUILD in AUR, according to your suggestions :D

@wwmm
Copy link
Owner

wwmm commented Jan 23, 2021

if master is only compatible with pipewire

That is the case. On paper supporting both is possible. But as they do things in a very different way walking this path would add much more complexity to the code and take much more time to implement.

I said it is weird because usually we expect the software to use its dependencies. In that case is a hack. The only way to forbid the software to be installed when an incompatible server is present.

@yochananmarqos
Copy link

@M0Rf30 I followed your lead and created a legacy version: pulseeffects-legacy-git. I made some dependencies optional per @wwmm's PKGBUILD.

@M0Rf30
Copy link
Contributor Author

M0Rf30 commented Jan 23, 2021

@yochananmarqos good catch. You will find some humble suggestions in AUR for you. Do not take me too seriously, I am not a cynical person, and what I have told you (although it may sound aggressive) is for the simple purpose of improvement. I hope that also official package will follow our way. It's far way better, especially on Raspberry, without the need to install tons of GTK related dependencies.

@wwmm
Copy link
Owner

wwmm commented Jul 7, 2021

As EasyEffects 6.0.0 does not use GStreamer this is not necessary anymore.

@wwmm wwmm closed this as completed Jul 7, 2021
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

No branches or pull requests

3 participants