The officially official Devuan Forum!

You are not logged in.

#1 2022-12-03 20:59:54

Devarch
Member
Registered: 2022-10-03
Posts: 62  

Pipewire

Is there is a correct way to install pipewire in Chimaera with bluetooth etc support?

Offline

#2 2022-12-03 23:10:58

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

Re: Pipewire

Debian instructions here: https://wiki.debian.org/PipeWire#Debian_11

Needs some tweaking though because the pipewire systemd unit files don't have an /etc/init.d/ alternative and it relies on socket activation; not such if that's supported at all outside of systemd.

Check https://dev1galaxy.org/viewtopic.php?id=4865 for a way to make init scripts and see if you can make it work. Post back here if you have any problems.


Brianna Ghey — Rest In Power

Offline

#3 2022-12-06 14:56:57

Devarch
Member
Registered: 2022-10-03
Posts: 62  

Re: Pipewire

OK. I've got it.

There is still a problem with pipewire: the sound is a bit "metallic" on chimaera, while close to "the best" on daedalus.

I'll provide a tutorial bellow if somebody needs it. not sure this is the best way smile

under root:

nano /etc/apt/sources.list
deb http://deb.devuan.org/merged chimaera-backports main contrib non-free

//backport is needed as there are no all packages in the main

apt-get update
aptitude install -t chimaera-backports pipewire pipewire-audio-client-libraries pipewire-pulse pipewire-bin pipewire-alsa pipewire-doc pipewire-tests wireplumber libwireplumber-0.4-0 libspa-0.2-bluetooth libspa-0.2-jack gstreamer1.0-pipewire libpipewire-0.3-0 libpipewire-0.3-modules libspa-0.2-modules libxfixes3 blueman bluez

//apt can also be used. I've updated bluetooth
// I do not know if it makes any difference but my blueman is also newer 2.3.4+mint1+elsie than in chimaera as I have eslie repo enabled (LMDE:   deb http://packages.linuxmint.com elsie main upstream import backport)

mv /etc/xdg/autostart/pulseaudio.desktop /etc/xdg/autostart/pulseaudio.desktop.bak
pkill -9 pulseaudio
apt-get remove pulseaudio-module-bluetooth
touch /etc/pipewire/media-session.d/with-pulseaudio

touch /etc/pipewire/media-session.d/with-alsa
cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/

touch /etc/pipewire/media-session.d/with-jack
cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-*.conf /etc/ld.so.conf.d/
ldconfig
rc-update del pulseaudio-enable-autospawn

// the last command is for open-rc, use different one if u 've sysvinit, runit

//now under regular user ($):  where megauser - is your username

nano /home/megauser/.config/autostart/pipewirelauncher.desktop

// content:

[Desktop Entry]
Type=Application
Exec=/home/megauser/pipewire.sh
Hidden=false
X-GNOME-Autostart-enabled=true
Name=myscript
Comment=custom script
nano /home/megauser/pipewire.sh

//content:

#!/bin/bash

/usr/bin/pipewire &
/usr/bin/wireplumber &
/usr/bin/pipewire-pulse &
chmod +x /home/megauser/.config/autostart/pipewirelauncher.desktop /home/megauser/pipewire.sh
# reboot
$ LC_ALL=C pactl info | grep "Server Name"

Server Name: PulseAudio (on PipeWire 0.3.58)

Sound on mpv, vlc, bluetooth works as well as microphone.

Last edited by Devarch (2022-12-06 17:14:07)

Offline

#4 2022-12-06 16:42:08

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

Re: Pipewire

@Devarch . . . Please continue formatting your post above with "code" tags as I have started. Thanks!

Offline

#5 2022-12-06 17:11:11

Devarch
Member
Registered: 2022-10-03
Posts: 62  

Re: Pipewire

Telegram also works.

If someone wants to repeate the steps above give me some time to test. I do not know if there are some bugs.

Update. It works.
The disadvantage, when I use USB headset I have to manually set input and output in order to use external microphone and speaker.

Also my bluetooth did not keep connection more than 15 min or so. But it was not linked with pipewire itself. The same was with pulseaudio.
The solution is to update intel bluetooth driver to the latest:

 
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/snapshot/linux-firmware-20210511.tar.gz
tar xfvz linux-firmware-20210511.tar.gz
cd linux-firmware-20210511
sudo cp intel/ibt-* /lib/firmware/intel/

I still has an error "iwlwifi driver not loading" on boot, but wifi and bluetooth are working without issues.

Last edited by Devarch (2022-12-10 17:47:28)

Offline

#6 2022-12-08 06:58:35

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

Re: Pipewire

The pipewire.desktop file doesn't need to be executable and also ~/.config/autostart/ is not honoured in simple window manager desktops so for those the pipewire{,-pulse} & wireplumber launcher lines would have to be placed in ~/.xsessionrc instead. This would also work for full desktop environments and so should probably be preferred.

Last edited by Head_on_a_Stick (2022-12-08 21:36:19)


Brianna Ghey — Rest In Power

Offline

#7 2022-12-08 20:30:39

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: Pipewire

Devarch wrote:

Telegram also works.

If someone wants to repeate the steps above give me some time to test. I do not know if there are some bugs.

I tried it yesterday and got no sound devices listed.

I'll give it another shot sometime in the near future.


pic from 1993, new guitar day.

Offline

#8 2022-12-08 21:36:10

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

Re: Pipewire

@GlennW: try creating a file at ~/.xsessionrc with this content:

wireplumber &
pipewire &
pipewire-pulse &

Brianna Ghey — Rest In Power

Offline

#9 2022-12-10 12:34:18

Devarch
Member
Registered: 2022-10-03
Posts: 62  

Re: Pipewire

GlennW wrote:

I tried it yesterday and got no sound devices listed.

I'll give it another shot sometime in the near future.

Seems I forgot nothing, all the steps are above. It works on my machine.

I have to use recent kernel as I've quite recent hardware

$ uname -a
Linux host 6.0.0-0.deb11.2-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.0.3-1~bpo11+1 (2022-10-29) x86_64 GNU/Linux

But I don"t think it makes any difference.

In addition to what @Head_on_a_Stick told, try to not run it as root.

Last edited by Devarch (2022-12-10 13:53:15)

Offline

#10 2022-12-13 10:09:46

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: Pipewire

Hi, thanks for your tips. I cleaned up my fumbles and went through the directions again.

One file I couldn't find was "99-pipewire-default.conf"
from this copy step... from examples

cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/

I found a same named file and copied it.
/usr/share/alsa/alsa.conf.d/99-pipewire-default.conf

My system is Devuan 5 Daedalus.

the hardware is discovered and used. works ok. Will be trying the bt headphones soon. :-) thank you

Last edited by GlennW (2022-12-13 10:11:01)


pic from 1993, new guitar day.

Offline

#11 2022-12-13 17:57:48

Devarch
Member
Registered: 2022-10-03
Posts: 62  

Re: Pipewire

GlennW wrote:

My system is Devuan 5 Daedalus.

the hardware is discovered and used. works ok. Will be trying the bt headphones soon. :-) thank you

The installation is a bit different on daedalus - much simplier smile

Nice to hear that it works.

Offline

#12 2022-12-14 05:22:21

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: Pipewire

Devarch wrote:
GlennW wrote:

My system is Devuan 5 Daedalus.

the hardware is discovered and used. works ok. Will be trying the bt headphones soon. :-) thank you

The installation is a bit different on daedalus - much simplier smile

Nice to hear that it works.

Thank you for the clear directions.

I ended up using .xsession to start as HoaS suggested.

I'm happily surprised bt headphones works on first attempt.

:-)


pic from 1993, new guitar day.

Offline

#13 2022-12-14 11:41:39

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

Re: Pipewire

GlennW wrote:

I ended up using .xsession to start as HoaS suggested

For clarity: that should be ~/.xsessionrc.

Reference: https://wiki.debian.org/Xsession

Last edited by Head_on_a_Stick (2022-12-14 11:42:09)


Brianna Ghey — Rest In Power

Offline

#14 2022-12-15 22:15:27

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: Pipewire

Head_on_a_Stick wrote:
GlennW wrote:

I ended up using .xsession to start as HoaS suggested

For clarity: that should be ~/.xsessionrc.

Reference: https://wiki.debian.org/Xsession

Yes, that's right, ~/.xsessionrc, HoaS. Thanks.

I am experiencing a sound problem, the GUI starts with no ssound.

lsmod shows the snd-usb-audio(?) is loaded according to lsmod.

log out and back in connects the audio.

I tried to delay the .xsessionrc with sleep 12 to no avail.

Any ideas to smooth this loading out? I turned off wireplumer in rc-update (open-rc)

here is some confirmation...

glenn@GamesBox ~ $ LC_ALL=C pactl info | grep "Server Name"
Server Name: PulseAudio (on PipeWire 0.3.62)
glenn@GamesBox ~ $ 

regards Glenn


pic from 1993, new guitar day.

Offline

#15 2022-12-15 22:41:43

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

Re: Pipewire

GlennW wrote:

Any ideas to smooth this loading out?

Try this in ~/.xsessionrc instead of what I posted earlier:

# kill any existing pipewire instance to restore sound
pkill -u "$USER" -fx /usr/bin/pipewire-pulse 1>/dev/null 2>&1
pkill -u "$USER" -fx /usr/bin/wireplumber 1>/dev/null 2>&1
pkill -u "$USER" -fx /usr/bin/pipewire 1>/dev/null 2>&1

exec /usr/bin/pipewire &

# wait for pipewire to start before attempting to start related daemons
while [ "$(pgrep -f /usr/bin/pipewire)" = "" ] ; do
   sleep 1
done

exec /usr/bin/wireplumber &

exec /usr/bin/pipewire-pulse &

Reference: https://git.alpinelinux.org/aports/tree/community/pipewire/pipewire-launcher.sh


Brianna Ghey — Rest In Power

Offline

#16 2022-12-16 14:51:30

rolfie
Member
Registered: 2017-11-25
Posts: 1,047  

Re: Pipewire

Acer Aspire Laptop with Daedalus/openrc/Cinnamon DE:
Just installed:

# apt install pipewire pipewire-pulse wireplumber

and added the lines as listed in the previous post to my .xsessionrc: Audacious is playing my playlist as well configured to ALSA as to Pulse.

I am just missing: separate topic ...

rolfie

Online

#17 2023-01-10 01:57:43

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: Pipewire

Hi, thank you for the tips.

I used a "sleep 12" to slow down the loading of apps until the snd_usb_audio module loading has settled.

still misses sometimes.

I will try the next script you have offered HoaS, cheers.


pic from 1993, new guitar day.

Offline

#18 2023-01-12 02:20:25

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 582  

Re: Pipewire

GlennW wrote:

Hi, thank you for the tips.

I used a "sleep 12" to slow down the loading of apps until the snd_usb_audio module loading has settled.

still misses sometimes.

I will try the next script you have offered HoaS, cheers.

My system is working quite well now, Specifically with HoaS script although the BT headphones work at first but (I've only just checked as I'm typing) drops out... b.t.connection. But the sound works when the system has started and that's what I like most.

I don't use bt connections very much... (mouse always works) and I removed a package that put an icon on the bar that was duplicate of Plasma bt, so I got rid of it. I'll check if that helps. See, hacking is fun! :-) [edit, mention the script]

Last edited by GlennW (2023-01-12 02:24:44)


pic from 1993, new guitar day.

Offline

#19 2023-01-12 06:47:12

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

Re: Pipewire

Slightly simpler version:

pkill -u "$USER" pipewire-pulse >/dev/null 2>&1
pkill -u "$USER" wireplumber >/dev/null 2>&1
pkill -u "$USER" pipewire >/dev/null 2>&1

pipewire &

until pgrep -f pipewire >/dev/null 2>&1 ; do
   sleep 1
done

wireplumber &

pipewire-pulse &

No need for full paths or exec (the ampersands already fork the commands) and the until clause is simpler and quicker than a formal test.

Last edited by Head_on_a_Stick (2023-01-12 07:31:33)


Brianna Ghey — Rest In Power

Offline

#20 2023-01-16 17:50:56

dzz
Member
From: Exmouth, South West England
Registered: 2016-12-01
Posts: 47  

Re: Pipewire

Thanks all here for the info on setting up pipewire for chimaera. Tried and failed till now.  Although  bluez-alsa does work for my BT speaker. I don't use pulse-audio.

I first installed the packages as described by Devarch. Note these packages actually get installed as deps: pipewire-bin libpipewire-0.3-modules libwireplumber-0.4-0 libpipewire-0.3-0 . These backports are almost up to current unstable versions.

With the latest packages, everything subsequently (at least after reboot) worked "out of the box" on my Toshiba laptop. No file copying no other configurations. The Debian wiki is outdated. The BT speaker is up and running, including firefox streams which failed with bluez-alsa.

Thanks HoaS for the start script. I adapted it quite a bit because I want to start/stop pipewire manually. Also, sometimes a restart is needed (here) to fix an occasional bt connection drop out. And I don't want processes not in use autostarting (I disabled also /etc/xdg/autostart/blueman.desktop).

Placed in ~/bin/ and called from a desktop launcher:

#!/bin/bash

# Script name: bluestart
# Place in ~/bin and make a desktop launcher 
# Execute "bluestart stop" to just stop pipewire and related processes without restarting.

# (in case you used "stop" parameter)
MODE="$1"

# You probably need to restart your system mixer to register/deregister the pipewire device.
# Edit (or comment) the next line to suit whatever your DE uses:
MIXER=kmix

# Don't run this as root!
if [ $EUID -eq 0 ]; then exit 1; fi

restart_mixer () {

	if [ -n "$MIXER" ]; then

		pkill -u "$USER" "$MIXER" >/dev/null 2>&1
		$MIXER &
	fi
}

stop_pipewire () {

pkill -u "$USER" pipewire-pulse >/dev/null 2>&1

pkill -u "$USER" wireplumber >/dev/null 2>&1

pkill -u "$USER" pipewire >/dev/null 2>&1

killall blueman-applet blueman-tray blueman-mechanism 2>/dev/null

# delete blueman stat files in ~/.config
for i in $(ls ~/.config|grep blueman); do rm -f $i; done

}

stop_pipewire

if [ "$MODE" = "stop" ]; then
	sleep 3
	restart_mixer
	exit 0
fi

pipewire &

until pgrep -f pipewire >/dev/null 2>&1 ; do
   sleep 1
done

wireplumber &

pipewire-pulse &

blueman-applet &

sleep 2

restart_mixer

Hope that helps someone..

Offline

#21 2023-01-16 18:05:48

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

Re: Pipewire

@dzz: why are you using a bash shebang in a script that contains no bashisms? A /bin/sh shebang will use dash in Devuan, which is lighter, faster and less buggy than bash.

However, $EUID is undefined in POSIX so the "Don't run this as root!" test should then be changed to

if [ "$(id -u)" -eq 0 ]; then exit 1;fi

Or

[ "$(id -u)" = 0 ] && exit 1

Also, the "delete blueman stat files in ~/.config" line parses ls, which is a bad idea, so

rm -rf ~/.config/*blueman*

Not sure if the asterisk is needed both sides, I don't use BlueTooth so I have no idea how the configuration files are named; mutatis mutandis.

EDIT: missed a closing double-quote. Oops.

EDIT2: no point using a for loop when a simple glob will work.

Last edited by Head_on_a_Stick (2023-01-17 06:06:24)


Brianna Ghey — Rest In Power

Offline

Board footer