We're hiring!
*

PipeWire, the media service transforming the Linux multimedia landscape

Julian Bouzas avatar

Julian Bouzas
March 05, 2020

Share this post:

PipeWire 0.3 was released a few days ago, marking a big step forward in the effort of making this emerging media service the core layer of all multimedia on Linux.

A huge effort is currently underway to bring the Linux desktop into the future with the help of containerization technologies such as Flatpak. One of the goals of this exercise is to create a clear security barrier separating the applications from each other and from the system. The media stack is one area where the applications normally fail to co-operate with this model, requiring direct access to the hardware because large amounts of data need to be exchanged and a low latency is often critical. PipeWire is the missing piece to this puzzle, allowing applications to access hardware devices in an efficient, yet secure manner.

From video to audio

PipeWire was originally created to only handle access to video resources and co-exist with PulseAudio. Earlier versions have already been shipping in Fedora for a while, allowing Flatpak applications to access video cameras and to implement screen sharing on Wayland. Eventually, PipeWire has ended up handling any kind of media, to the point of planning to completely replace PulseAudio in the future. The new 0.3 version is marked as a preview for audio support.

But why replace PulseAudio? Although PulseAudio already provides a working intermediate layer to access audio devices, PipeWire has to offer more features that PulseAudio was not designed to deliver, starting with a better security model, which allows isolation between applications and secure access from within containers.

Another interesting feature of PipeWire is that it unifies the two audio systems used on the desktop, JACK for low-latency professional audio and PulseAudio for normal desktop use-cases. PipeWire was designed to be able to accommodate both use cases, delivering very low latency, while at the same time not wasting CPU resources. This design also makes PipeWire a much more efficient solution than PulseAudio in general, making it a perfect fit for embedded use cases too.

Luckily, once PipeWire is stable enough to be the default audio service on Linux, audio applications will not need to be updated straight away because compatibility APIs for ALSA, PulseAudio and JACK are also included in the project, making the applications connect transparently to the PipeWire daemon without any code changes and even without recompiling. However, we expect that most applications will eventually be updated to use PipeWire’s native API to clean up their dependencies and to be able to use more advanced PipeWire features. Thankfully, applications that use GStreamer can easily switch to use the GStreamer elements that are also provided by PipeWire, making this port trivial.

The session manager

Just like PulseAudio, PipeWire is a daemon that runs in the background and acts as an intermediate layer between multimedia applications (clients) and devices. This intermediate layer's main role is to connect these applications to the devices, allowing them to play or capture media, while respecting access permissions.

A key difference to PulseAudio is how PipeWire does session and policy management. While PulseAudio comes with its own predefined logic about which applications to connect to which device(s) and when, PipeWire itself does nothing about that. PipeWire only provides the means to create media streams, while the management logic is implemented in an external component, the session manager. Since this management logic is dependent on the platform and the use cases that this platform is dealing with, having an external session manager allows developers to more easily adapt PipeWire's behavior to any kind of situation.

At Collabora, as part of our work for Automotive Grade Linux, we have been developing an extensible session manager, WirePlumber. This has been necessary for integrating PipeWire into AGL, since PipeWire itself only ships with an example session manager that does not scale for anything other than simple desktop use cases. WirePlumber currently focuses on automotive and other embedded use cases, but we will soon be adding desktop support, making it possible to replace the example session manager for desktop testing. We will be blogging more about WirePlumber in the future, explaining the motivation for writing it, our design choices and further progress that we make in its development.

Learn more

George Kiagiadakis presents "PipeWire in the Automotive Industry", recorded last month at FOSDEM 2020.

Comments (0)


Add a Comment






Allowed tags: <b><i><br>Add a new comment:


Search the newsroom

Latest Blog Posts

Understanding computer vision and AI, part 1

13/08/2020

Following our recent presentation at OSSummit, many showed interest in learning more about solving real-world problems with computer vision.…

Testing Weston DRM/KMS backends with virtme and VKMS

07/08/2020

Recent work in Weston, the industry-standard Wayland compositor, has enabled DRM/KMS backends to be tested in the absence of real hardware,…

An introduction to Linux kernel initcalls

14/07/2020

Initcalls, which serve to call functions during boot, were implemented early on in the development of the Linux Kernel. Read on as we take…

Deep dive into OpenGL over DirectX layering

09/07/2020

Earlier this year, we announced a new project with Microsoft: the implementation of OpenCL & OpenGL to DirectX translation layers. Here's…

Using syzkaller, part 4: Driver fuzzing

26/06/2020

Syzkaller is much needed tool for Linux kernel testing and debugging. With some work, it can also be enhanced to find bugs in specific drivers,…

Cross building Rust GStreamer plugins for the Raspberry Pi

23/06/2020

Previously, we discussed about how Rust can be a great language for embedded programming. In this article, we'll explain an easy setup to…

Open Since 2005 logo

We use cookies on this website to ensure that you get the best experience. By continuing to use this website you are consenting to the use of these cookies. To find out more please follow this link.

Collabora Ltd © 2005-2020. All rights reserved. Privacy Notice. Sitemap.