LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-21-2021, 02:32 AM   #31
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,816

Rep: Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981

Thanks! ZhaoLin1457 is the man! My QMPlay2 now has Alsa, PipeWire, and PulseAudio!
Attached Thumbnails
Click image for larger version

Name:	ALSA.jpg
Views:	215
Size:	22.9 KB
ID:	36183   Click image for larger version

Name:	PipeWire.jpg
Views:	172
Size:	23.9 KB
ID:	36184   Click image for larger version

Name:	PulseAudio.jpg
Views:	151
Size:	24.1 KB
ID:	36185  
 
2 members found this post helpful.
Old 04-21-2021, 03:42 PM   #32
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,022

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by RadicalDreamer View Post
Thanks! ZhaoLin1457 is the man! My QMPlay2 now has Alsa, PipeWire, and PulseAudio!
Thanks for your kind words, but permit me to doubt that my modest contributions have something to do with your QMPlay2 abilities to use ALSA, PipeWire, and PulseAudio.

In fact, the daemon supervisor created by @raforg on this setup invented by mine, together with the XDG autostart, just emulates more of less the systemd's behavior for its "user target" daemons.

In fact, this has nothing to do with PipeWire, does not influence its behavior in anyway, and just like we handle now the three PipeWire daemons, same we can do with another programs designed to be used by systemd as "user target" daemons.

For example, those VPN daemons which requires the systemd, because they are supposed to be run as "user target" daemons.

If you ask what's an "user target" daemon, as ridiculous as it looks, it's just an ordinary program, with no abilities to behave a daemon (like PulseAudio, for example) while they are supposed to be run on background and controlled by systemd on their life cycle.

Essentially, the systemd starts them on user login, keeps them alive (one instance per user) and stops them on user logout.

The PulseAudio is a true daemon, it knows how to go in background, how to not start more than one instance per user and even how to quit itself on user logout. But, the PipeWire daemons has no idea how to do those things and that's why we need the help of @raforg's daemon to handle them.

Any other "simpler" solution (as those vehiculated on this thread) are partial solving of the requirements and sooner or later they will end on issues. At least this is my humble opinion, as someone who experimented since more than a half of year with various methods to run on Slackware those "user daemons" designed for systemd.

True, there's also the design made by @LuckyCyborg, which probably emulates much better the Slackware init system for this "user" side, but it is also way more complicated, as he agrees himself.

For your amusement, here is one of the three scripts used by him for those PipeWire daemons:
Code:
#!/bin/sh
#
# Pipewire startup script for Slackware Linux


# The log file path;
LOGFILE="/tmp/pipewire-${USER}/pipewire.log"
#LOGFILE="${HOME}/.local/share/pipewire/pipewire.log"

# The PID file path:
PIDFILE="/run/user/${UID}/pipewire.pid"


pipewire_start() {
  if [ -s $PIDFILE ]; then
    PID=$(cat $PIDFILE)
    if ps -p $PID > /dev/null; then
      echo "Pipewire appears to be already running?"
      exit 1
    fi
  fi

  rm -f $PIDFILE
  mkdir -p $(dirname $LOGFILE)

  echo -n "Starting pipewire server..."
  PIPEWIRE_LOG=$LOGFILE /usr/bin/pipewire >/dev/null 2>&1 &

  if [ $? -eq 0 ]; then
    PID=$!
    echo "$PID" > $PIDFILE
    echo " done"
  else
    echo " failed"
    exit 1
  fi
}

pipewire_stop() {
  if [ ! -s $PIDFILE ]; then
    echo "$PIDFILE does not exist or is empty."
    rm -f $PIDFILE
    exit 1
  fi

  PID=$(cat $PIDFILE)
  rm -f $PIDFILE

  if ps -p $PID > /dev/null; then
    mkdir -p $(dirname $LOGFILE)

    echo -n "Stopping pipewire server..."
    kill $PID >/dev/null 2>&1

    while [ -d /proc/$PID ]; do
      sleep 1
      echo -n "."
    done
    echo " done"
  else
     echo "Pipewire server is not running."
     exit 1
  fi
}

pipewire_restart() {
  pipewire_stop
  sleep 1
  pipewire_start
}


case "$1" in
  start)
    pipewire_start
    ;;
  stop)
    pipewire_stop
    ;;
  restart)
    pipewire_restart
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac
Now, going back to your experiences with abilities of using ALSA, PipeWire and PulseAudio while running PipeWire audio server, I think you should say thanks to Mr. Hameleers, who's the first who packaged the PipeWire for KTown, then to Mr. Volkeding who magisterially integrated the PipeWire on Slackware-current and also built the FFMPEG with native PipeWire support.

Yes, looks like that PipeWire started to blend on the operating system, and honestly I do not know which many packages from Slackware-current are now capable to use the native PipeWire APIs.

But, like I said previously, this design imagined by mine has nothing to do with this, it has the simple purpose of babysitting the PipeWire daemons just like systemd would have did.


Last edited by ZhaoLin1457; 04-21-2021 at 04:10 PM.
 
8 members found this post helpful.
Old 04-21-2021, 05:19 PM   #33
RadicalDreamer
Senior Member
 
Registered: Jul 2016
Location: USA
Distribution: Slackware64-Current
Posts: 1,816

Rep: Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981Reputation: 981
Thank you everyone! And thanks to whoever coded Pulse to allow for this (code from default.pa and system.pa):
Code:
### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
#load-module module-udev-detect
.else
### Use the static hardware detection module (for systems that lack udev support)
load-module module-detect
.endif
I have to press ALSA twice in QMPlay2 to switch to it. I have to wait a few seconds after switching to it the first time to click apply again to get it to work.
Attached Thumbnails
Click image for larger version

Name:	QMPlay2 Playback Settings.jpg
Views:	81
Size:	128.1 KB
ID:	36188  
 
Old 04-22-2021, 07:42 AM   #34
FTIO
Member
 
Registered: Mar 2015
Location: Las Vegas, NV
Distribution: Slackware 15.0 x64, Slackware Live 15.0 x64
Posts: 618

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by notzed View Post
It's only "simple" here because most (all?) current software is written to use the pulseaudio client library, and pipewrite provides a compatible pusleaudio server implementation. So this lets one use the pipewire framework for sound instead of pulseaudio without having to rewrite any of the client (user) software to use it's apis. While most application software has alsa output, not all of it does and with some it might require special building options. And if they don't have an alsa output option you would have to write one which may not be easy and they probably wont accept as a patch for either.

slackware-current removed the pure-alsa module a few months ago and so it wont be available in 15. I use a combination of plain alsa and pipewire with the pipewire-pulse daemon and disable pulseaudio because it's not something i will let run on my computers. I use a simpler approach than the one here, I set the daemon-binary in /etc/pulse/client.conf to run pipewire, and have /etc/pipewire/pipewire.conf start the pipewire-pulse service. It just seems to work with no hassles, and for this computer i'm the only user and always logged in.

I have a headless PC that plays music and the setup described here is worthless since I don't log into any graphical session to use it. But for that I just use alsa because I wrote the music player it's running, so that point is moot.
Okay, I kinda, sorta understood this answer, and appreciate it. I guess LuckyCyborg couldn't figure out, with all that super-intelligence he believes he has, that I wasn't flaming anything but was asking a simple question...twice. I figure he got pissed off because I took away from him patting himself on the back so much.

Thanks again for the answer.
 
Old 04-23-2021, 12:41 PM   #35
lagavulin16
LQ Newbie
 
Registered: Aug 2017
Distribution: Slackware
Posts: 27

Rep: Reputation: Disabled
Quote:
Originally Posted by LuckyCyborg View Post
However, I do not believe that this does mean that the PulseAudio will be removed from the distro.

I imagine that there will be a PulseAudio package without its own audio server, containing only the libraries, headers and the tools.

In fact, probably the splitting the PulseAudio server in a separate package is a great idea even for today.
I think I was a little hasty - the completely change of the config format is still possible in pipewire, I have come across this myself recently. Of course, it's a bit early to accept pipewire by default in Slackware, as it's not well-established yet, but there isn't much choice, imo. That does not negate the quality of Pulsaudio 2.0.

Probably, it would be wise to have pulsaudio libs as separate package in the distribution and raise the pipewire version during the lifetime of the release - it is difficult to come up with something more suiting.

Last edited by lagavulin16; 04-23-2021 at 12:45 PM.
 
Old 04-23-2021, 01:26 PM   #36
marav
LQ Sage
 
Registered: Sep 2018
Location: Gironde
Distribution: Slackware
Posts: 5,358

Rep: Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068Reputation: 4068
Hi,

Just a few words to thank you guys for your work
I recently apply your "HowTo" and everything works wonderfully (speakers, bluetooth -whatever wireless earphones-, taskbar tooltips)

Thank you very much ZhaoLin1457 & LuckyCyborg

My laptop, for information (If it can be useful):
Code:
System:    Kernel: 5.11.16-slack x86_64 bits: 64 Console: tty pts/2 Distro: Slackware 14.2 
Machine:   Type: Laptop System: LENOVO product: 20ASS05K00 v: ThinkPad L440 serial: <filter> 
           Mobo: LENOVO model: 20ASS05K00 serial: <filter> UEFI-[Legacy]: LENOVO v: J4ET93WW(1.93)
Memory:    RAM: total: 7.49 GiB used: 3.16 GiB (42.1%) 
CPU:       Info: Dual Core model: Intel Core i3-4000M bits: 64 type: MT MCP cache: L2: 3 MiB 
Graphics:  Device-1: Intel 4th Gen Core Processor Integrated Graphics driver: i915 v: kernel 
           Display: server: Slackware Linux Project 1.20.11 driver: loaded: modesetting unloaded: vesa 
           resolution: 1366x768~60Hz 
           OpenGL: renderer: Mesa DRI Intel HD Graphics 4600 (HSW GT2) v: 4.5 Mesa 21.0.3 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio driver: snd_hda_intel 
           Device-2: Intel 8 Series/C220 Series High Definition Audio driver: snd_hda_intel 
           Sound Server-1: ALSA v: k5.11.16-slack running: yes 
           Sound Server-2: PipeWire v: 0.3.26 running: yes
Bluetooth: Device-1: Realtek Bluetooth Radio type: USB driver: btusb 
           Report: ID: hci0 state: up address: <filter> bt-v: 2.1 
Swap:      ID-1: swap-1 type: zram size: 2 GiB used: 0 KiB (0.0%) dev: /dev/zram0

Last edited by marav; 04-23-2021 at 01:38 PM.
 
1 members found this post helpful.
Old 04-23-2021, 07:47 PM   #37
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,266
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
Shameless plug (Posted on Feb 03, 2021):

https://www.linuxgalaxy.org/bkoenig/...with-pipewire/
 
4 members found this post helpful.
Old 04-24-2021, 09:24 PM   #38
chris.willing
Member
 
Registered: Jun 2014
Location: Brisbane, Australia
Distribution: Slackware,LFS
Posts: 915

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Quote:
Originally Posted by kingbeowulf View Post
Shameless plug (Posted on Feb 03, 2021):

https://www.linuxgalaxy.org/bkoenig/...with-pipewire/
There's a small typo in the "Setting up PipeWire" section - after mentioning pipewire config files being stored in /etc/pipewire, we're invited to open /etc/pipewire.conf. It should be /etc/pipewire/piewire.conf.

chris
 
Old 04-24-2021, 09:36 PM   #39
ZhaoLin1457
Senior Member
 
Registered: Jan 2018
Posts: 1,022

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by chris.willing View Post
There's a small typo in the "Setting up PipeWire" section - after mentioning pipewire config files being stored in /etc/pipewire, we're invited to open /etc/pipewire.conf. It should be /etc/pipewire/piewire.conf.

chris
Also there's a small issue on this wonderful post: he explained how to start the PipeWire daemons (and this was never an issue), but not how to stop them on user logout, and how to ensure that a single instance of each of three of them is started per user.

And this is freaking important, because the PipeWIre daemons are ordinary programs, which does not know like PulseAudio, how to quit themselves on user logout or to no start a second instance if it is already started.

So, the solution proposed will results on zombies, with not so spectacular effects like NO SOUND or even full desktop crashes, if the user logins/logout/logins or even starting from console with startkwayland or startx, then shutdown the desktop and starting again.

How @kingbeowulf loves to note dates, I just humbly remembered that on Nov 27, 2020 I started the discussion with @raforg about adding the elogind support on a particular way, on his daemon. Which ended with his agreement to add the ability to quit on user logout, finally ending with this little daemon added to Slackware:

https://github.com/raforg/daemon/issues/1

So, you can believe me that before of this date I have managed to start PipeWire, long enough to understand the caveats?

Last edited by ZhaoLin1457; 04-24-2021 at 11:05 PM.
 
1 members found this post helpful.
Old 04-24-2021, 10:20 PM   #40
Pithium
Member
 
Registered: Jul 2014
Location: Far side of the Oregon Trail
Distribution: Slackware64 15.0
Posts: 501

Rep: Reputation: 583Reputation: 583Reputation: 583Reputation: 583Reputation: 583Reputation: 583
Quote:
Originally Posted by ZhaoLin1457 View Post
Also there's a small issue on this wonderful post: he explained how to start the PipeWire daemons (and this was never an issue), but not how to stop them on user logout, and how to ensure that a single instance of each of three of them is started per user.

And this is freaking important, because the PipeWIre daemons are ordinary programs, which does not know like PulseAudio, how to quit themselves on user logout or to no start a second instance if it is already started.

So, the solution proposed will results on zombies, with not so spectacular effects like NO SOUND or even full desktop crashes, if the user logins/logout/logins or even starting from console with startkwayland or startx, then shutdown the desktop and starting again.

...

In my defense, pulseaudio is doing the same thing. Still a good point since pulseaudio has a -k option but I'm not finding an equivalent for pipewire. Since pulse/pipe run as servers this not technically an issue. Clients can connect to the Server whenever they want regardless of the running desktop. There are also options for doing this over the network which is probably why the daemons don't care if X dies.


I wrote that post for a previous version of pipewire so it doesn't take into considering recent changes upstream. I'm still running it but I had to fiddle with the media-session daemon as well. pipewire is still in a state of rapid development so you need to keep an eye on any updates you pull in for major changes.
 
Old 04-25-2021, 03:17 AM   #41
solarfields
Senior Member
 
Registered: Feb 2006
Location: slackalaxy.com
Distribution: Slackware, CRUX
Posts: 1,449

Rep: Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997Reputation: 997
Quote:
Originally Posted by kingbeowulf View Post
Shameless plug (Posted on Feb 03, 2021):

https://www.linuxgalaxy.org/bkoenig/...with-pipewire/
very nice blog, man!
 
1 members found this post helpful.
Old 05-22-2021, 06:45 AM   #42
1337_powerslacker
Member
 
Registered: Nov 2009
Location: Kansas, USA
Distribution: Slackware64-15.0
Posts: 862
Blog Entries: 9

Rep: Reputation: 592Reputation: 592Reputation: 592Reputation: 592Reputation: 592Reputation: 592
Quote:
Originally Posted by stormtracknole View Post
I haven't tested Bluetooth yet.
Well, I do use Bluetooth for my stereo receiver and I can report PipeWire works with it beautifully. Pipewire correctly assumes I want my stereo receiver turned on when I bring my system out of sleep/login/start my system. Many thanks to Wim Tayman for its creation!

Last edited by 1337_powerslacker; 05-22-2021 at 06:46 AM. Reason: Too many its.
 
2 members found this post helpful.
Old 05-23-2021, 01:28 PM   #43
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
I haven't been able to achieve good quality recording using Bluetooth headphones microphone with PA so I compiled PipeWire from master and ran it today but Bluetooth microphone is still not working as I expected. I have set
Code:
bluez5.msbc-support   = true
in /usr/share/pipewire/media-session.d/bluez-monitor.conf but mSBC is not showing up in pavucontrol or pw-dump and only CVSD is available. User LuckyCyborg has said here https://www.linuxquestions.org/quest...ml#post6243907 that Bluetooth microphone works well for them with Pipewire. I run Linux 5.10.31. I can't say if my Bose QC35 II headphones support mSBC codec but if they didn't how would they work so well with Android? I use a very cheap Bluetooth dongle but I heard that mSBC support does not depend on hardware. Has anybody else tried using Bluetooth microphone with Pipewire and could report the results?
 
Old 05-23-2021, 02:52 PM   #44
ctrlaltca
Member
 
Registered: May 2019
Location: Italy
Distribution: Slackware
Posts: 323

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
Quote:
Originally Posted by average_user View Post
I haven't been able to achieve good quality recording using Bluetooth headphones microphone with PA so I compiled PipeWire from master and ran it today but Bluetooth microphone is still not working as I expected. I have set
Code:
bluez5.msbc-support   = true
in /usr/share/pipewire/media-session.d/bluez-monitor.conf but mSBC is not showing up in pavucontrol or pw-dump and only CVSD is available. User LuckyCyborg has said here https://www.linuxquestions.org/quest...ml#post6243907 that Bluetooth microphone works well for them with Pipewire. I run Linux 5.10.31. I can't say if my Bose QC35 II headphones support mSBC codec but if they didn't how would they work so well with Android? I use a very cheap Bluetooth dongle but I heard that mSBC support does not depend on hardware. Has anybody else tried using Bluetooth microphone with Pipewire and could report the results?
Bose QC35 II + pipewire user here.

Code:
➜  ~ pw-cli info all | grep bluez5.codec
*               api.bluez5.codec = "sbc"
Here's a semi-official answer on what codecs out headphones support: https://community.bose.com/t5/Headph...ort/td-p/58799

Last edited by ctrlaltca; 05-23-2021 at 02:56 PM.
 
Old 05-23-2021, 02:57 PM   #45
average_user
Member
 
Registered: Dec 2010
Location: Warsaw, Poland
Distribution: Slackware
Posts: 560

Rep: Reputation: 220Reputation: 220Reputation: 220
This is not what I meant - I can use SBC in High Fidelity Playback too but I'm asking about mSBC that is used in Hands-Free Profile.
 
  


Reply

Tags
pipewire, pulseaudio



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Pipewire pulseaudio emulation without pulseaudio installed (works) adcdam Slackware 18 04-02-2021 01:34 AM
Plasma 5.20 Beta? It is rock solid, excluding the taskbar thumbnails on Wayland - or rather because Pipewire needs "per user" init scripts LuckyCyborg Slackware 3 09-21-2020 02:50 PM
LXer: This Week in Linux 94: Mesa 20, PipeWire, Linux Be Scary, MyPaint, GTK, Microsoft Defender LXer Syndicated Linux News 0 02-26-2020 07:23 PM
LXer: Improved multimedia support with Pipewire in Fedora 27 LXer Syndicated Linux News 0 09-20-2017 02:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration