1

I need a newer version of Pipewire (>= 1.0.2) on my RPi 4 than is shipped with the current stable RaspberryPi OS (Pipewire 0.3). I looked at Debian's Bookworm backports and voilà, there is Pipewire 1.0.3 there! So I added the backports repo to my sources.list:

 $ cat /etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-backports main contrib non-free

However, trying to install Pipewire now isn't working:

$ sudo apt install pipewire
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: libpipewire-0.3-modules : Depends: libpipewire-0.3-0 (= 0.3.65-3+rpt6+deb12u1) but 1.0.3-1~bpo12+1 is to be installed pipewire : Depends: pipewire-bin (= 0.3.65-3+rpt6+deb12u1) E: Unable to correct problems, you have held broken packages.

I'm no Debian expert, I can't tell if this method should work in RPi-OS or not: Can anyone suggest how to resolve the dependency problem?

EDIT: Explanation why I'm trying to do this: I wanted to install Pipewire for streaming audio to my RPi 4 (it runs the headless RPi OS Lite, which only comes with bare ALSA). To do this, I wanted to use Roc. The Debian repo version of Pipewire doesn't include the Roc modules - hence to get them, one needs to compile Pipewire from Git source, where it does have the Roc modules, which can then be copied into the system. However, attempting this compilation, I ran into a dependency problem where the Pipewire version >= 1.0.2 is requested, but 0.3 is installed (don't ask me why the compiler routine wants Pipewire installed in order to compile Pipewire, I don't know and I don't understand!). The two routes to go for obtaining a more recent version in this case are to a) add the Pipewire PPA for Debian to your sources or b) try the backports package, which I attempted here...

EDIT2: after tinkering more and unsuccessfully with compilation, I ended up using route a) to get a newer version of Pipewire (also several caveats here), but ditching Roc in favor of RTP. However, the compilation instructions presented here by Goldilocks may still work.

Bennypr0fane
  • 113
  • 4

1 Answers1

2

You should be able to build it from source easily enough -- in any case it is not a big deal to attempt.

Using a Pi 5 running 64-bit bookworm, I downloaded the current git repo (nb. you can do the build without privileges if you use a directory you have permissions on):

> git clone https://gitlab.freedesktop.org/pipewire/pipewire.git

This creates a pipewire directory of ~30 MiB; after the build it will be ~200 MiB. You can view the repo in a browser; I followed the directions in the INSTALL.md file.

The default "master" branch is actually v1.0.0. To use 1.0.4:

> cd pipewire
> git checkout 1.0.4

Before you do anything else you'll need meson installed; after that you'll need the C compiler if you haven't used it on your system before:

> sudo apt install gcc meson

The first time you run meson setup builddir you'll probably end up with a number of missing development package dependencies; the basic meson output doesn't make it clear what the exact debian package name would be, so to save you a bit of time:

> sudo apt install libsdl2-dev libdrm-dev libopus-dev \
  libsndfile1-dev libmysofa-dev libpulse-dev libavahi-client-dev \
  libx11-xcb-dev libxfixes-dev libcanberra-dev libusb-1.0-0-dev \
  libcap-dev libglib2.0-dev libncurses-dev libreadline-dev

This looks like a lot but it really isn't; the total download will probably be ~250 MiB. If there's more missing that you can't figure out the package for, leave a comment here.

After that run meson setup builddir; if everything is good the output should end with:

Found ninja-1.11.1 at /usr/bin/ninja 

That was installed as a meson dependency, I think. Anyway, now you can try:

> meson configure builddir

You'll probably want to read that INSTALL.md file about this and poke around -- I didn't do anything, ie., used the defaults.1 Then:

> meson compile -C builddir

On the Pi 5, this took about ~5 min; it only has an undersized heat sink in a ventilated case w/ no fan, so was throttled most of the time. As a casual observation, I'd say it takes maybe 50-100% longer to compile stuff on a Pi 4 (the OS is of course the same).

This is a headless system and I have no need for pipewire on it, so I did not install but did try the test under Running in INSTALL.md and there were some issues logged, eg.:

[E][81363.756198] spa.alsa     | [      alsa-pcm.c:  972 spa_alsa_open()] 'hw:1,0': playback open failed: No such file or directory
[W][81363.756242] mod.adapter  | [       adapter.c:  114 find_format()] 0x5556604e23d0: can't get format: No such file or directory
[E][81363.756270] mod.adapter  | [module-adapter.c:  267 create_object()] usage: node.name=<string> 
N 10:39:34.395149          wp-device ../subprojects/wireplumber/lib/wp/device.c:619:wp_spa_device_new_from_spa_factory: SPA handle 'api.bluez5.enum.dbus' could not be loaded; is it installed?
N 10:39:34.395173         s-monitors bluez.lua:390:createMonitor: PipeWire's BlueZ SPA plugin is missing or broken. Bluetooth devices will not be supported.

I'm not sure how significant they are, keeping in mind the context (explained in Running using a canned environment) and that the system wasn't being used for A/V stuff.

But: the daemon did start up and continue running, so this is at least worth a try. Here's output from the executable produced in builddir/src/daemon:

> ./pipewire --version
./pipewire
Compiled with libpipewire 1.0.4
Linked with libpipewire 1.0.4

>ldd pipewire linux-vdso.so.1 (0x00007fff47ac0000) libpipewire-0.3.so.0 => /usr/local/src/pipewire/builddir/src/daemon/./../pipewire/libpipewire-0.3.so.0 (0x00007fff47950000) libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x00007fff47780000) /lib/ld-linux-aarch64.so.1 (0x00007fff47a88000)

Notice that the 1.0.4 executable reports itself as "Linked with libpipewire 1.0.4" but the actual shared library file (in the ldd output) is 0.3. What exactly "libpipewire" refers to seems a bit context dependent (which isn't unusual).

Here's the one that's installed by default on bookworm:

> pipewire --version
pipewire
Compiled with libpipewire 0.3.65
Linked with libpipewire 0.3.65

After all this the final install (you'll want to use sudo for that) should be pretty simple.


  1. Note that I'm not actually a pipewire user, I just thought it should be available and that it would not take me too much time to explain. Actually perusing the meson config stuff might provide a way to fix some of the problems mentioned at the end here if necessary -- however, for your first attempt don't bother, just try this as is to see if it builds and works for you. To undo/redo the build, from the top level of the git directory (there may be a better way, I'm not much of a meson user either):

     git reset --hard
    

    Then start again; running the install multiple times should replace the stuff from last time.

goldilocks
  • 58,849
  • 17
  • 112
  • 227
  • Compiling it from source is exactly what I tried before turning to backports, and it's what got me into this pickle in the first place: https://www.reddit.com/r/linuxaudio/comments/1bn0856/comment/kx1jl7k/ I followed the build instructions here: https://gavv.net/articles/roc-tutorial-0.2/ I can't finish the compilation bcs of a dependency issue: `wireplumber| Dependency libpipewire-0.3 found: NO found 0.3.65 but need: '>= 1.0.2' (overridden) – Bennypr0fane Mar 29 '24 at 19:43
  • Wouldn't it be better to just resolve the dependencies and go with the backports version? – Bennypr0fane Mar 29 '24 at 20:20
  • 1
    Not IMO. This actually worked, probably because I was following the instructions from the source package as opposed to a third party blog post. The people who write the latter do not really have any particular reason to keep their posts up-to-date, etc., or to double check it in the first place, etc. It may be great advice or it may not. – goldilocks Mar 29 '24 at 20:50
  • 1
    I think there is something wrong with that backport package, or something, though; there is no libpipewire-1.x proper. Pipewire 1.0.4 (which is the latest) builds libpipewire-0.3 -- it's the executable that's version 1.x. I've edited some output from the build in near the end of this answer to try and illustrate that. Possibly someone somewhere has gotten confused WRT something that is, to be fair, somewhat confusing. – goldilocks Mar 29 '24 at 20:52
  • I tried adding the Pipewire PPA for Debian which is a whole other kind of confusing (it says Debian on the package and Ubuntu on the inside). This hasn't gotten me what I wanted, but I now have a recent version of Pipewire installed, so I won't try to compile it from source anymore. The person who wrote that blogpost claims to be one of the authors of Roc, which I wanted to use here to stream audio to the RPi. So I followed their instructions - they include how to get Roc modules for Pipewire. However there are a lot of things wrong with that too, so I'll avoid Roc for now. – Bennypr0fane Mar 29 '24 at 22:45