Using Pipewire instead of Pulseaudio in Slackware 15
by stormtracknole from LinuxQuestions.org on (#5GTJW)
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/autostartpipewire.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=1pipewire-pulse.desktop
Code:[Desktop Entry]
Version=1.0
Name=PipeWire Pulse
Comment=Start the PipeWire Pulse
Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-pulse /usr/bin/pipewire-pulse
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Initialization
X-KDE-autostart-phase=1pipewire-media-session.desktop
Code:[Desktop Entry]
Version=1.0
Name=PipeWire Media Session
Comment=Start the PipeWire Media Session
Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-media-session /usr/bin/pipewire-media-session
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Initialization
X-KDE-autostart-phase=1Then, you need to edit:
Code:/etc/pulse/client.confand change:
Code:autospawn = yesto
Code:autospawn = noRemove, or place:
Code:/etc/xdg/autostart/pulseaudio.desktopin a backup directory somewhere else. Thanks to LuckyCyborg for this suggestion.
Log out and log back in. You should now see pipewire running:
Code:ps -ef | grep pipewire
stormtracknole 1833 1 0 07:34 ? 00:00:00 /usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-media-session /usr/bin/pipewire-media-session
stormtracknole 1856 1 0 07:34 ? 00:00:00 /usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-pulse /usr/bin/pipewire-pulse
stormtracknole 1865 1856 0 07:34 ? 00:00:07 pipewire-pulse: /usr/bin/pipewire-pulse
angel 1879 1 0 07:34 ? 00:00:00 /usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire /usr/bin/pipewire
stormtracknole 1881 1833 0 07:34 ? 00:00:00 pipewire-media-session: /usr/bin/pipewire-media-session
stormtracknole 1882 1879 0 07:34 ? 00:00:05 pipewire: /usr/bin/pipewire
stormtracknole 4442 4345 0 08:04 pts/3 00:00:00 grep --color pipewireI 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.txzdoinst.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.newI 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.


First, you will need add the following 3 desktop files in:
Code:/etc/xdg/autostartpipewire.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=1pipewire-pulse.desktop
Code:[Desktop Entry]
Version=1.0
Name=PipeWire Pulse
Comment=Start the PipeWire Pulse
Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-pulse /usr/bin/pipewire-pulse
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Initialization
X-KDE-autostart-phase=1pipewire-media-session.desktop
Code:[Desktop Entry]
Version=1.0
Name=PipeWire Media Session
Comment=Start the PipeWire Media Session
Exec=/usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-media-session /usr/bin/pipewire-media-session
Terminal=false
Type=Application
X-GNOME-Autostart-Phase=Initialization
X-KDE-autostart-phase=1Then, you need to edit:
Code:/etc/pulse/client.confand change:
Code:autospawn = yesto
Code:autospawn = noRemove, or place:
Code:/etc/xdg/autostart/pulseaudio.desktopin a backup directory somewhere else. Thanks to LuckyCyborg for this suggestion.
Log out and log back in. You should now see pipewire running:
Code:ps -ef | grep pipewire
stormtracknole 1833 1 0 07:34 ? 00:00:00 /usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-media-session /usr/bin/pipewire-media-session
stormtracknole 1856 1 0 07:34 ? 00:00:00 /usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire-pulse /usr/bin/pipewire-pulse
stormtracknole 1865 1856 0 07:34 ? 00:00:07 pipewire-pulse: /usr/bin/pipewire-pulse
angel 1879 1 0 07:34 ? 00:00:00 /usr/bin/daemon -frB --pidfiles=~/.run --name=pipewire /usr/bin/pipewire
stormtracknole 1881 1833 0 07:34 ? 00:00:00 pipewire-media-session: /usr/bin/pipewire-media-session
stormtracknole 1882 1879 0 07:34 ? 00:00:05 pipewire: /usr/bin/pipewire
stormtracknole 4442 4345 0 08:04 pts/3 00:00:00 grep --color pipewireI 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.txzdoinst.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.newI 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.