Pipewire instead of pulseaudio

Has anyone made the switch to pipewire-pulse and removed pulseaudio completely? If so, how did you do it? I've never managed to figure out the mechanism for triggering these services on FreeBSD, and everything written about either of them assume they are managed by systemd. I tried just uninstalling pulseaudio and seeing what happens but then `pavucontrol` breaks.
 
never used pipewire, but also don't have pulseaudio anywhere installed as it only causes problems... I've been using only OSS everywhere and gstreamer + alsa plugin for the few ports that don't have OSS support and only support alsa or pulse...
You have to build ports yourself though, as many ports have pulseaudio enabled by default and hence pull it in as a dependency.
 
Pipewire doesn't suck and is 100% compatible with pulseaudio (at least on Linux), so yeah that's the goal. To have something that doesn't suck and isn't a load of work to maintain.
 
Has anyone made the switch to pipewire-pulse and removed pulseaudio completely?
No and I try to avoid pulseaudio in the first place. It's a highly opinionated and often troublesome piece of software, even in the linux ecosystem where it's developed on and for. The experience with pulseaudio covers the whole spectrum, from "Sound works perfectly and instantly better than ALSA and everything else" to "Pulseaudio borked my audio hart and no fix in sight" and everything in between. And to this day I haven't understood what benefits pulseaudio actually brings to the table, especially on FreeBSD.

My last experience with pulseaudio and pipewire: a year ago I wanted to play a Nintendo Switch game on my pc via an emulator. As everyone knows there are only two Switch emulators available, emulators/yuzu and Ryujinx. Ryujinx isn't ported to FreeBSD, it doesn't help that it's written in C#. yuzu has native support for OSS, unfortunately the specific game I wanted to play coredumps really often on yuzu (a known problem with this game on yuzu, not related to the FreeBSD port) and makes it essentially unplayable. The game works flawlessly on Ryujinx. Therefore I installed void linux on the pc and used flatpak for Ryujinx. I had to enable pulseaudio and pipewire to make the sound work and it worked well. But I wouldn't be able to configure/finetune this ALSA-pulseaudio-pipewire multilayered messy mess even if my life depends on it. That's just pure insanity.

You have to build ports yourself though, as many ports have pulseaudio enabled by default and hence pull it in as a dependency.
This breaks my heart. And my heart breaks even more when much appreciated and awesome ports, like emulators/pcsx2, list pulseaudio unconditionally as a dependency even when the port works just fine with OSS. Someday I want to launch a PR campaign on https://bugs.freebsd.org to disable pulseaudio in every port for which it's not a true hard dependency. It might be easier when subpackages are supported in the ports framework. With subpackages we could seperate libpulse.so and pulseaudio into two packages and make every port dependend on the libpulse-package. Everyone who truly truly really wants pulseaudio could then install the server binary with the pulseaudio-package. That's actually what some linux distros do and is the right way. It's sad that there are linux distros which make it easier to have a pulseaudio-free system than FreeBSD, where it is foreign.
 
This breaks my heart. And my heart breaks even more when much appreciated and awesome ports, like emulators/pcsx2, list pulseaudio unconditionally as a dependency even when the port works just fine with OSS.
The reason to go with pulse in the default options is a very pragmatic one: in the majority of upstream projects, this is the best maintained and tested option, even if other adapters are provided. Of course that's because it became the de-facto standard on Linux desktops. And then, once you run pulseaudio, it's best to have ALL audio use it, otherwise issues are more likely...

Of course, FreeBSD has no need for that technically. And I don't use it either (building my own packages with sndio or oss, with possible fallbacks to sdl, alsa, portaudio, ...). But I have one thing not working that way already, for remote audio with xrdp, pulse is the only option, and as all my ports are built without pulse support, it just won't work.

So, in a nutshell, you won't convince ports maintainers they should ban pulse from default options, it would likely cause worse experience for users of binary packages. To change that, you'd instead have to convince a LOT of upstream projects to have oss (or maybe sndio) as a first class citizen (again).
 
The reason to go with pulse in the default options is a very pragmatic one: in the majority of upstream projects, this is the best maintained and tested option, even if other adapters are provided. Of course that's because it became the de-facto standard on Linux desktops. And then, once you run pulseaudio, it's best to have ALL audio use it, otherwise issues are more likely...

Of course, FreeBSD has no need for that technically. And I don't use it either (building my own packages with sndio or oss, with possible fallbacks to sdl, alsa, portaudio, ...). But I have one thing not working that way already, for remote audio with xrdp, pulse is the only option, and as all my ports are built without pulse support, it just won't work.

So, in a nutshell, you won't convince ports maintainers they should ban pulse from default options, it would likely cause worse experience for users of binary packages. To change that, you'd instead have to convince a LOT of upstream projects to have oss (or maybe sndio) as a first class citizen (again).
Agreed, the battle for the good cause is a long and exhausting one.

I also read between your lines: you're teasing me to implement an OSS and sndio backend for xrdp (probably like audio/pulseaudio-module-xrdp). Ok, I'm not uninterested. Well played Sir, well played ;)
 
I also read between your lines: you're teasing me to implement an OSS and sndio backend for xrdp (probably like audio/pulseaudio-module-xrdp). Ok, I'm not uninterested. Well played Sir, well played ;)
Ha! Well, thinking about this, I think a) it's probably indeed doable (using cuse(3) to provide some userspace OSS devices), and I'd very much appreciate it, b) it won't be simple at all but a lot of work, c) no, I didn't imply that :cool: and d) unfortunately, this won't solve the underlying problem:

Unfortunately, there can only be one set of default options, and as long as pulseaudio is the overall best supported one, it must be in defaults to serve users of the binary packages best... I don't see a realistic way to promote OSS to "first choice" for upstream projects again :(. While FreeBSD has a very nice implementation of OSS, the one in Linux was quite bad (not even solving the issue of opening /dev/dsp and friends was a system-wide exclusive resource...). Instead of fixing this, they came up with ALSA, that's a long time ago and IMHO that's where things started to go sideways...

And yes, Linux is the most relevant "unixy" target platform for almost all projects nowadays.
 
Like on linux, I want it to be so:
ALSA (in this case OSS) Is the default option, no package has a HARD requirement for pulse, only libpulse
Now a package that does ONLY support pulse, will still not add pulse, it will tell the user in the terminal that is requires pulse, or needs apulse to reroute pulse to ALSA

Now is users want pulse/pipewire, theyre going to install it, which has never been a problem on linux solving it like this, and OSS users dont have to rebuild a lot of packages, like a browser (ouch), to get OSS back.
So i dont see why FreeBSD cant do the same
 
So i dont see why FreeBSD cant do the same
Simple. You don't know or understand how the FreeBSD ports tree is managed.

You want to get rid of the pulse audio dependency? Build your own repository. Then you can set all the options the way you want it.
 
o..k..?
Why wont you just tell me the problem with my solution?
Because right now, i still dont know where the problem is.

And i told you that my own repository is a garbage solution for things like browsers, if youre going to give me other solutions, give me ones that i HAVENT DENIED yet
And even if i hadn't, removing pulseaudio from every package, rebuilding without libpulse and mainting my own repository sound like a perfect solution!
No... no it doesnt...
If you do want to make better suggestions, alright, i'm all ears, but this isnt gonna cut it.
 
Unfortunately, there can only be one set of default options, and as long as pulseaudio is the overall best supported one, it must be in defaults to serve users of the binary packages best
When I first tried to play sounds on FreeBSD, everything other than pulseaudio had worse problems. Most apps I've tried AT THE MOMENT (not now!) using OSS didn't support shared vchans, thus forced me to quit application previously using sound to use another. Yes, it's VERY old story, though.
 
Ha! Well, thinking about this, I think a) it's probably indeed doable (using cuse(3) to provide some userspace OSS devices), and I'd very much appreciate it, b) it won't be simple at all but a lot of work, c) no, I didn't imply that :cool: and d) unfortunately, this won't solve the underlying problem:
Now it got me curious. I took a first glimpse at the pulseaudio and pipewire module for xrdp and it doesn't seem to be THAT difficult at all (famous last words...). Maybe after my Ryujinx porting efforts I'm trying it if I'm still interested in this. Such projects can be a lot of fun.

Why wont you just tell me the problem with my solution?
Because right now, i still dont know where the problem is.
I understand your frustration, I also wish we had a different status quo in the ports tree management for this topic. But as zirias@ and SirDice have pointed out, it's probably too much work and effort involved in convicing every port maintainer to disable pulseaudio by default for small gain. In the end, for most programs you can change the audio backend in the options at runtime and if pulseaudio really interferes with your audio setup then ln -sf /bin/true /usr/local/bin/pulseaudio is always a last resort ;). Of course subpackaging the pulseaudio port is interesting, as is something like apulse just for OSS or sndio. But such things would need time too, and pulseaudio is actually on its way out in the linux ecosystem. Pipewire is becoming the new standard.

And now we are back on topic. I don't know much about Pipewire. I read that it's better received than pulseaudio. I tried it a year ago on linux and it worked. That's all I can say about Pipewire.
 
I because a lot less interested in pipewire when I learned that they do jack audio not by implementing the wire protocol, but by exchanging the shared library for jack.
 
It is still possible to avoid Pulseaudio and Pipewire, but there is a price to pay: you will likely have to build from Ports, as the packages are mostly build with Pulseaudio and you will have limitations in your choice of desktop environments. For example, xfce misses some important parts (like volume control / mixer) without Pulseaudio, while Mate works just fine.

I migrated my two HTPCs with Kodi from Xubuntu to FreeBSD (Mate) to get rid of Pulseaudio, as it caused many audio issues (no pass-through, lagging and even some wow&flutter). On my hardware, FreeBSD with OSS allows pass-through (up and to Dolby TrueHD-Atmos and DTS:X) and PCM 7.1 with up to 192 kHz sampling rate. If I install Kodi from Packages (with Pulseaudio) I have no audio whatsoever in Kodi.

Back to the OP: you might not get many useful answers to the question "how to migrate from Pulseaudio to Pipewire" due to the fact that most people on FreeBSD have been avoiding Pulseaudio in the first place. But even on Linux it may often not be possible yet to migrate completely. On my Artix (Arch without systemd) installation, there is a hot mess of ALSA, Pulseaudio and Pipewire that is very slow to shift towards Pipewire.
 
It is still possible to avoid Pulseaudio and Pipewire, but there is a price to pay: you will likely have to build from Ports, as the packages are mostly build with Pulseaudio and you will have limitations in your choice of desktop environments. For example, xfce misses some important parts (like volume control / mixer) without Pulseaudio, while Mate works just fine.

There also is a problem with the Chromium port. You need to compile it yourself if you want pulseaudio. (of course jackd is not an option in the first place)
 
Like on linux, I want it to be so:
Uh, what ....?

ALSA (in this case OSS) Is the default option, no package has a HARD requirement for pulse, only libpulse
So you're obviously talking about some specific Linux distribution while we have to guess which one.

Now a package that does ONLY support pulse, will still not add pulse, it will tell the user in the terminal that is requires pulse, or needs apulse to reroute pulse to ALSA
It might be possible to build several packages out of this pulseaudio mess, although I could only know by having a deeper look. Without subpackage support in our ports framework (still waiting for that feature), it's not guaranteed such a thing is possible.

It certainly won't change anything about pulseaudio being a default build option. You don't get around it nowadays, recluce just mentioned another practical example above.

Now is users want pulse/pipewire, theyre going to install it, which has never been a problem on linux solving it like this, and OSS users dont have to rebuild a lot of packages, like a browser (ouch), to get OSS back.
Which browser are you talking about? Something like this would surprise me a lot. When OSS is supported in some upstream project, it's always in the default port options. Looking at the "big ones", chromium doesn't support OSS (but has sndio enabled by default which is reasonably lightweight), and firefox certainly has OSS in the default options.

So i dont see why FreeBSD cant do the same
There's a FAQ about this here on these forums.
 
1.
Its not bad be be close to linux in some cases, its about taking an objective look and seeing whats better, i just reffered to linux for an example that works

2.
(Most) as far as i know, do it this way, its irrelevant to ask about it

3.
Thats (kind of) what i was saying, remove invalid pulseaudio dependencies more
almost EVERYTHING has a pulseaudio dependencies

4.
back to point 3. Firefox has a pulseaudio dependency, and again, we should remove it, it doesnt depend on it, the kernel oss does it, the only way for me to not install it, is by recompiling without libpulse, which is just slooow

Another way to solve this, is by having a package blacklist like packman, blacklist pulseaudio, and never install it.
Or install pulse, lock it, and destroy the executable, which is half backed but works i guess...
 
Is it possible for an OSS app and a pulseaudio app to coexist? In other words, I can do a slow migration, or - worst case - the port might require pulseaudio but once installed can be configured to not actually use pulseaudio.
 
And to this day I haven't understood what benefits pulseaudio actually brings to the table, especially on FreeBSD.
I don't think it does. It solves problems for Linux due to not having an OSS-like audio stack by moving the mixer functionality to userland instead of the kernel. As I see it, FreeBSD use-case of pulseaudio is strictly for compatibility.

Side note: another dependency I'd like to see squashed is Samba but that's whole other topic.
 
Is it possible for an OSS app and a pulseaudio app to coexist? In other words, I can do a slow migration, or - worst case - the port might require pulseaudio but once installed can be configured to not actually use pulseaudio.
In my experience, yes. One of my HTPCs was on xfce for quite a while after they introduced the pulseaudio dependency. It was not a problem to bypass it, e.g. from Kodi, as long as I compiled Kodi without pulseaudio support. Other applications allowed selecting the audio system, e.g. Firefox.
 
Is it possible for an OSS app and a pulseaudio app to coexist? In other words, I can do a slow migration, or - worst case - the port might require pulseaudio but once installed can be configured to not actually use pulseaudio.

In FreeBSD, yes. In Linux, no. This is due to the OSS mixer functionality in the FreeBSD kernel that Linux doesn't have. But note that there are limitations with that mixer, IIRC an example is 16 max applications at the same time.
 
Back
Top