summaryrefslogtreecommitdiff
path: root/_posts/2022-04-03-backporting-pipewire-in-devuan.md
blob: 0a347b21fa63a2a6868d8e52b135209683f622cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
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 <sys/syscall.h>') != '')
 
-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. :)