The officially official Devuan Forum!

You are not logged in.

#1 2021-10-23 03:01:28

kiwi
Member
Registered: 2021-01-26
Posts: 12  

[SOLVED] Back and Pipewire

After 8 months of exploring other distros and window managers I'm back.   This time I've installed chimaera with runit and dwm (base install was LXQt).  Hassle free and Devuan gives me the best visual latency I've seen (0.7 ms on xterm https://lwn.net/Articles/751763/)

System:    Host: home Kernel: 5.10.0-9-amd64 x86_64 bits: 64 Desktop: dwm 6.1
           Distro: Devuan GNU/Linux 4 (chimaera)
CPU:       Info: 6-Core AMD Ryzen 5 3600 [MT MCP] speed: 2200 MHz min/max: 2200/3600 MHz
Graphics:  Device-1: NVIDIA GP108 [GeForce GT 1030] driver: nvidia v: 460.91.03
           Display: x11 server: X.Org 1.20.11 driver: loaded: nvidia
           unloaded: fbdev,modesetting,nouveau,vesa resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz
           OpenGL: renderer: GeForce GT 1030/PCIe/SSE2 v: 4.6.0 NVIDIA 460.91.03
Drives:    Local Storage: total: 2.84 TiB used: 1.84 TiB (64.7%)
Info:      Processes: 290 Uptime: 2h 44m Memory: 15.64 GiB used: 4.09 GiB (26.1%) Shell: Bash
           inxi: 3.3.01

X11 version number: 11.0 X.Org version: 1.20.11
wine : wine-6.0.1

I've got one problem now.  I would like to use pipewire instead of pulseaudio and can't find instructions anywhere that I can make work.  Is anyone aware of a guide to pipewire conversion likely to work in a Devuan / runit environment.  No biggie if not - I'm happy to be back to Devuan.

Offline

#2 2021-10-23 08:56:22

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Back and Pipewire

The pipewire-pulse package is only available from daedelus & ceres: https://pkginfo.devuan.org/cgi-bin/poli … e&x=submit

Perhaps try backporting it? https://wiki.debian.org/SimpleBackportCreation

EDIT: see also http://dev1galaxy.org/viewtopic.php?id=4447

Last edited by Head_on_a_Stick (2021-10-23 11:46:58)


Brianna Ghey — Rest In Power

Offline

#3 2021-10-25 11:56:07

kiwi
Member
Registered: 2021-01-26
Posts: 12  

Re: [SOLVED] Back and Pipewire

Thanks Head_on_a_Stick,

I experimented with a Daedalus Partition, enabled Pipewire and checked my main apps.  Everything was good and didn't seem too bleeding edge so I've saved my current image and switched up.   I can always revert if I run into problems.

Now:

System:    Host: home Kernel: 5.14.0-2-amd64 x86_64 bits: 64 Desktop: dwm 6.1
           Distro: Devuan GNU/Linux 5 (daedalus/ceres)

Last edited by kiwi (2021-10-25 13:29:58)

Offline

#4 2021-10-25 15:39:16

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Back and Pipewire

Note that testing isn't covered by the security team. IMO backporting was the better option.


Brianna Ghey — Rest In Power

Offline

#5 2021-10-26 03:53:05

kiwi
Member
Registered: 2021-01-26
Posts: 12  

Re: [SOLVED] Back and Pipewire

I had tested the easy backporting options and other than having to add a lot of extra files also had some problems with the build.  But I take your point about security so I explored some more.

This strategy also worked.  It has the disadvantage that you'll have to repeat it in future for newer versions of pipewire if you want them but it was simple.

Add a line to /etc/apt/sources.list

deb http://pkgmaster.devuan.org/merged/ daedalus main non-free contrib

then

sudo apt update
sudo apt install --upgrade pipewire*

then comment out the line & update again so that you don't accidentally upgrade other packages to daedalus.

Then prevent pulseaudio loading and add 3 lines to your window manager startup or other startup file

/usr/bin/pipewire &
/usr/bin/pipewire-media-session &
/usr/bin/pipewire-pulse &

Last edited by kiwi (2021-10-26 04:35:49)

Offline

#6 2021-10-26 22:23:01

kiwi
Member
Registered: 2021-01-26
Posts: 12  

Re: [SOLVED] Back and Pipewire

As a guide for anyone else intending to replace pulseaudio with pipewire
(low latency, low system load, poetfree):

# To update to the latest pipewire

Before upgrading packages from the testing release make sure that you back up
your system
in case you update any critical packages like glibc and break your
system. I use fsarchiver and keep several copies of my partitions for future
recoveries or clean installs.

sudoedit /etc/apt/sources.list
  to add the desired sources:
  deb http://pkgmaster.devuan.org/merged/ daedalus main non-free contrib

sudo apt update
sudo apt install --upgrade pipewire*

then comment out the daedalus source line and rerun sudo apt update to avoid
upgrading other files to daedalus.  If, in future you wish to upgrade to a new release
of pipewire, repeat this step.

# To Disable PulseAudio

After installing pipewire I used this as a guide:
       https://pipewire-debian.github.io/pipewire-debian/

Replace autospawn = no with autospawn = yes in files in the following
paths.  Often the file will be called client.conf:
~/.config/pulse/
/etc/pulse/
/etc/pulse/client.conf.d/

and in if you have /etc/xdg/autostart/pulseaudio.desktop then add .bak as a
suffix to disable it.

Then
sudo pkill -9 pulseaudio
sudo update-rc.d pulseaudio-enable-autospawn disable
sudo pkill -9 pulseaudio

and reboot your system which should now run pipewire-pulse instead of
pulseaudio.  Should you ever want it back, reverse the process.

To monitor behaviour of key processes I use:
watch -n 5 'top -n 1 -b -d 20 | sed 4,5d | rg "alsa|pulse|pipew|audac|vlc"'

but you could substitute egrep for rg (ripgrep).

Last edited by kiwi (2021-10-27 21:34:43)

Offline

#7 2021-10-26 23:06:33

golinux
Administrator
Registered: 2016-11-25
Posts: 3,318  

Re: [SOLVED] Back and Pipewire

A quick note . . . it is advised not to use pkgmaster in sources.list because it is the source that all mirrors sync with.  Please use one of the many mirrors offered on https://www.devuan.org/get-devuan instead.

Offline

#8 2021-10-27 00:24:17

kiwi
Member
Registered: 2021-01-26
Posts: 12  

Re: [SOLVED] Back and Pipewire

Thanks.  Amended note to reflect the advice (done, I see thanks).

Also, if you use a window manager like dwm, adding the process starts to your window manager init may result in multiple copies of the process if you log off and on again. So I tried creating 3 supervised processes using runit.   Good simple instructions for runit can be found in:

http://kchard.github.io/runit-quickstart/

If you use runsv then top is unable to differentiate the command names so I changed to ps with:

watch -n 5 'ps -ef | egrep "pipewire|audac|vlc|pulse|alsa" | grep -v grep'

Edit: for some reason, the runsv approach gave me problems including firefox & vivaldi not picking up the pipewire-pulse interface.  This might have been due to the changed process names.  So instead I created a batch file that wouldn't create second instances of the programs if called twice. I called it from my dwm autostart and also bound it to an alias in case pipewire crashed for some reason.  The file I used was:

#!/bin/dash

if [ -z "$(ps -ef | rg 'pipewire$' | rg -v rg)" ]; then
    /usr/bin/pipewire &
fi
sleep 0.2
if [ -z "$(ps -ef | rg 'pipewire-media-session' | rg -v rg)" ]; then
    /usr/bin/pipewire-media-session &
fi
if [ -z "$(ps -ef | rg 'pipewire-pulse' | rg -v rg)" ]; then
    /usr/bin/pipewire-pulse &
fi
sleep 0.3
ps -ef | rg "pipewire|audac|vlc|pulse|alsa" | rg -v "rg pi|_restart"

Last edited by kiwi (2021-10-27 06:14:23)

Offline

#9 2021-10-27 19:00:27

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Back and Pipewire

kiwi wrote:

# To update to the latest pipewire

sudoedit /etc/apt/sources.list
  to add the desired sources:
  deb http://pkgmaster.devuan.org/merged/ daedalus main non-free contrib

sudo apt update
sudo apt install --upgrade pipewire*

then comment out the daedalus source line and rerun sudo apt update to avoid
upgrading other files to daedalus.  If, in future you wish to upgrade to a new release
of pipewire, repeat this step.

^ This might have worked for you now but there is an increasing chance of this technique breaking a stable system as testing moves ahead. There is a chance that method has already broken your system if it pulled in any critical packages from testing, such as glibc (libc6).

EDIT: which is why I suggested backporting. Twice.

Last edited by Head_on_a_Stick (2021-10-27 19:01:41)


Brianna Ghey — Rest In Power

Offline

#10 2021-10-27 21:25:37

kiwi
Member
Registered: 2021-01-26
Posts: 12  

Re: [SOLVED] Back and Pipewire

Which is why I tried the debian instructions, twice.

No go on a clean system.

In this method you do get to choose what packages you upgrade.  I guess I should add the recommendation that people back up their system first.

I have also since compiled the most recent version of pipewire and installed that taking pipewire up one point release described as maybe bug fixes.  Once I resolve which dev packages were needed I might write up that approach as a recommendation.

Last edited by kiwi (2021-10-27 21:28:48)

Offline

#11 2021-10-27 21:59:22

kiwi
Member
Registered: 2021-01-26
Posts: 12  

Re: [SOLVED] Back and Pipewire

Alternative update procedure.   I found the backporting instructions failed me so instead updated only one package from Testing.  As Head_on_a_Stick pointed out there is a risk as testing and stable diverge of updating packages that break your system.  An alternative is to compile the current pipewire release.

https://gitlab.freedesktop.org/pipewire … -/releases

The basic instructions are at  https://pipewire.org but you first probably need to install meson and ninja build tools and some dependencies.   There is a list provided at https://www.linuxfromscratch.org/blfs/v … ewire.html. Otherwise, simply follow the instructions below and install packages in response to progressing error messages.  FWIW I installed the following (some of which may not have been needed):

meson libdbus-1-dev libeina1a libecore1 libdbus-c++-dev libao-dev libasound2-dev libeudev-dev
libudev-dev libogg-dev libflac-dev libgl1-mesa-dev libopus-dev libxfixes-dev libvorbis-dev

**Back up your system** - I use fsarchiver to save my root and home partitions.

Install the current version of pipewire for your system.  You will then overwrite it in this process.

Check your current pipewire version and paths with:
pipewire --version
whereis pipewire

The paths should match the installation paths below.

Next clone the pipewire repository with git clone https://gitlab.freedesktop.org/pipewire/pipewire.git

Then cd pipewire and

./autogen.sh --prefix=/usr
make
sudo make install

This will install /usr/bin/pipewire /usr/share/pipewire /usr/share/man/man1/pipewire.1.gz

Check version and paths again then follow the instructions to Disable PulseAudio in the post above.

Last edited by kiwi (2021-10-27 22:56:05)

Offline

#12 2021-10-28 01:08:04

kiwi
Member
Registered: 2021-01-26
Posts: 12  

Re: [SOLVED] Back and Pipewire

What issues would you expect there @Head_on_a_Stick?

Last edited by kiwi (2021-10-28 01:11:26)

Offline

#13 2021-10-28 06:18:50

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: [SOLVED] Back and Pipewire

kiwi wrote:

Which is why I tried the debian instructions, twice.

No go on a clean system.

That's funny because the OpenSUSE Build Service has just managed to build some Debian bullseye packages for pipewire-pulse in a freshly-spun VM:

https://software.opensuse.org//download … wire-pulse

You should post your method and errors if you want help building those packages locally ;-)

kiwi wrote:

What issues would you expect there @Head_on_a_Stick?

People will point at you and laugh for using make install instead of creating a package. And files in system paths that the package manager doesn't know about are generally a bad idea (IMO).


Brianna Ghey — Rest In Power

Offline

Board footer