Image of an arrow

PipeWire et Linux embarqué: démonstration d’un système audio multi-ports sur i.MX8 (2ème partie)



[L’introduction est en français, le reste du texte en anglais]

PipeWire, implémentation et évaluation

Dans le dernier article, nous avons préparé un système audio sur lequel nous pourrions remplacer le serveur de son. De plus, nous avons expliqué les principaux concepts de JACK et PulseAudio en matière d’enregistrement et de lecture audio. Cette deuxième partie présente PipeWire, comment l’utiliser dans notre système audio et mesure ses performances.


PipeWire is an open-source project for handling multimedia pipelines in Linux system.  There is already a very good introduction about PipeWire which was made by Bootlin that everyone can refer to, which can be accessed here. The aim of this project is to provide a low-latency, graph-based processing engine on top of audio and video devices. Each element of the graph (sound device, application…) is called a node. The whole PipeWire system graph can be observed by running this command:

 $pw-dot -a -d -9 

This command will show every node in the Pipewire graph including the audio input/output nodes, client nodes and library nodes with details. Here is a view of our project’s entire graph.

In this project, we use WirePlumber as a modular session/policy manager. WirePlumber is an advanced session/policy manager, based on Glib/GObject. Its purpose is  to wrap around PipeWire API, by using the daemon’s modules or the external tools to manage PipeWire functionality.


During initialization, WirePlumber creates the nodes for Alsa playback and capture devices. It will also create the nodes for its clients, which are applications using PipeWire as server. A node consists of multiple ports, classified by their direction: input or output. PipeWire will use the links to connect these ports between different nodes together. A node created from Alsa devices with only the input ports is called an « Audio/Sink » and those with only the output ports is called an « Audio/Source ».

You can see here how PipeWire creates and connects the ports between CamillaDSP ports (cpal_client_*) and our Alsa device ports (*_sound_cs42448) together. The linking is done by a port mapping in API, but these links are interactive and can be manipulated by user. This means we can delete, create, or redirect a link to another port on the fly.

PipeWire can be used to replace both PulseAudio and JACK, by providing a  PulseAudio-compatible server implementation and an ABI-compatible libraries for JACK clients.

JACK and PulseAudio replacement

To replace JACK server by PipeWire for running a JACK client, we must:

  1. Run PipeWire and Wireplumber (by program or by service).
  2. Run pw-jack right before the JACK Client in one command line. For example in our case:
     $pw-jack camilladsp /etc/camilladsp/jackconfig.conf 

pw-jack will force the JACK client to use PipeWire’s reimplementation of JACK libraries by changing the LD_LIBRARY_PATH environment variable, instead of the standard JACK libraries .

To replace PulseAudio server by PipeWire for running a PulseAudio client, we must:

  1. Run PipeWire, Wireplumber and PipeWire-pulse. PipeWire-pulse is a PulseAudio-compatible daemon that integrates with the PipeWire media server, which can be used to replace the standard PulseAudio.
  2. Check current daemon information by:
     $pactl info 

    You should see this in the output: “Server Name: PulseAudio (on PipeWire x.x.x)”. This indicates that PipeWire daemon will be used by the PulseAudio clients instead of a standard Pulseaudio server.

  3. Run the PulseAudio client.

From the point of view of applications, they are still using JACK and PulseAudio API, but these APIs are in fact provided by PipeWire. This makes it possible for us to run at the same time a JACK client and a PulseAudio client, which required specific configuration before.

Example of running at a same time a JACK client, a PulseAudio client and a PipeWire client


Schema illustrating the way PulseAudio and JACK applications are supported


Performance Results

Wim Taymans, the developer of PipeWire, has already done a complete article about PipeWire performance, you can see it here. However, these tests are run on the desktop platforms and the results might be different for embedded systems.

In this article, we compare PipeWire with JACK, PulseAudio, and direct ALSA access through alsa-libs in the context of an embedded platform (i.MX8 Nano Ultralite). CPU usage and latency are the main comparison factors.

CamillaDSP with only Alsa-lib

We first test the performance when CamillaDSP is running only with Alsa, which means no sound server is used. In this case, CamillaDSP directly uses the Alsa-lib API to exchange audio data with the device through ALSA.

With htop, we can see that the process “CamillaDSP” consumes 28% of the CPU with three small threads.


The oscilloscope shows a latency around 4 ms:


As you can see, these results show a very good performance. The limitation is that only CamillaDSP can read/write samples to the audio device. If there is only one application, this would probably be the most efficient solution, otherwise this may be a limitation for complex use-cases involving multiple applications.

CamillaDSP with JACK and PipeWire-JACK

We compared JACK and PipeWire with 256 samples buffers for both sound servers. The CPU load measurements with CamillaDSP running, measured with htop, are shown below:

CamillaDSP with JACK serverCamillaDSP with PipeWire server


As can be seen, CamillaDSP running with Pipewire server consumes much less CPU, almost half of what it consumes when running with JACK server !

Then, we changed the value of buffer size in two cases in a range from 32 samples to 1024 to test the latency. For each buffer size, the full audio chain latency is measured with the oscilloscope. The results are displayed below:


Our results are similar to the results of Wim Taymans in his article. For small fixed buffer size, JACK seems to do better than PipeWire. But starting from buffer of 128 samples, PipeWire gradually becomes better in terms of system latency.

CamillaDSP with PulseAudio and PipeWire-Pulse

PulseAudio uses a dynamic buffer size to make the system as balanced as possible. In our case, the latency we measured is about 60 ms.

PipeWire-Pulse also uses a dynamic buffer latency, but we can force Pipewire to use a fixed value or to specify the maximum buffer size in its configuration. This means PipeWire-Pulse can have a better latency compare to PulseAudio if we ignore all other aspects, concerning the CPU usage and the configuration complexity. But to fairly compare CPU load, we set the latency of PipeWire-Pulse client to 60ms.

CamillaDSP with PulseAudio serverCamillaDSP with PipeWire server


The above results show that, when compared to standard PulseAudio at the same latency, PipeWire used more CPU due to having to run PipeWire daemon and PipeWire-Pulse daemon at the same time. This causes a high CPU usage in general although the latency is not too outstanding.

CPU usage of four previous cases when fixing the same latency

To make a CPU load comparison between all sound servers, we manually set  their latency to 60ms. The following table details the CPU load  comparison at this set latency, to show which solution is the most  efficient.

CamillaDSP with JACKCamillaDSP with PipeWire-jack


CamillaDSP with PulseAudioCamillaDSP with PipeWire & PipeWire-Pulse


These results show that, while PipeWire itself is an efficient solution, the use of PipeWire-pulse hinders its performance. This makes it a good candidate for real-time designs as a JACK replacement, where it can be used to gain CPU load for other processes. However, as of now, further developments or configuration optimizations are required to make it a Pulseaudio replacement in use-cases where JACK compatibility is not needed.


PipeWire is still a young project compared to JACK and PulseAudio but it has really met the majority of users expectations in the embedded projects about its major strides, its convenience of new features and its performance. With the reimplementation of JACK and PulseAudio APIs, PipeWire does not require users to do any change to their application. Instead, users can still take advantage of its strengths, even combine them together.

In addition, the developer’s ambition for PipeWire is to be a multimedia platform, not only an audio server, which can also control image streams, so the future of PipeWire is to be able to manipulate the whole multimedia system in a project. This will be extremely convenient for developers who only have to master and to maintain one back-end technology and rely on established clients.

Articles similaires

Image of an arrow

[L’introduction est en français, le reste du texte en anglais]   L’économie d’énergie a toujours été une préoccupation majeure dans les systèmes embarqués, puisque par définition, ils peuvent avoir des contraintes énergétiques. Bien sûr, aujourd’hui, l’économie d’énergie est toujours au cœur des discussions. L’économie d’énergie est toujours un ensemble de compromis. En termes de disponibilité […]

Thumbnail image

L’équipe de Savoir-faire Linux est fière d’annoncer la sortie de la version v2.1 de l’extension VSCode pour Yocto. Le projet Yocto, avec le financement du Sovereign Tech Fund, à entrepris d’étendre et moderniser cette technologie pour les 5 années à venir. Au sein de cette initiative, Savoir-faire Linux s’est vu confier la tâche de maintenir […]

Thumbnail image

[L’introduction est en français, le reste du texte en anglais] TL;DR Les systèmes audio utilisent souvent des périphériques asynchrones, qui ont besoin d’être synchronisés avec du ré-échantillonnage. Nos mesures montrent que la charge CPU du ré-échantillonnage peut atteindre presque 30% d’un cœur sur un SoC i.MX8M Nano. Utiliser l’endpoint de feedback de l’USB gadget UAC2 […]


Paris, le jeudi 1er juin 2023 – L’entreprise franco-québécoise Savoir-faire Linux, chef de file de l’innovation technologique et de la transformation numérique open source au Canada et en Europe lance sa première offre de support commercial open source pour le projet Seapath dans le cadre de deux évènements d’importance majeure pour l’industrie de l’énergie : Le […]

Lauréats Trophées Fournisseus RTE

Rennes, le vendredi 2 décembre 2022 – Mardi soir s’est tenue la cérémonie des Trophées des fournisseurs 2022 de RTE, le gestionnaire du réseau de transport d’électricité haute tension en France, récompensant les meilleures solutions des fournisseurs sur des catégories en lien avec les enjeux actuels de RTE. Pour cette seconde édition, RTE a remis […]