The de facto Linux sound-mixing system

Going Even Lower

If your computer is powerful enough, you could try imposing an even smaller buffer size. This might be desirable in some circumstances where delays in sound processing might slightly affect the character of two sounds playing at once when recording.

One strategy that's worth considering is to change the audio latency on the fly, depending on your requirements. You might want to be able to apply real-time effects to a sound when recording it. For example, you might want to add reverb and compression that you can hear in your headphones while you are recording your vocal track with a microphone, and this requires extremely low latency. However, when you have recorded your track and your project enters the mixing stage, you might consider raising the buffer size to make more CPU resources available for things like plugin effects within your digital audio workstation (DAW).

One snag when working with JACK applications is that they may report a false buffer size because the devices are now virtualized under PipeWire. Other applications may have a setting for JACK latency, and that setting may be ignored for the same reason. It would be nice to have more definitive clarity on these matters, but until the Linux audio stack has matured in this area, experiment with the settings until the unwanted audio latency has been eliminated.

Once you've found settings that work well, it's a good idea to turn them into scripts (see Figure 3). As with the earlier example, add the command line that works for a given situation to a script, and save it with an appropriate name (such as pipewire_music.sh). Make it executable by typing

chmod +x pipewire_music.sh
Figure 3: Combine frequently needed command-line sequences into Bash scripts for quick invocation.

Create another script file to set things back to normal. If you set the quantum size to  , it will revert to the default setting as defined in PipeWire's configuration file.

I wouldn't recommend permanently setting the buffer size to a low value inside PipeWire's configuration file. There is always a tradeoff, and setting a low audio buffer size can sap CPU cycles for no real benefit in general use. Applications such as web browsers and video players understand the latency problem and use large buffers to keep CPU usage low. They delay video output by an exact amount to keep it in sync with the audio. You might have noticed that audio sometimes keeps playing for a moment after you have closed a browser tab for this reason.

Pro Audio Profile

PipeWire features a separate audio configuration profile called Pro Audio. You can find the profile selection drop-down menu in the PulseAudio volume control. Go to the speaker icon on your desktop, select Audio Mixer… from the pop-up menu, and then navigate to the Configuration tab.

When you select Pro Audio as the audio profile, PipeWire makes some changes to how it communicates between the application and ALSA so that it is further streamlined for performance. It also makes sure that all inputs and outputs are exposed if you have a device that has more than a basic stereo input and output.

However, the Pro Audio profile also disables a few features that are needed for general desktop use. For instance, PipeWire can handle simultaneous audio streams of varying formats and convert them on the fly, seamlessly from the user's perspective. When you select the Pro Audio profile, some of these features are disabled meaning that some applications won't work properly. For this reason, the Pro Audio profile should only be used when you're working with professional audio applications that need the extra performance and stability at the expense of some potential software incompatibility. Additionally, make a note of the default profile within this part of the user interface so that you can switch back to it for regular desktop use, because there tends to be a confusing array of profiles available.

Routing with PipeWire

Consider an example routing scenario where you want to record the audio output from a web browser such as Firefox into an audio application such as Audacity. For example, you might want to record a drum pattern from a YouTube video to loop it in a music program. Before PipeWire, you could do that, but it involved extra configuration work, and occasionally, the applications wouldn't play ball. PipeWire enables all of this connectivity automatically.

As an example, I'll use qpwgraph to connect Firefox's output to Audacity's input. Generally, qpwgraph is installed along with PipeWire, but if you can't find it on your system, install it using the package manager.

Qpwgraph has much of the look and feel of QjackCtl, the default JACK management utility, which is hardly surprising because it was created by the same author, Rui Nuno Capela. In fact, if desired, you can continue to use QjackCtl to manage JACK client applications. Although the two tools look similar, there is a difference between them, because qpwgraph can manage PulseAudio and ALSA clients as well as JACK clients.

The main criticism I'd level at qpwgraph and other PipeWire utilities is the sheer amount of information that it throws at you (see Figure 4). Every running application that can output or receive sound has a node on the graphing system along with all hardware inputs and outputs. In addition, many applications (such as Ardour) will expose internal sound routings. This adds up to a complex environment that can appear confusing at first.

Figure 4: Phew! Seeing all of the graph nodes at once in qpwgraph can feel overwhelming.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • PipeWire

    In the coming year, PipeWire will replace PulseAudio, resulting in better audio on Linux. If you can't wait, here's what you need to know to get started with PipeWire.

  • PipeWire 1.0 Officially Released

    PipeWire was created to take the place of the oft-troubled PulseAudio and has finally reached the 1.0 status as a major update with plenty of improvements and the usual bug fixes.

  • This Month's DVD

    Ubuntu 21.04 and Fedora 34 Workstation

  • Reaper

    Linux users looking for a professional digital audio workstation can now take advantage of Reaper's large feature set.

  • FOSSPicks

    This month Graham looks at Ardour, FluffyChat, PlugData, Cameractrls, hiSHtory, CadQuery Editor, and more!

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News