diff mbox series

[bug#54379] gnu: linux: update PipeWire & WirePlumber

Message ID 1926705393.215334.1647246338511@office.mailbox.org
State New
Headers show
Series [bug#54379] gnu: linux: update PipeWire & WirePlumber | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Brendan Tildesley March 14, 2022, 8:25 a.m. UTC
If you are updating pipewire, I'd like to add to it:

1. The attached libfreeatpx patch, or perhaps an improved patch. maybe one could expand on the description.

2. Add the following dependencies to inputs:
libfdk for ACC support over bluetooth
libfreeaptx for aptX support over bluetooth
libsndfile
libusb for bluetooth support
lilv for lv2 plugins
webrtc-audio-processing for noise cancelling
readline for pw-cli

3. Consider renaming pipewire-0.3 to pipewire and pipewire to pipewire-0.2 to keep pipewire as the latest.
pipewire 0.2 is only needed by weston 9. weston 10 can use 0.3, but i was getting compilation errors.

Comments

Kevin Boulain March 14, 2022, 11:06 p.m. UTC | #1
On Mon, 14 Mar 2022 at 09:25, Brendan Tildesley <mail@brendan.scot> wrote:
>
> If you are updating pipewire, I'd like to add to it:
>
> 1. The attached libfreeatpx patch, or perhaps an improved patch. maybe one could expand on the description.

It's very similar to what I've done locally. I decided to not include
libfreeaptx in the first patch, even though I confirm it worked for me
and I was able to use the aptX codec, because other distributions like
Fedora (https://bugzilla.redhat.com/show_bug.cgi?id=1908922) or
OpenSUSE (https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/message/E4POCRFIANNJPIXT4QYI245O3RSPVBW3/)
have decided not too. Interestingly Debian includes it in its main
repository (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995607).
I'm not sure of the legality of all that, even if the patents appear
to have expired, I'm sure someone must know better than me (is there a
contact point in Guix or GNU?).

> 2. Add the following dependencies to inputs:
> libfdk for ACC support over bluetooth

The AAC codec is already supported and included in the patch I
submitted (libfdk was added to the inputs), the build system picked it
up (but I can't test the codec).

> libfreeaptx for aptX support over bluetooth

See above.

> libsndfile

Already done in the patch, I confirm I could pw-record and pw-play
(symlinks to pw-cat).

> libusb for bluetooth support
> lilv for lv2 plugins
> webrtc-audio-processing for noise cancelling
> readline for pw-cli

Good point, I'll send an updated patch (I can't test them all but they
were recognised during the configure).

> 3. Consider renaming pipewire-0.3 to pipewire and pipewire to pipewire-0.2 to keep pipewire as the latest.
> pipewire 0.2 is only needed by weston 9. weston 10 can use 0.3, but i was getting compilation errors.

It was also bothering me a bit. Don't mind if I do :)
Brendan Tildesley March 30, 2022, 1:01 a.m. UTC | #2
Just two more things if you wouldn't mind.

1. Add "-Dsysconfdir=/etc" to configure-flags so /etc/pipewire is used 
instead of the output store path.

2. Remove sdl2 from inputs because it is only used to build examples.


There are also other misc things like raop, roc, libcanberra if you care 
to look in to what they do
fesoj000 March 30, 2022, 4:23 a.m. UTC | #3
On 3/30/22 3:01 AM, Brendan Tildesley wrote:
> 1. Add "-Dsysconfdir=/etc" to configure-flags so /etc/pipewire is used instead of the output store path.
How do you use pipewire? The store output configuration is the package default. If you need some special
settings you can use "~/.config/pipewire/" to overwrite the settings you want to change.

So far it was perfect to have the immutable default config in the store and reference it for your own
settings. Especially after a breaking change in pipewire, this immutable config in the store path can be
very valuable to get a working setup again.

I do not care what the default config directory is, but i would like to keep the default config as part
of the package.

BR
Kevin Boulain March 30, 2022, 7:14 p.m. UTC | #4
On Wed, 30 Mar 2022 at 06:22, fesoj000 <fesoj000@gmail.com> wrote:
> On 3/30/22 3:01 AM, Brendan Tildesley wrote:
> > 1. Add "-Dsysconfdir=/etc" to configure-flags so /etc/pipewire is used instead of the output store path.
> How do you use pipewire? The store output configuration is the package default. If you need some special
> settings you can use "~/.config/pipewire/" to overwrite the settings you want to change.

I agree with the sentiment: it appears to be recommended to run
PipeWire as a user so I'm not quite sure what this will give (besides
making it easier to share the configuration between multiple users,
which is a valid goal).
Just copying (parts of) the standard configuration to ~/.config is
enough to override it.

> > 2. Remove sdl2 from inputs because it is only used to build examples.

Done. I feared it would break pipewire@0.2 (it was much more used
then) but it builds.

> > There are also other misc things like raop, roc, libcanberra if you care
> > to look in to what they do

I've added OpenSSL to build raop (apparently it's for AirPlay). For
the rest, see the next patch email.
Also, new minor versions of PipeWire and WirePlumber have been
released so I've updated the patch to reflect that.
Brendan Tildesley March 31, 2022, 5:40 a.m. UTC | #5
On 30/3/22 14:23, fesoj000 wrote:
> On 3/30/22 3:01 AM, Brendan Tildesley wrote:
>> 1. Add "-Dsysconfdir=/etc" to configure-flags so /etc/pipewire is 
>> used instead of the output store path.
> How do you use pipewire? The store output configuration is the package 
> default. If you need some special
> settings you can use "~/.config/pipewire/" to overwrite the settings 
> you want to change.
>
I set PIPEWIRE_CONFIG_DIR=/etc/pipewire in /etc/environment and made etc 
services to symink all the config
files there. but I think i will get rid of that in favour of sysconfdir.
> So far it was perfect to have the immutable default config in the 
> store and reference it for your own
> settings. Especially after a breaking change in pipewire, this 
> immutable config in the store path can be
> very valuable to get a working setup again.
>
> I do not care what the default config directory is, but i would like 
> to keep the default config as part
> of the package.
>
> BR
You don't need to worry about that because the default config is in 
share/ not etc/. There is nothing in the etc/ besides ld.so.cache

This is how pipewire accesses config without sysconfigdir set:

b@jiu ~/code/guix [env]$ strace 
/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/bin/pipewire 
2>&1|rg '^access'
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or 
directory)
access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No 
such file or directory)
access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No 
such file or directory)
access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/etc/pipewire/pipewire.conf", 
R_OK) = -1 ENOENT (No such file or directory)
access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/share/pipewire/pipewire.conf", 
R_OK) = 0
access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/share/pipewire/pipewire.conf.d", 
R_OK) = -1 ENOENT (No such file or directory)
access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/etc/pipewire/pipewire.conf.d", 
R_OK) = -1 ENOENT (No such file or directory)
access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No 
such file or directory)
access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No 
such file or directory)

setting it just makes it do this:

b@jiu ~ [env]$ strace pipewire 2>&1|grep '^access'
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or 
directory)
access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No 
such file or directory)
access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No 
such file or directory)
access("/etc/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No such file or 
directory)
access("/gnu/store/p7wpq9axacrzk43whbvg6r4f3v0bkyvz-pipewire-0.3.48/share/pipewire/pipewire.conf", 
R_OK) = 0
access("/gnu/store/p7wpq9axacrzk43whbvg6r4f3v0bkyvz-pipewire-0.3.48/share/pipewire/pipewire.conf.d", 
R_OK) = -1 ENOENT (No such file or directory)
access("/etc/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file 
or directory)
access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No 
such file or directory)
access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No 
such file or directory)

So it allows for global config to be set in /etc without 
PIPEWIRE_CONFIG_DIR. Note that PIPEWIRE_CONFIG_DIR isn't practical as a 
default

because it sets the /only/ config dir and prevents any lookup in home 
.config.
Brendan Tildesley March 31, 2022, 8:27 a.m. UTC | #6
Would you mind testing 0ad with pipewire? I'm finding I get no audio and 
it says "no audio device found" after taking 30 seconds to load.
fesoj000 April 1, 2022, 12:46 p.m. UTC | #7
On 3/31/22 7:40 AM, Brendan Tildesley wrote:
>> So far it was perfect to have the immutable default config in the store and reference it for your own
>> settings. Especially after a breaking change in pipewire, this immutable config in the store path can be
>> very valuable to get a working setup again.
>>
>> I do not care what the default config directory is, but i would like to keep the default config as part
>> of the package.
>>
>> BR
> You don't need to worry about that because the default config is in share/ not etc/. There is nothing in the etc/ besides ld.so.cache
> 
> This is how pipewire accesses config without sysconfigdir set:
> 
> b@jiu ~/code/guix [env]$ strace /gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/bin/pipewire 2>&1|rg '^access'
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No such file or directory)
> access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/etc/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No such file or directory)
> access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/share/pipewire/pipewire.conf", R_OK) = 0
> access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/share/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> access("/gnu/store/kvyhx5i5a6i63iihp20wj3yikhvf4si7-pipewire-0.3.48/etc/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> 
> setting it just makes it do this:
> 
> b@jiu ~ [env]$ strace pipewire 2>&1|grep '^access'
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No such file or directory)
> access("/etc/pipewire/pipewire.conf", R_OK) = -1 ENOENT (No such file or directory)
> access("/gnu/store/p7wpq9axacrzk43whbvg6r4f3v0bkyvz-pipewire-0.3.48/share/pipewire/pipewire.conf", R_OK) = 0
> access("/gnu/store/p7wpq9axacrzk43whbvg6r4f3v0bkyvz-pipewire-0.3.48/share/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> access("/etc/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> access("/home/b/.config/pipewire/pipewire.conf.d", R_OK) = -1 ENOENT (No such file or directory)
> 
> So it allows for global config to be set in /etc without PIPEWIRE_CONFIG_DIR. Note that PIPEWIRE_CONFIG_DIR isn't practical as a default
> 
> because it sets the /only/ config dir and prevents any lookup in home .config.
OK, that make sense.
Kevin Boulain April 1, 2022, 7:32 p.m. UTC | #8
On Thu, 31 Mar 2022 at 07:40, Brendan Tildesley <mail@brendan.scot> wrote:
> [...]
> So it allows for global config to be set in /etc without
> PIPEWIRE_CONFIG_DIR. Note that PIPEWIRE_CONFIG_DIR isn't practical as a
> default
>
> because it sets the /only/ config dir and prevents any lookup in home
> .config.

Makes sense, thanks. I did it for both PipeWire and WirePlumber, both
seem to try ~/.config, /etc and share/.

On Thu, 31 Mar 2022 at 10:27, Brendan Tildesley <mail@brendan.scot> wrote:
> Would you mind testing 0ad with pipewire? I'm finding I get no audio and
> it says "no audio device found" after taking 30 seconds to load.

I guix installed it and got music in the menu (over Bluetooth, with
aptX). I'm not doing anything special (a single edit to
30-bluez-monitor.lua in ~/.config), I'm only inheriting from the
PipeWire and WirePlumber packages to get support for aptX and
installing/running them via Guix home (currently ./pre-inst-env guix
home reconfigure, my configuration is there if that matters:
https://github.com/ether42/dotfiles/blob/guix/guix/my/home/desktop.scm#L66).
diff mbox series

Patch

From a3c7a4a7ec34eeae57deb76033e7e6224760b7f5 Mon Sep 17 00:00:00 2001
From: Brendan Tildesley <mail@brendan.scot>
Date: Sat, 12 Mar 2022 20:09:17 +1100
Subject: [PATCH] gnu: Add libfreeaptx.

* gnu/packages/audio.scm (libfreeaptx): New variable.
---
 gnu/packages/audio.scm | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 13e0f02837..ae93097354 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -17,7 +17,7 @@ 
 ;;; Copyright © 2018, 2019 Marius Bakke <mbakke@fastmail.com>
 ;;; Copyright © 2018, 2021 Thorsten Wilms <t_w_@freenet.de>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
+;;; Copyright © 2018, 2022 Brendan Tildesley <mail@brendan.scot>
 ;;; Copyright © 2019, 2021 Pierre Langlois <pierre.langlois@gmx.com>
 ;;; Copyright © 2019, 2021 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2019 Rutger Helling <rhelling@mykolab.com>
@@ -4686,6 +4686,36 @@  (define-public libfdk
     (license (license:fsf-free "https://github.com/mstorsjo/fdk-aac/blob/master/NOTICE"
                                "https://www.gnu.org/licenses/license-list.html#fdk"))))
 
+(define-public libfreeaptx
+  (package
+    (name "libfreeaptx")
+    (version "0.1.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/iamthehorker/libfreeaptx")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1fm5041nd08yzg0m9474g0943lb3x54zmn59b53nhvxan8x22ibq"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:tests? #f
+           #:make-flags
+           #~(list
+              (string-append "DESTDIR=" #$output)
+              "PREFIX="
+              (string-append "LDFLAGS=" "-Wl,-rpath=" #$output "/lib")
+              (string-append "CC=" #$(cc-for-target)))
+           #:phases
+           #~(modify-phases %standard-phases
+               (delete 'configure))))
+    (home-page "https://github.com/iamthehorker/libfreeaptx")
+    (synopsis "aptX codec library")
+    (description "Implementation of the aptX and aptX ND codecs.")
+    (license license:lgpl2.1+)))
+
 (define-public libopenshot-audio
   (package
     (name "libopenshot-audio")
-- 
2.34.0