--- layout: post title: Backporting Pipewire in Devuan date: 2022-04-03 17:45 +0200 category: tech language: en --- Ever since I heard about Pipewire and used it in a VM (Fedora) I was sad I couldn't have it on my Devuan system. Audio quality over Bluetooth was much better than in Pulseaudio. (That is, HSP/HFP - so for recording and voice chats). Devuan Beowulf didn't have it at all. Since the update to Chimaera, I could install it. Took some fiddling around to start the service, since I use Devuan specifically to not have to deal with systemd. - However, it needs to be run for the user. Thanks to [this issue](https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1135), I created launchers to start the server in a session. I only had to adapt the launchers to not use the `-B` switch, which strangely wasn't present in the daemon binary in Devuan. (missing elogind support?). Now, it kinda worked, but Pipewire (?) would only offer either one of the HSP/HFP or A2DP profile - chosen randomly. From some research it seemed this might be a Pipewire bug, fixed in newer versions. So I had to, yet again, look into backporting and the - in my opinion - mess of Debian packaging tools. I ended up using cowbuilder / pbuilder, as suggested by [BuildingFormalBackports](https://wiki.debian.org/BuildingFormalBackports) on the Debian wiki. So, this ended up being my `.pbuilderrc`: DISTRIBUTION=chimaera BASEPATH=/var/cache/pbuilder/base.cow BINDMOUNTS=/var/local/repo-backports OTHERMIRROR="deb http://deb.devuan.org/merged chimaera-backports main contrib non-free|deb [trusted=yes] file:///var/local/repo-backports ./" I had to backport `libfreeaptx0` first. Then I had to make two small changes in the pipewire source package. Namely, I edited the meson build script, because it kept failing because it couldn't find systemd and libxfixes, although these were set as "required" by "options", which were set to "auto". Searching around the internet, this might be a bug in meson??? - Not sure. I edited the `meson.build` directly and set required to `false`. I have no experience with meson whatsoever. Maybe I should've edited meson_options.txt instead? Patches applied: ```diff --- pipewire-0.3.49.orig/meson.build +++ pipewire-0.3.49/meson.build @@ -280,7 +280,7 @@ x11_dep = dependency('x11-xcb', required summary({'X11 (x11-bell)': x11_dep.found()}, bool_yn: true, section: 'Misc dependencies') -xfixes_dep = dependency('xfixes', required : get_option('x11-xfixes'), version: '>= 6') +xfixes_dep = dependency('xfixes', required : false, version: '>= 6') cdata.set('HAVE_XFIXES_6', xfixes_dep.found()) canberra_dep = dependency('libcanberra', required : get_option('libcanberra')) ``` and ```diff --- pipewire-0.3.49.orig/meson.build +++ pipewire-0.3.49/meson.build @@ -224,8 +224,8 @@ endforeach cdata.set('HAVE_PIDFD_OPEN', cc.get_define('SYS_pidfd_open', prefix: '#include ') != '') -systemd = dependency('systemd', required: get_option('systemd')) -systemd_dep = dependency('libsystemd',required: get_option('systemd')) +systemd = dependency('systemd', required: false) +systemd_dep = dependency('libsystemd',required: false) summary({'systemd conf data': systemd.found()}, bool_yn: true) summary({'libsystemd': systemd_dep.found()}, bool_yn: true) cdata.set('HAVE_SYSTEMD', systemd.found() and systemd_dep.found()) ``` With that, pbuilder / cowbuilder ran successfully. And now I enjoy my latest Pipewire version. :)