Using Pipewire instead of Pulseaudio in Slackware 15
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If pipewire's jack libraries are linked correctly, and the pipewire daemons are already running, then when you start up qjackctl it will show that a jack server is already running. You should be able to manage connections here. You cannot set the sample rate and buffer settings with qjackctl anymore, because that is now a pipewire.conf file setting. In other words, qjackctl should start and connect fine, just some jack specific things will not work, due to there actually being a pipewire server running, with its own config file setup.
Has qjackctl not become (mostly) redundant if the jack-server is already running and pipewire runs the configs? Only useful stuff would then be the patchbay/graph? (What could be a good replacement for this? Should one use https://gitlab.freedesktop.org/ryuukyu/helvum/ ?)
Without adding the links this is the error I get when running qjackctl
(on a ld-config based install with -Djack=enabled \ -Dpipewire-jack=enabled built pipewire; see attached outputs)
Quote:
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Also, is an /etc/security/audio.conf needed as described in https://jackaudio.org/faq/linux_rt_config.html for real-time to work?
That seems redundant on Slackware with the setcap.sh in the current build scripts; or am I mistaken? (see www.slackbuilds.org/caps/ )
But this setcap.sh is absent from pipewire; so if that takes over jack.... do we lose real time?
EDIT: helvum atm only seems to create an image, didn't get the ability to reroute connections
Up until now there hasn't been any convenient tool to route connections with pipewire. Pipewire implements a "jack server", so the existing tools for managing the graph with jack are still used. i.e. 'qjackctl' or 'catia'. These are programs made for jack, so they may have some options that dont get used with pipewire. E.g. starting qjackctl with jack dbus options enabled causes a spew of errors in qjackctl at startup if you're actually using pipewire-jack.
I'm curious to see what this wireplumber is about, and if its going to provide a means to control pipewire with its own graph. For now I just use qjackctl for its graph when running pipewire-jack. Going to check out that video marav posted later to see what wireplumber brings though
For realtime priority pipewire was using 'rtkit' which is a priority granting daemon that runs on the system dbus. Lately they added another option to run without rtkit so I've just been running that. So far its been fine running at 256/48000Hz buffer size which is decent for playing guiter with live monitoring. You can find settings for that in the /usr/share/pipewire/pipewire.conf file from the latest pipewire package in current.
I still have the pam limits.conf file set up for the audio group though. I play around with using pipewire-jack on a DAW iso from alienbob so that pam limits file setup is already in place. I'm happy with the performance so I haven't changed that.
Just for you guys know, I tried qjackctl 0.9.5 using SBo script and when I start, it can't connect to jack.
I then change the script to configure using cmake instead of autotools, and it start working again.
Since qjackctl got some changes to be built against Qt6 maybe is something missing using autotools.
Just for you guys know, I tried qjackctl 0.9.5 using SBo script and when I start, it can't connect to jack.
I then change the script to configure using cmake instead of autotools, and it start working again.
Since qjackctl got some changes to be built against Qt6 maybe is something missing using autotools.
Fab, that cmake blurb did the trick for me ;-) (I had tried 0.9.5 built with the current SBo-script when talking about qjacktl)
BTW have been trying raysession (https://github.com/Houston4444/RaySession), looks very nice as a session manager and can be built on current (clone the master, though otherwise it crashes on current with float-errors)
$ meson setup -Dsystemd=disabled -Dsystemd-user-service=false --prefix=/usr build
$ meson compile -C build <--- here it stops at my end
$ ninja -C build install
Quote:
--extra-library=girepository-1.0 --sources-top-dirs /home/sbo_64/music-recording-play/pipewire/wireplumber/wireplumber-0.4.4/subprojects/ --sources-top-dirs /home/sbo_64/music-recording-play/pipewire/wireplumber/wireplumber-0.4.4/build/subprojects/
input buffer overflow, can't enlarge buffer because scanner uses REJECT
[168/190] Generating doc with a custom command
../NEWS.rst:29: WARNING: Bullet list ends without a blank line; unexpected unindent.
/home/sbo_64/music-recording-play/pipewire/wireplumber/wireplumber-0.4.4/docs/rst/lua_api/lua_proxies_api.rst:33: WARNING: undefined label: lua_spa_pod
ninja: build stopped: subcommand failed.
bash-5.1$
(adding -Ddoc=disabled, did not make it better). What's going on, never saw something like this...
wireplumber 0.4.4
Lua version : 5.4.3 (built-in)
systemd conf data : NO
libsystemd : NO
libelogind : YES
For documentation
Python 3 Sphinx related modules: NO
Doxygen : YES
sphinx-build : NO
For introspection
Python 3 lxml module : NO
Doxygen : YES
g-ir-scanner : YES
Subprojects
lua : YES
Found ninja-1.10.2 at /usr/bin/ninja
In wireplumber we have an intermediate python script that parses the XML generated from doxygen and generates some intermediate header file that the gobject-introspection-scanner can parse. This python script uses a python module that uses libxml, which is the broken piece in the chain.
There are 2 solutions:
1. patch libxml with the upstream fix
2. compile wireplumber with `-Ddoc=disabled -Dintrospection=disabled`
Now that Pat has included the daemon package for what will become Slackware 15, I'll note here what is needed in order to use Pipewire instead of Pulseaudio. The original post is here and was provided by ZhaoLin1457. I'm just putting the details of that post here for better visibility.
First, you will need add the following 3 desktop files in:
Code:
/etc/xdg/autostart
pipewire.desktop
Code:
[Desktop Entry]
Version=1.0
Name=PipeWire Media System
Comment=Start the PipeWire Media System
Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire /usr/bin/pipewire
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Initialization
X-KDE-autostart-phase=1
I modified LuckyCyborg's daemon SlackBuild to include these files along the changes needed for pulse.
SlackBuild:
Code:
#!/bin/bash
# Copyright 2005-2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=daemon
VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
BUILD=${BUILD:-1}
NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$(uname -m)" in
i?86) ARCH=i586 ;;
arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$(uname -m) ;;
esac
export ARCH
fi
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz"
exit 0
fi
TMP=${TMP:-/tmp}
PKG=$TMP/package-$PKGNAM
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
elif [ "$ARCH" = "armv7hl" ]; then
SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16"
else
SLKCFLAGS="-O2"
fi
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
rm -rf $PKGNAM-$VERSION
tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1
cd $PKGNAM-$VERSION || exit 1
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
./configure \
--prefix=/usr \
--enable-logind
make $NUMJOBS CFLAGS="$SLKCFLAGS" || exit 1
make install DESTDIR=$PKG || exit 1
make install-daemon-conf DESTDIR=$PKG || exit 1
make install-daemon-html DESTDIR=$PKG DAEMON_HTMLDIR=/usr/doc/$PKGNAM-$VERSION || exit 1
mv $PKG/etc/daemon.conf $PKG/etc/daemon.conf.new
mkdir -p $PKG/etc/xdg/autostart
mkdir -p $PKG/etc/pulse
cp -a $CWD/pipewire-media-session.desktop $PKG/etc/xdg/autostart/pipewire-media-session.desktop.new
cp -a $CWD/pipewire-pulse.desktop $PKG/etc/xdg/autostart/pipewire-pulse.desktop.new
cp -a $CWD/pipewire.desktop $PKG/etc/xdg/autostart/pipewire.desktop.new
cp -a $CWD/client.conf $PKG/etc/pulse/client.conf.new
mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
COPYING* INSTALL LICENSE README* REFERENCES \
$PKG/usr/doc/$PKGNAM-$VERSION
# If there's a CHANGELOG, installing at least part of the recent history
# is useful, but don't let it get totally out of control:
if [ -r CHANGELOG ]; then
DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION)
cat CHANGELOG | head -n 1000 > $DOCSDIR/CHANGELOG
touch -r CHANGELOG $DOCSDIR/CHANGELOG
fi
mkdir -p $PKG/install
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cat $CWD/slack-desc > $PKG/install/slack-desc
# Build the package:
cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz
doinst.sh
Code:
#!/bin/sh
config() {
NEW="$1"
OLD="`dirname $NEW`/`basename $NEW .new`"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...
}
config etc/daemon.conf.new
config etc/xdg/autostart/pipewire-media-session.desktop.new
config etc/xdg/autostart/pipewire-pulse.desktop.new
config etc/xdg/autostart/pipewire.desktop.new
config etc/pulse/client.conf.new
I can upload the full SlackBuild if anyone is interested. Just make sure that the desktop files and the client.conf file exist in the directory where your SBo file lies.
So far, I haven't ran into any issues. I haven't tested Bluetooth yet. Hopefully this tutorial will help you getting Pipewire going. Thanks to Pat for including this package; ZhaoLin1457 for his amazing work and LuckyCyborg for providing the SBo.
Well, this daemon supervisor is now part of Slackware -current, but probably would be nice to have it available for 14.2 via SBo, thought...
And honestly, it's right on a daemon supervisor, designed to work with the init scripts - it's not related to PipeWire at all.
BUT, it's developer added (on request) a feature which is really useful for us to handle the PipeWire daemons on user side: the ability to auto-quit on user logout.
However, even this particular feature added kindly at our request, has nothing to do with PipeWire. As well, you can control this way any daemons supposed to be controlled on the user side. e.g. a VPN service.
That's WHY I wonder if it's good to promote this mix of daemon supervisor with the PipeWire controls...
Rather, how about a package which ships those XDG autostart files and installation/uninstallation scripts to switch forth or back the PulseAudio setup and its autostart file?
BUT, probably the best would be to have a split of PulseAudio package on client libraries and tools, and a separate server package, e.g pulseaudio-server, which later could be not installed or blacklisted.
Last edited by LuckyCyborg; 11-10-2021 at 05:27 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.