Live data from Hacker News

PipeWire: The Linux audio/video bus

lwn.net

61–70 of 203 posts

Re: PipeWire: The Linux audio/video bus

#61
post #19

> including the raw Linux ALSA sound API, which typically allows only one application to access the sound card. If the raw in that sentence is not meant as a special qualifier and this is meant as a statement about ALSA in general, this is wrong. I recently read up on this to confirm my memory was right when reading a similar statement. In fact, ALSA had just a very short period where typically only one application a…

Another point against dmix: I would be surprised if it worked with sandboxes like Flatpak. That may be another reason why major desktop-oriented distros like Fedora Workstation haven't embraced it.

How do dmix and pulseaudio do IPC?

Re: PipeWire: The Linux audio/video bus

#62
post #18

It's great to see pipewire coming along, pulseaudio development seems to (to a spectator) to have been a little.. well.. https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge... https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge...

This is so sad. I had no idea.

Re: PipeWire: The Linux audio/video bus

#63
post #51

Earlier quoted context omitted.

> In fact, ALSA had just a very short period where typically only one application accessed the sound card. For some definition of 'short period'. Software mixing via dmix worked for me, but at the time I've heard for years that dmix was broken for many other people. Not sure whether things are better nowadays. The breakage seems to be caused by hardware bugs. Various authors had the stance that they refuse, on princi…

> For some definition of 'short period'. According to https://alsa.opensrc.org/Dmix , enabled by default since 1.0.9rc2. https://www.alsa-project.org/wiki/Main_Page_News shows that was 2005. Alsa 1.0.1 release was 2004. So it's only short when counting from then on, project start was 1998. But https://www.linuxjournal.com/article/6735 for example called it new 2004, so I don't think it was much of a default choice be…

I had a sound card that would not work with OSS in 2002ish, so I guess define "default choice." Even though it was technically disabled by default, I had to enable it to get sound working.

Re: PipeWire: The Linux audio/video bus

#64
post #13

Without audio buffer rewinding, you're going to have to suffer random stutters and jumpiness every time your system comes under heavy load. Your system does an NMI because you plugged the power cable in? Your audio will glitch. It will also mean you won't be able to sit with an idle CPU while playing music - the audio daemon will have to wake up to reload buffers multiple times per second, killing battery life unacce…

I'm not sure I understand this. Why can't you just increase buffer sizes and write more data to them to avoid frequency of wake ups? Edit: does this help? https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ...

Here's a decent (and corny) explanation video from Google on the matter:

https://www.youtube.com/watch?v=PnDK17zP9BI

Re: PipeWire: The Linux audio/video bus

#65
post #9
post #3

PipeWire has worked very well for me both as a drop-in replacement for PulseAudio and to enable screen sharing on Wayland.

It also worked as drop in replacement for PulseAudio for me, except all my audio now had stutters and pops. I ended up going back to Pulse. I got suggestions that I could go tweak buffer sizes stuff in a config file somewhere, but for my simple desktop use case I'd rather my audio just sounds right out of the box. Hopefully this sort of thing gets straightened out, because having to muck with config files to make my…

I had a couple little issues as well when I switched over a couple months ago, but they just fell away over the ensuing weeks of updates until there's nothing left at the moment. Give it another try sometime soon.

Re: PipeWire: The Linux audio/video bus

#66
post #54

Earlier quoted context omitted.

Thanks for the datapoint. I've been following https://github.com/NixOS/nixpkgs/issues/102547 and considering trying it out for a while. Did you just set services.pipewire.pulse.enable=true? https://search.nixos.org/options?channel=unstable&show=servi... My major concern is that I use PulseEffects as a key component of my setup so I'll need to check if that works well with PipeWire. But the only way to be sure is to t…

I didn't get to try it under PipeWire on my Arch laptop before that died the other day, but a friend had said PulseEffects is no longer such a massive CPU hog under PipeWire, so much so that they run it all the time now.

Interesting. I have PulseEffects running all of the time on PulseAudio and don't notice much CPU usage. However maybe that is because I only apply effects to the mic and it seems to disable itself when nothing is recording.

Re: PipeWire: The Linux audio/video bus

#67
post #19

> including the raw Linux ALSA sound API, which typically allows only one application to access the sound card. If the raw in that sentence is not meant as a special qualifier and this is meant as a statement about ALSA in general, this is wrong. I recently read up on this to confirm my memory was right when reading a similar statement. In fact, ALSA had just a very short period where typically only one application a…

The ALSA interface can actually refer to two different things:

1. The ALSA kernel interface

2. The interface provided by libasound2

The former is basically the device files living in /dev/snd, this interface is hardware dependent and whether you can or cannot send multiple streams to the sound card all depends on the actual underlying hardware and driver support.

The later is actually a shared library that when linked into your application exposes "virtual" devices (such as `default`, or `plughw:0` ...), these devices are defined through plugins. The actual configuration of these virtual devices is defined in `/etc/asound.conf` and `~/.asoundrc`. This is typically where dmix is defined/used. Which means that if you have any application that does not use libasound2 or uses a different libasound2 version, you are in trouble.

p.s. Pulseaudio implements alsa API compatibility by exporting an alsa device plugin to reroute audio from all applications making use of libasound2 (except itself).

Re: PipeWire: The Linux audio/video bus

#68
post #38

Earlier quoted context omitted.

Thanks for the datapoint. I've been following https://github.com/NixOS/nixpkgs/issues/102547 and considering trying it out for a while. Did you just set services.pipewire.pulse.enable=true? https://search.nixos.org/options?channel=unstable&show=servi... My major concern is that I use PulseEffects as a key component of my setup so I'll need to check if that works well with PipeWire. But the only way to be sure is to t…

I also have Pipewire running on NixOS. This is what I recommend configuring: services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; jack.enable = true; pulse.enable = true; socketActivation = true; }; That allows me to run pretty much any application that uses ALSA, JACK, or PulseAudio.

That gave me "services.pipewire.alsa" does not exist on 20.09; does this require unstable?

Re: PipeWire: The Linux audio/video bus

#69
post #48

> Second, D-Bus was replaced as the IPC protocol. Instead, a native fully asynchronous protocol that was inspired by Wayland — without the XML serialization part — was implemented over Unix-domain sockets. Taymans wanted a protocol that is simple and hard-realtime safe. I'm surprised to read this; I was under the impression that D-Bus was the de jure path forward for interprocess communication like this. That's not t…

D-Bus isn't suitable for realtime, to get that to work would require additional changes within the D-Bus daemon to add realtime scheduling, and even with all that, it would still introduce latency because it requires an extra context switch from client -> dbus-daemon -> pipewire. Maybe they could have re-used the D-Bus wire format? That's the only bit that might have been suitable.

Re: PipeWire: The Linux audio/video bus

#70
post #18

It's great to see pipewire coming along, pulseaudio development seems to (to a spectator) to have been a little.. well.. https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge... https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge...

Isn't this probably because most developers have shifted focus on PipeWire? I thought both came from more-or-less the same community?
Post reply on HN