this post was submitted on 23 Feb 2024
206 points (97.7% liked)

Linux

48102 readers
686 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] folkrav@lemmy.ca 5 points 8 months ago (1 children)

Both were just a pain in their own right, IMHO. My previous Focusrite interface was quite fiddly to get working with ALSA and just worked OOTB with Pulseaudio. I also don’t miss messing with ALSA/JACK at all.

Pipewire has pretty much been a drop-in replacement for me, with how it can act as a Pulseaudio backend.

[–] SpaceCadet@feddit.nl 3 points 8 months ago (2 children)

Possibly hardware dependent?

I always had audio hardware that was well supported by ALSA, I never had any ALSA issues until applications stopped supporting it.

[–] Jordan_U@lemmy.ml 4 points 8 months ago* (last edited 8 months ago)

Pulseaudio used features of sound cards (most prominently the hardware read pointer) that ALSA/dmix alone never used.

ALSA/dmix could allow you to get the same power savings as pulseaudio if you set the hardware ring buffer size to, say, 2 seconds.

And that would be fine of you were just playing some music, but if you were also chatting and wanting to get prompt notification sounds they would always be delayed between 0 and 2 seconds depending on where the hardware read pointer happened to be when the system tried to play a notification sound.

ALSA/dmix could also allow you to set a tiny buffer size. Then your music would play, and your notification sounds would play promptly too. But if you were just playing music your CPU would never be able to go into the lower power sleep states because it would need to wake up every centisecond to service the tiny ring buffer.

That would kill your battery life.

Pulseaudio's (terribly named) "glitch free" audio feature was the first solution for Linux that allowed you to get power savings and low-ish latency. Your mp3 player filled up the ring buffer once every two seconds, and if a notification came in pulseaudio would look at where the hardware read pointer was, take the contents of the buffer that was just about to be read, and mix the notification sound into it, writing the newly mixed sound data to the buffer just before the sound card read it.

So, from the user's perspective nothing interesting seemed to happen, but they get better battery life and things like notifications or game sounds work like they expect them to.

ALSA drivers would commonly advertise support for accurately and precisely reporting the position of the hardware pointer, but since nothing actually used that info before, many drivers gave incorrect results, which would only cause problems when using pulseaudio.

[–] Oisteink@feddit.nl 1 points 8 months ago (2 children)

Does pipewire interface directly to drivers or is it user-space magic on top of alsa like pulseaudio?

[–] SpaceCadet@feddit.nl 2 points 8 months ago

It runs on top of ALSA, as far as I know.

[–] Peter1986C@lemmings.world 0 points 8 months ago

I believe it is U-space on top, but I could be wrong.