It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
I was experimenting with some audio code for Linux and wished to just use PipeWire. But then I wondered how many people were using that.

I know PulseAudio had been prevalent for some time but my sense is that most distros have been transitioning over to PipeWire. Though I don't have a feel for the percentages.

Anyway I'd be interested to know if anyone was using something other than PipeWire.
I am not using PipeWire, nor PulseAudio. I stayed with direct use of ALSA since PulseAudio initial introduction, and had no reason to migrate away from it since then.

I had to apply some tweaks for games that do not work well without PulseAudio, like Linux native Unity3D games. But it is very rare that I find a game that can not run well without either PulseAudio or PipeWire.
I'm using pulse. I've used pipewire when I tried out Fedora, but in the end, for my use case, pipewire didn't do anything I couldn't already do with pulise, and I'm familiar with pulse.
I don't tend to tweak a whole lot with the user experience of my distro (my love affair with Linux really started with my being able to troubleshoot networked server software locally with as little friction as possible and that has stayed my main focus so far).

My understanding is that Ubuntu is transitioning towards PipeWire, so I guess that is what I'll be using. I do love that part of the description: "PipeWire was designed with a powerful security model that makes interacting with audio and video devices from containerized applications easy"
I use raw ALSA, even after switching to Debian, which really wants to force me to use pa. If you're developing software to use Linux audio, that's what you should target. If have a very compelling reason to use something else, target that in addition, not instead. ALSA has not yet been replaced in the kernel, so it's always there, and will be even when the next trendy user-space replacement becomes old news. Alternatively, use a library that at least supports native ALSA as well (e.g. OpenAL). You do need to test it with raw ALSA, though, even if it works with wrappers (pa has one, but I don't know if pipewire does). Not doing so is likely why every unity3d game with fmod audio (by supposed audio professionals) breaks in new ways on my systems.
avatar
darktjm: I use raw ALSA, even after switching to Debian, which really wants to force me to use pa. If you're developing software to use Linux audio, that's what you should target.
Yes, Pipewire can handle ALSA, PulseAudio, and Jack clients.

I guess what I do not understand is what does your mixing? How do you get audio from more than one application at once? I thought ALSA only took a single audio stream.
avatar
vv221: I am not using PipeWire, nor PulseAudio. I stayed with direct use of ALSA since PulseAudio initial introduction, and had no reason to migrate away from it since then.

I had to apply some tweaks for games that do not work well without PulseAudio, like Linux native Unity3D games. But it is very rare that I find a game that can not run well without either PulseAudio or PipeWire.
OK, same question to you. How do you get audio from more than one application at once?
Post edited March 09, 2023 by EverNightX
avatar
darktjm: wrappers (pa has one, but I don't know if pipewire does)
From https://pipewire.org/
"Seamless support for PulseAudio, JACK, ALSA, and GStreamer applications."

This sounds like a wrapper to me (and is actually quite nice due to the fact that, from what I can tell, PulseAudio and JACK don't play nicely together).
avatar
EverNightX: I guess what I do not understand is what does your mixing? How do you get audio from more than one application at once? I thought ALSA only took a single audio stream.
There actually is a way to configure ALSA to mix audio from multiple sources. With that said, it's still a lot easier to do this with PulseAudio (if it happens to work on your system) or PipeWire.

(Pre-pipewire, one strategy to get audio working if it doesn't is to install pulseaudio, or if it's already installed, remove it.)
avatar
EverNightX: OK, same question to you. How do you get audio from more than one application at once?
One possible answer: "Why would I need to get audio from more than one application at once?"
Post edited March 09, 2023 by dtgreene
I would not describe PW as being primarily a wrapper. Its its own thing that just happens to support prior client APIs.
avatar
dtgreene: One possible answer: "Why would I need to get audio from more than one application at once?"
Same reason you'd want to run more than one application at once. Multitasking. If I have music playing in the background, I don't want it cut off just because I am checking out a video in a browser or locally. I've even had background music playing over certain types of video games. I know I did this a lot when I used to play Hearthstone. OBS seems like it would be an issue too.

This is interesting, but a little disappointing. I did not expect anyone to be using ALSA alone without a sound server. Obviously I'm still learning about the Linux ecosystem. Thanks for the feedback all.
Post edited March 09, 2023 by EverNightX
avatar
Magnitus: My understanding is that Ubuntu is transitioning towards PipeWire,
Looks like they may already have done so: https://www.omgubuntu.co.uk/2022/05/ubuntu-22-10-makes-pipewire-default
Post edited March 09, 2023 by EverNightX
For years, I always made a point of not installing Pulseaudio as it was a buggy nightmare. The only consistent thing about it was audio and video never being in sync.
Lately, I let the distro choose its defaults in the audio department. As long as I don't notice any problems, I'm good.

At work, I do a lot of audio programming and only use ALSA on the Raspberry Pies and Linux PCs. I need as much control over the latencies as possible. Sound daemons would only get in the way. Going straight to the I2S device is also an option on some targets.
avatar
EverNightX: I guess what I do not understand is what does your mixing? How do you get audio from more than one application at once? I thought ALSA only took a single audio stream.
The ALSA library does mixing, if you don't override plugins (dmix is both automatic and can be configured manually). Problem is, of course, that many apps (including a lot of samples by the library authors, so it's understandable that 3rd parties don't do any better) try to connect directly to the hardware devices, which do not support mixing. They also do not support sample rate/format conversion, soft volume, and other features that the library (mostly) supports, but only if you don't try to connect to hardware PCM devices. On my system, if you use the default device (instead of trying to connect to a PCM device directly), you get multiplexed inputs and outputs, as well as format conversion and soft volume control for mixer-less outputs. If you try to connect to the hardware PCM devices, you don't get anything.
avatar
EverNightX: Yes, Pipewire can handle ALSA, PulseAudio, and Jack clients.
I'm not sure what that has to do with my response. But then again, I'm not sure what pipewire is, and admittedly I don't care enough to find out. What are its advantages over its competitors? What even are its competitors? Is it a competitor to ALSA/PulseAudio, or higher-level wrapper libraries like SDL, OpenAL, etc?

Edit: somebody I have filtered out with uBlock has apparently replied to me as well (I can probably guess who, given that there are only 2). I won't unblock to read, so apologies if what I've said is repeated.
Post edited March 09, 2023 by darktjm
avatar
EverNightX: Same reason you'd want to run more than one application at once. Multitasking. If I have music playing in the background, I don't want it cut off just because I am checking out a video in a browser or locally. I've even had background music playing over certain types of video games. I know I did this a lot when I used to play Hearthstone. OBS seems like it would be an issue too.
Thing is, two instances of music going on at the same time is not a pleasant sound.

If I am playing a game, and the game has sound, I want to be fully immersed in the game's sound, not having music from some other source playing over it.

If I want to check out a video (and the video has meaningful audio), I want to turn off the music so that it doesn't interfere with the video.
avatar
dtgreene: Thing is, two instances of music going on at the same time is not a pleasant sound.

If I am playing a game, and the game has sound, I want to be fully immersed in the game's sound, not having music from some other source playing over it.

If I want to check out a video (and the video has meaningful audio), I want to turn off the music so that it doesn't interfere with the video.
Who says about two instances of music? You can mute in-game music and listen to your own for whatever reason. Or listen to podcast. Not every game requires "full immersion", especially ones like Hearthstone in given example. Hell, I know even of people watching tv series/movies while playing games (although it's abstract level of multi-tasking for my brain) or sports events streams. You asked "why" and got valid answer.
avatar
darktjm: The ALSA library does mixing, if you don't override plugins (dmix is both automatic and can be configured manually). If you try to connect to the hardware PCM devices, you don't get anything.
Thank you. I need to look into this more. I had assumed that since most applications and libraries (FireFox/SDL for example) use PulseAudio before they will try and use ALSA that there must be a benefit. What you describe makes it sound like ALSA is always present and does everything an app would need. And therefore I have to wonder why would so many developers and distros prefer sound servers? Perhaps its a security thing. Perhaps its to handle edge cases. But that doesn't explain SDL's decision. I need to learn more.

avatar
darktjm: What are its advantages over its competitors? What even are its competitors? Is it a competitor to ALSA/PulseAudio, or higher-level wrapper libraries like SDL, OpenAL, etc?
Its lower level than SDL. It can be used to capture and playback audio & video with low latency. It allows multiple apps to share this data. It supports sandboxed apps like flatpak and allows wayland to do things like have multiple apps share video from a camera.
So I guess its more a replacement for PulseAudio, JACK, and GStreamer. It does not compete with ALSA so much as extend its use cases.


avatar
brouer: For years, I always made a point of not installing Pulseaudio as it was a buggy nightmare. The only consistent thing about it was audio and video never being in sync.
Lately, I let the distro choose its defaults in the audio department. As long as I don't notice any problems, I'm good.
I see. I think perhaps because I've only started using Linux within the past 12 months that I don't have the same negative history with sound servers that others may have who went thru their growing pains.
Post edited March 10, 2023 by EverNightX
avatar
EverNightX: I see. I think perhaps because I've only started using Linux within the past 12 months that I don't have the same negative history with sound servers that others may have who went thru their growing pains.
Worth noting that PulseAudio, in particular, has a bad reputation, and when it was first pushed to distros, I believe it caused a lot of issues. As I said, a reasonable piece of advice was to remove pulseaudio (if it's installed) if your sound isn't working (or, alternatively, add it if it isn't already installed), if your sound isn't working.

There's also the fact that you also have JACK, which is intended for low-latency audio production use cases, and which isn't (easily) compatible with PulseAudio.

Before this era, there was the sound server aRts, which I believe was part of KDE back then.