Saturday, November 23, 2024

Creating liberating content

Mesa 24.3 Open-Source Graphics...

Mesa 24.3 open-source graphics stack is now available with Vulkan 1.3 conformance for...

NVIDIA 550.135 Graphics Driver...

NVIDIA 550.135 graphics driver is now available for Linux, FreeBSD, and Solaris systems...

Blender 4.3 Open-Source 3D...

Blender 4.3 open-source 3D graphics creation software is now available for download with...

FreeCAD 1.0 Open-Source 3D...

FreeCAD 1.0 open-source 3D parametric modeler is now available for download with numerous...

Pipewire vs PulseAudio: What’s the Difference?

Pipewire vs PulseAudio: What's the Difference?

If you are active in the Linux community, you will often come across the debate on what's better: PipeWire or PulseAudio?

Some users prefer going back to PulseAudio, while others find solving their decade-old audio problems much better. So the question here is: what is the difference between PipeWire and PulseAudio? 🤔

Sure, PipeWire is a relatively new technology, it must have a purpose and which is why it is replacing PulseAudio for many Linux distributions. This does not mean PulseAudio doesn't work whatsoever. It has served very well to its users, but surely has its pros and cons.

Fret not, I shall highlight everything essential regarding the multimedia framework PipeWire and the sound server program, PulseAudio.

The basics of audio on Linux

Pipewire vs PulseAudio: What's the Difference?

Nowadays, every motherboard (PC/laptop) has an internal sound card, a hardware component that is used to convert analog audio signals to digital signals for recording and streaming purposes.

Sure, some can have an external sound card for audio, but that is a rare sight to see.

So, we need some sort of driver (or middleware) to interact with the hardware and work with applications like audio editors on Linux, right?

And that's where the role of ALSA (Advanced Linux Sound Architecture) comes into play.

ALSA (baked into the Linux kernel) provides necessary device drives to read and write from the sound card. You will find multiple applications that directly use the ALSA such as VLC for output, and Audacity, which can directly record audio through ALSA.

The point here is many applications use ALSA API directly without the need for an audio server like PulseAudio or PipeWire.

But you can't rely on ALSA as it will take control of the entire sound device, so you can only use it to handle one application at a time. So no hardware multiplexing.

Due to this reason, we require an audio server like PulseAudio or PipeWire.

The arrival of PulseAudio solved three major problems that we had with the ALSA:

  • Play audio from multiple applications at the same time.
  • It came with advanced features like mixing multiple audio streams, audio streaming, per application volume control, etc.
  • Ease of use.

So here's what the basic audio structure looks like based on prior explanation:

Pipewire vs PulseAudio: What's the Difference?

Now that we have an idea of how the audio works on Linux. Let us dive in deeper to know the difference between the two audio servers that make our Linux experience better.

Suggested Read 📖

How to Record Streaming Audio in Ubuntu Linux
Learn to record voice-over or audio from any streaming music source in Ubuntu using these nifty tools.
Pipewire vs PulseAudio: What's the Difference?

Comparing audio servers: PipeWire vs PulseAudio

We need to know what they are, how they work, and the feature-set to understand how they differ.

Sure, the easy part is — one is newer tech and the other one is an older tech.

Let me highlight the rest of the details below, including a piece of interesting information related to audio servers.

💡
JACK (JACK Audio Connection Kit), an audio server made for professional audio artists that solved one problem with PulseAudio: redirecting output to any input. In simple terms, it worked like a physical patch panel.

An older tech to PulseAudio. The reason it didn't gain popularity is it was complex to use and was incompatible with PulseAudio.

PulseAudio: The old guardian of Linux audio experience

Pipewire vs PulseAudio: What's the Difference?

PulseAudio is a super simple audio server designed for Linux systems. It was initially known as "Polypaudio", and then later renamed.

It was created as a modern alternative to ESD (Enlightened Sound Daemon). ESD was the sound server maintained as part of the GNOME project, as a tech to unify sound drivers for all kinds of architectures.

If it is a POSIX-compliant operating system (distro), PulseAudio can be a sound server system for it.

Furthermore, PulseAudio comes with various plugin modules, which makes it very capable for a lot of use-cases. Not just limited to desktops, PulseAudio is also used in various mobile devices.

PipeWire: Getting the best of PulseAudio and JACK

Pipewire vs PulseAudio: What's the Difference?

PipeWire is a multimedia framework (and an audio server program) that managed to provide advanced features to work with modern audio devices while being a simple utility for end-users.

Remember, what I highlighted about JACK above?

It offered great features, but had compatibility issues with the existing PulseAudio setup. If that was not enough, using it was complex, making it difficult to recommend unless you were an audio professional. On the other hand, PulseAudio was user-friendly and had legacy support, but it had its issues.

So we needed a simple utility, compatible with other audio servers like PulseAudio, addressing all the PulseAudio issues, and offering a better feature set.

That's where PipeWire came to the rescue.

PipeWire is also designed in a way to provide better security when interacting with audio/video devices through containerized applications, supporting Flatpak primarily.

Not just providing better compatibility with newer packages, it also supports Wayland.

How Do They Work?

Pipewire vs PulseAudio: What's the Difference?

PulseAudio utilizes a client/server architecture to function. There can be different clients with various APIs, and local/remote PulseAudio servers.

And, all of it should work flawlessly with the help of modules. Yes, PulseAudio functions through its modules, it is not much by itself but just a daemon for API and hosting modules.

By default, PulseAudio uses the configuration available system-wide. However, you can provide a custom configuration file in the home directory, and the next time you boot up, it will utilize that.

PipeWire works differently without primarily relying on a module system. The daemon is responsible for processing, and a session manager uses the media graph (info on devices, port, and nodes) to decide how to link them all.

Unlike PulseAudio tailored only for consumer audio, PipeWire fulfills all kinds of low-latency requirements for everyday users and professionals (as an alternative to JACK).

I went through hundreds of community posts where users have praised PipeWire for fixing the crackling sound, or they found the perfect fit for their JACK replacement with ease of use and better reliability.

So, it works like it should. And, technically, a superior choice for many.

Key Features

PulseAudio is still in use, even if it is being replaced by PipeWire.

Some of the best features that make PulseAudio a usable tech include:

  • Ability to adjust the volume for each software independently
  • Support for audio multiplexing, letting users play audio from multiple applications at the same time
  • Audio streaming over the TCP server
  • The zero-copy memory architecture of PulseAudio lets you transfer audio data between applications and audio devices without unnecessary copying or buffering for lower latency and better resource management
  • Provides compatibility layers for existing applications to work with it without any modifications
  • Variety of modules to provide all kinds of essential functionalities

PipeWire wins in the feature-set game, which is why it is being preferred over PulseAudio.

So, what are the things that make it stand out? Here, they are:

  • A unified solution that aims to replace PulseAudio and JACK to provide a solution for both basic and professional users
  • Better support for low latency
  • Compatible with PulseAudio and JACK APIs.
  • Virtual support for all the Bluetooth codecs by default
  • Efficient at merging devices and resampling
  • It can dynamically switch between different buffer sizes to adapt to the different latency requirements of different audio applications
  • Flatpak application support
  • Wayland desktop support

Suggested Read 📖

Top 5 Best Audio Editors for Linux [2023]
These awesome free and open source audio editors let you create amazing music in Linux.
Pipewire vs PulseAudio: What's the Difference?

What's my take on PulseAudio vs. PipeWire?

I'll start with "If it ain't broke, don't fix it".😎

Not every Linux distribution has switched to the PipeWire yet, and some users are enjoying audio like they used to do with PulseAudio. I use PulseAudio as it works just fine with my 5.1 surround setup. So, I don't have any reason to make a switch.

For users with modern Bluetooth headphones or if you have a poor audio experience with PulseAudio, you can switch to PipeWire.

The easiest way to do that is to pick a Linux distribution that offers PipeWire out of the box.

If you want to try PipeWire out of curiosity, make sure to create a snapshot of your working system before manually installing it:

Guide to Backup and Restore Linux Systems with Timeshift
This beginner’s guide shows you how to back up and restore Linux systems easily with the Timeshift application.
Pipewire vs PulseAudio: What's the Difference?

from It’s FOSS https://ift.tt/psctIZJ

Get notified whenever we post something new!

spot_img

Create a website from scratch

Just drag and drop elements in a page to get started with Newspaper Theme.

Continue reading

Mesa 24.3 Open-Source Graphics Stack Adds Vulkan 1.3 Conformance for V3DV

Mesa 24.3 open-source graphics stack is now available with Vulkan 1.3 conformance for V3DV, updates for ANV, RADV, and NVK drivers, and improvements for several video games. Here’s what’s new! The post Mesa 24.3 Open-Source Graphics Stack Adds Vulkan 1.3...

NVIDIA 550.135 Graphics Driver Released with Better Linux Kernel 6.11 Support

NVIDIA 550.135 graphics driver is now available for Linux, FreeBSD, and Solaris systems with a few enhancements for Linux users. Here's what's changed! The post NVIDIA 550.135 Graphics Driver Released with Better Linux Kernel 6.11 Support appeared first on 9to5Linux...

Blender 4.3 Open-Source 3D Graphics App Introduces Experimental Vulkan Backend

Blender 4.3 open-source 3D graphics creation software is now available for download with new features and numerous improvements. Here's what's new! The post Blender 4.3 Open-Source 3D Graphics App Introduces Experimental Vulkan Backend appeared first on 9to5Linux - do not...

Enjoy exclusive access to all of our content

Get an online subscription and you can unlock any article you come across.