Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

What other apps and distros do you use to round out your studio?

Moderators: khz, MattKingUSA

Senbee
Established Member
Posts: 40
Joined: Wed Aug 29, 2018 10:40 pm
Location: Italy
Been thanked: 7 times
Contact:

Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Senbee »

Hi everybody,
I'm trying to use the super-new LTS by Canonical and I'm trying to do almost everything on flatpak, being it so updated and complete about music.
Here's a small guide, a work in progress I'd like to share and edit with you.

I'm also trying to use pipewire, to solve the communication problem between system applications and sandboxed flatpak ones. Snap is totally useless and apt causes me some troubles with KXStudio packages.

INSTALLATION

- So, first thing to do: update the system.

Code: Select all

sudo apt update; sudo apt full-upgrade -y
- Than, install flatpak, some system tools, pipewire as sound manager, and Carla from Apt to load Windows VSTs:

Code: Select all

sudo apt install -y \
curl \
default-jre \
flatpak \
fonts-crosextra-caladea fonts-crosextra-carlito \
gnome-shell-extensions gnome-shell-extension-prefs \
gnome-system-tools \
gnome-tweaks \
gdebi \
icedtea-netx \
net-tools \
p7zip p7zip-full p7zip-rar \
python3-pip \
soundconverter \
synaptic \
ubuntu-restricted-extras \
unrar \
pipewire-audio-client-libraries libspa-0.2-bluetooth libspa-0.2-jack \
carla carla-bridge-linux32 carla-bridge-linux64 carla-bridge-win64 carla-bridge-win32
- In order to enable pipewire wide, remove pipewire-media-session while installing Wireplumber, copy configuration file to pipewire ones, remove pulseaudio bluetooth module and enable the service:

Code: Select all

sudo apt install -y wireplumber pipewire-media-session-; sudo cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/; sudo cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-*.conf /etc/ld.so.conf.d/; sudo ldconfig; sudo apt remove -y pulseaudio-module-bluetooth; systemctl --user --now enable wireplumber.service
(credits: Ubuntuhandbook.org)

- Enable flatpak repos:

Code: Select all

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- Create plugin folders:

Code: Select all

mkdir ~/.vst; mkdir ~/.vst3; mkdir ~/.lv2
- Restart the system

- Check if pipewire is working:

Code: Select all

pactl info
There has to be a line like this:

Code: Select all

Server name: PulseAudio (on PipeWire 0.3.48)
- Install all the rest of music software from flatpak:

Code: Select all

flatpak install -y \
ar.com.tuxguitar.TuxGuitar \
ch.x29a.playitslowly \
com.giadamusic.Giada \
com.github.Bleuzen.FFaudioConverter \
com.github.childishgiant.mixer \
com.github.muriloventuroso.givemelyrics \
com.github.wwmm.easyeffects \
com.gitlab.azymohliad.Qwertone \
com.polyphone_soundfonts.polyphone \
com.rosegardenmusic.rosegarden \
io.github.gillesdegottex.FMIT \
io.github.muse_sequencer.Muse \
io.github.seadve.Mousai \
io.lmms.LMMS \
net.mediaarea.MediaInfo \
net.sf.nootka \
net.sonic_pi.SonicPi  \
net.sonobus.SonoBus \
net.sourceforge.VMPK \
org.ardour.Ardour \
org.audacityteam.Audacity \
org.denemo.Denemo \
org.freedesktop.LinuxAudio.Plugins.ADLplug \
org.freedesktop.LinuxAudio.Plugins.ArtyFX \
org.freedesktop.LinuxAudio.Plugins.AVLDrums \
org.freedesktop.LinuxAudio.Plugins.Calf \
org.freedesktop.LinuxAudio.Plugins.CAPS \
org.freedesktop.LinuxAudio.Plugins.ChowTapeModel \
org.freedesktop.LinuxAudio.Plugins.CMT \
org.freedesktop.LinuxAudio.Plugins.Dexed \
org.freedesktop.LinuxAudio.Plugins.DISTRHO-Ports \
org.freedesktop.LinuxAudio.Plugins.DPF-Plugins \
org.freedesktop.LinuxAudio.Plugins.DragonflyReverb \
org.freedesktop.LinuxAudio.Plugins.DrumGizmo \
org.freedesktop.LinuxAudio.Plugins.Fabla \
org.freedesktop.LinuxAudio.Plugins.Geonkick \
org.freedesktop.LinuxAudio.Plugins.gmsynth \
org.freedesktop.LinuxAudio.Plugins.Guitarix \
org.freedesktop.LinuxAudio.Plugins.GxPlugins \
org.freedesktop.LinuxAudio.Plugins.Helm \
org.freedesktop.LinuxAudio.Plugins.KapitonovPluginsPack \
org.freedesktop.LinuxAudio.Plugins.LSP \
org.freedesktop.LinuxAudio.Plugins.MDA \
org.freedesktop.LinuxAudio.Plugins.Ninjas2 \
org.freedesktop.LinuxAudio.Plugins.OBXd \
org.freedesktop.LinuxAudio.Plugins.reMID-lv2 \
org.freedesktop.LinuxAudio.Plugins.setBfree \
org.freedesktop.LinuxAudio.Plugins.sfizz \
org.freedesktop.LinuxAudio.Plugins.Sorcer \
org.freedesktop.LinuxAudio.Plugins.SoSynthLV2 \
org.freedesktop.LinuxAudio.Plugins.Surge \
org.freedesktop.LinuxAudio.Plugins.Surge-XT \
org.freedesktop.LinuxAudio.Plugins.swh \
org.freedesktop.LinuxAudio.Plugins.TAP \
org.freedesktop.LinuxAudio.Plugins.Tunefish4 \
org.freedesktop.LinuxAudio.Plugins.VL1Emulator \
org.freedesktop.LinuxAudio.Plugins.WhiteElephantAudio \
org.freedesktop.LinuxAudio.Plugins.WolfShaper \
org.freedesktop.LinuxAudio.Plugins.x42Plugins \
org.freedesktop.LinuxAudio.Plugins.Yoshimi \
org.freedesktop.LinuxAudio.Plugins.ZamPlugins \
org.freedesktop.LinuxAudio.Plugins.ZynFusion \
org.gnome.EasyTAG \
org.guitarix.Guitarix \
org.hydrogenmusic.Hydrogen \
org.kde.minuet \
org.musescore.MuseScore \
org.pipewire.Helvum \
org.rncbc.qpwgraph \
org.rncbc.qsynth \
org.rncbc.qtractor \
org.sugarlabs.MusicBlocks \
org.zrythm.Zrythm
(always choose 21.08 if asked)

OTHER TOOLS

Aether
https://github.com/Dougal-s/Aether/releases
Download zip and unzip .lv2 folder in ~/.lv2

Airwindows plugins
https://www.airwindows.com/
Download from “Download LinuxVSTs” and extract all the .so files in ~/.vst

Cardinal
https://github.com/DISTRHO/Cardinal/releases/tag/22.03
Download from "Linux x86_64" and extract .lv2 folders in ~/.lv2

Monique
https://github.com/surge-synthesizer/mo ... h/releases
Download zip for Linux and extract .vst3 folder in ~/.vst3

Odin2
https://www.thewavewarden.com/odin2
“Linux (generic)” → Download → extract .vst3 folder in ~/.vst3 and .lv2 folder in ~/.lv2

Wolf Spectrum
https://github.com/wolf-plugins/wolf-spectrum/releases
Download lv2 zip and extract .lv2 folder in ~/.lv2, download vst2 zip and extract .so file in ~/.vst, download Jack zip and extract the executable file in any folder you want, you'll launch it with a simple double click. It will be visible in Jack, Carla, qpwgraph and other connectors

String Machine
https://software.opensuse.org/download. ... ng-machine
Download the latest deb (20.04), don't install it, right click on the deb file → open with... → archive manager. Then extract only data.tar.xz / . / usr / lib / lv2 / string-machine.lv2 folder in ~/.lv2

Stone Phaser
https://github.com/jpcima/stone-phaser/releases
Download the Linux64.zip file (not the .deb one), and extract the two .lv2 folders in ~/.lv2

B.Low
https://github.com/sjaehn/BLow/releases
Download the tar.xz file and extract the .lv2 folder in ~/.lv2

B.Slizr
http://mirrors.kernel.org/ubuntu/pool/u ... _amd64.deb
Download .deb file (don't install it), right click on it → open with... → archive manager → data.tar.xz → . → ust → lib → lv2 → extract the .lv2 folder in ~/.lv2

B.Jumblr
https://github.com/sjaehn/BJumblr/releases/tag/1.6.8
Download the tar.xz file and extract the .lv2 folder in ~/.lv2

B.Choppr
https://github.com/sjaehn/BChoppr/releases
Download the lv2.zip file and extract the .lv2 folder in ~/.lv2

B.Schaffl
https://github.com/sjaehn/BSchaffl/releases
Download the tar.xz file and extract the .lv2 folder in ~/.lv2

B.Oops
https://github.com/sjaehn/BOops/releases
Download the tar.xz file and extract the .lv2 folder in ~/.lv2

B.SEQuenzr
https://github.com/sjaehn/BSEQuencer/releases
Download the tar.xz file and extract the .lv2 folder in ~/.lv2

B.Shapr
B.Shapr can't be installed alone as lv2, and there's no flatpak version available yet. So just install it as a deb, copy lv2 folder and uninstall, like this:

Code: Select all

sudo apt install bshapr
cp -r /usr/lib/lv2/BShapr.lv2 ~/.lv2/
sudo apt remove bshapr
Then, launch Ardour and update all the plugins: Windows → Plugin manager → Re-scan all

ARPEGGIATORS

Unluckily, there are still no arpeggiator plugins as flatpak. To make them work, just install them as vst or lv2 in user space, load them into the system installed Carla, then make an insert in Ardour and connect it via Ardour itself or qpwgraph or Carla itself.
In this way, MIDI clock doesn't work, so in the arpeggiator you have to set the same tempo of your Ardour project. If the project has tempo changes or ramps it's a problem, but come on, who uses arpeggiators with time ramps? :mrgreen:

LibreArp
https://librearp.gitlab.io/
"Download” → “Linux 64bit LV2”, extract .lv2 folder in ~/.lv2
It won't work in Ardour (it's enabled but it returns a generic error when launched), so load it in Carla and make an Ardour insert.

QMidiArp
Just install it from apt:

Code: Select all

sudo apt install qmidiarp
You have to load it in Carla and make an insert in Ardour, same as above.

JJAZZLAB

- Download Linux zip from from https://www.jjazzlab.com/en/download/
- extract the zip to any folder you like
- Download soundfonts:

Code: Select all

wget https://musical-artifacts.com/artifacts/1036/JJazzLab-SoundFont.sf2
- Install Fluidsynth:

Code: Select all

sudo apt install fluidsynth
- Every time you have to enable a virtual MIDI port:

Code: Select all

sudo modprobe snd-virmidi midi_devs=1
- Or, you can make it permanent like this:

Code: Select all

sudo nano /etc/modules
Add this at the end:

Code: Select all

snd-virmidi
Save and exit (Ctrl+x, y, enter)
Then open this:

Code: Select all

sudo nano /etc/modprobe.d/snd-virmidi_options.conf
add this at the end:

Code: Select all

options snd-virmidi midi_devs=1
Save and exit (Ctrl+x, y, enter)

In order to use it, you have to:
- launch Qsynth (already installed from flatpak)
- in Qsynth, load the soundfont (Setup → Soundfonts → Load)
- Launch JJazzLab double clicking on bin/jjazzlab file in jjazzlab folder
- copy the configuration only from screenshots number 7 and 8 from this page:
https://github.com/jjazzboss/JJazzLab-X ... idsynth.md

You have a lot of free resources for JJazzlab, you have to download and extract them in ~/JJazzLab/Rhythms
- zips from here: http://www.jososoft.dk/yamaha/styles/styles.htm
- zips from here: https://www.a-mc.biz/makemusic/browse-s ... ng-styles/
- here a lot of useful stuff: https://www.jjazzlab.com/en/resources/

HOWTO

- Change sample frequency on the fly:

Code: Select all

pw-metadata -n settings 0 clock.force-rate 44100
(default is 48000)

- Change frame/buffer period on the fly:

Code: Select all

pw-metadata -n settings 0 clock.force-quantum 512
(default is 1024)

- If you reduce font scaling from Gnome Tweaks, you'll have to launch Mixxx in this way:

Code: Select all

export QT_AUTO_SCREEN_SCALE_FACTOR=0; flatpak run org.mixxx.Mixxx
- To make connections, you can use qpwgraph. Also Helvum is OK. Of course Carla and QJackCtl are still good.

- To load Windows VSTs or other plugins the sandboxed applications won't see, you have to launch Carla, load any VST in it, and then connect them to Ardour via Carla patchbay or qpwgraph. If you find a way to send MIDI clock to Carla in order to sync delays or arpeggiators to Ardour's tempo... please tell me :-)
Last edited by Senbee on Fri May 20, 2022 6:38 am, edited 5 times in total.
I'm a SUDO wrestler - Italy - Ubuntu 22.04 - Ardour 6.9 - www.stefanodroghetti.it - www.youtube.com/user/SenbeeNorimaki - www.soundcloud.com/stefano-droghetti
User avatar
sysrqer
Established Member
Posts: 2201
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 123 times
Been thanked: 74 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by sysrqer »

Are you getting all your plugins through flatpak? I've just installed the latest bitwig beta which is in flatpak but it cannot access system installed plugins. I've tried adding the paths into flatseal but still doesn't work.
Senbee
Established Member
Posts: 40
Joined: Wed Aug 29, 2018 10:40 pm
Location: Italy
Been thanked: 7 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Senbee »

You can't see system plugins in flatpak (sandboxed) applications, you can't see flatpak installed plugins in system applications.

So, because there a lot more updated applications and updated plugins in flatpak repos than in apt, I install everything I can from flatpak, then I install Carla by apt, then I load in Carla all the "only apt" things and connect them to flatpak installed Ardour or any other sandboxed application via qpwgraph.
Also, everything you can extract in ~/.lv2 or ~/.vst ~/.vst3 can be seen systemwide.

I'll make some screenshot later :-)
I'm a SUDO wrestler - Italy - Ubuntu 22.04 - Ardour 6.9 - www.stefanodroghetti.it - www.youtube.com/user/SenbeeNorimaki - www.soundcloud.com/stefano-droghetti
User avatar
wjl
Established Member
Posts: 186
Joined: Fri Mar 17, 2017 12:27 pm
Location: near Frankfurt, Germany
Has thanked: 4 times
Been thanked: 4 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by wjl »

Thanks Senbee - just linked to this from my blog over at https://wolfgang.lonien.de/2022/05/ubun ... all-guide/
more about me on my blog
Kott
Established Member
Posts: 624
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 25 times
Been thanked: 73 times

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Kott »

Senbee wrote: Fri May 13, 2022 10:51 am You can't see system plugins in flatpak (sandboxed) applications, you can't see flatpak installed plugins in system applications.
What if flatpaked apps and plugin has different libraries version? gtk or glibc (not sure that it's possible in flatpak).
Senbee
Established Member
Posts: 40
Joined: Wed Aug 29, 2018 10:40 pm
Location: Italy
Been thanked: 7 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Senbee »

Kott wrote: Fri May 13, 2022 12:26 pm
Senbee wrote: Fri May 13, 2022 10:51 am You can't see system plugins in flatpak (sandboxed) applications, you can't see flatpak installed plugins in system applications.
What if flatpaked apps and plugin has different libraries version? gtk or glibc (not sure that it's possible in flatpak).
I think it works because they are all sandboxed, anyway. Or at least one of them is sandboxed. So every plugin loads its own version of glibc and so on. Connections between applications are made only via qpwgraph, once all is loaded.
I'm a SUDO wrestler - Italy - Ubuntu 22.04 - Ardour 6.9 - www.stefanodroghetti.it - www.youtube.com/user/SenbeeNorimaki - www.soundcloud.com/stefano-droghetti
Senbee
Established Member
Posts: 40
Joined: Wed Aug 29, 2018 10:40 pm
Location: Italy
Been thanked: 7 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Senbee »

wjl wrote: Fri May 13, 2022 12:21 pm Thanks Senbee - just linked to this from my blog over at https://wolfgang.lonien.de/2022/05/ubun ... all-guide/
Thank you so much, I'm honored to be in your blog!
I'm a SUDO wrestler - Italy - Ubuntu 22.04 - Ardour 6.9 - www.stefanodroghetti.it - www.youtube.com/user/SenbeeNorimaki - www.soundcloud.com/stefano-droghetti
Kott
Established Member
Posts: 624
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 25 times
Been thanked: 73 times

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Kott »

Senbee wrote: Fri May 13, 2022 1:12 pm
Kott wrote: Fri May 13, 2022 12:26 pm
Senbee wrote: Fri May 13, 2022 10:51 am You can't see system plugins in flatpak (sandboxed) applications, you can't see flatpak installed plugins in system applications.
What if flatpaked apps and plugin has different libraries version? gtk or glibc (not sure that it's possible in flatpak).
I think it works because they are all sandboxed, anyway. Or at least one of them is sandboxed. So every plugin loads its own version of glibc and so on. Connections between applications are made only via qpwgraph, once all is loaded.
I mostly meant host+plugin, they work in the same space. Very few plugins have external dependencies, but they are - qmidiarp, calf, and it can lead to problems if the host has dynamically linked with Qt or GTK.
If You haven't any issues with plugins - good. I'll test flatpak someday :)
Senbee
Established Member
Posts: 40
Joined: Wed Aug 29, 2018 10:40 pm
Location: Italy
Been thanked: 7 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Senbee »

Everything works so far, I try to test everything before writing it in the guide.
Anyway, Calf plugins and Ardour come both from flatpak in this guide so they work fine together. I don' t know... Please tell me what to try: if I can try some example of possible conflict I'd be glad to. :-)
I'm a SUDO wrestler - Italy - Ubuntu 22.04 - Ardour 6.9 - www.stefanodroghetti.it - www.youtube.com/user/SenbeeNorimaki - www.soundcloud.com/stefano-droghetti
Kott
Established Member
Posts: 624
Joined: Thu Mar 21, 2013 12:55 am
Location: Vladivostok
Has thanked: 25 times
Been thanked: 73 times

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Kott »

Senbee wrote: Fri May 13, 2022 1:46 pm Everything works so far, I try to test everything before writing it in the guide.
Anyway, Calf plugins and Ardour come both from flatpak in this guide so they work fine together. I don' t know... Please tell me what to try: if I can try some example of possible conflict I'd be glad to. :-)
I see no qmidiarp in flathub (and can't recall any other Qt linked plugin now). At least Calf works in other hosts, and it's good. Are you on X11 or Wayland?
It's important actually to see how the "audio stuff" works with the modern things like Wayland, PipeWire, FlatPak. Thank You for the testing and sharing.
Senbee
Established Member
Posts: 40
Joined: Wed Aug 29, 2018 10:40 pm
Location: Italy
Been thanked: 7 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Senbee »

Yes I'm on wayland. And I really thank you for your feedback.

No, there's not QMIDIArp in flatpak, mostly because it doesn't work as a single plugin but it needs plugin + application, as you say.
That's why I tend to use simpler arpeggiators, like LibreArp (in the guide).

Anyway you can always use an application (no matter how it's installed), launch it and connect it to flatpak Ardour.
For QmidiArp I just installed it as always:

Code: Select all

sudo apt install qmidiarp
then I launched it, and connected it to Ardour via qpwgraph (I guess I can do the same with Carla or QJackCtl), added an arpeggiator to the tab bar, chose a template, pressed Play and it works perfectly:

Image

Obviously these connections are ok for recording. In order to make an Ardour MIDI track to send MIDI to QMidiArp you have to make different connections, with an insert, for example:

Image
I'm a SUDO wrestler - Italy - Ubuntu 22.04 - Ardour 6.9 - www.stefanodroghetti.it - www.youtube.com/user/SenbeeNorimaki - www.soundcloud.com/stefano-droghetti
User avatar
bluzee
Established Member
Posts: 253
Joined: Mon Nov 30, 2020 11:43 pm
Has thanked: 11 times
Been thanked: 55 times

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by bluzee »

Curious what the hard drive space requirement is with everything from Flatpak?
Senbee
Established Member
Posts: 40
Joined: Wed Aug 29, 2018 10:40 pm
Location: Italy
Been thanked: 7 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by Senbee »

A lot :-)
I have installed a lot of other stuff via flatpak: video edit, publishing, raster & vector graphics, 3D graphics software and more, so I can't tell exactly the size only for music software.
With *all* installed as flatpak, my /var/lib/flatpak folder is 15GB.
Which is, anyway, not so bad for a multimedia computer. It leaves anyway a lot of free space even in a small 240GB SSD.
Last edited by Senbee on Sat May 14, 2022 12:24 pm, edited 1 time in total.
I'm a SUDO wrestler - Italy - Ubuntu 22.04 - Ardour 6.9 - www.stefanodroghetti.it - www.youtube.com/user/SenbeeNorimaki - www.soundcloud.com/stefano-droghetti
User avatar
scott.thomason
Established Member
Posts: 46
Joined: Fri Apr 01, 2022 2:54 am
Has thanked: 2 times
Been thanked: 8 times
Contact:

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by scott.thomason »

Outstanding guide, @Senbee . Thank you!
Senbee wrote: Fri May 13, 2022 10:15 pm With *all* installed as flatpak, ma /var/lib/flatpak folder is 15GB.
That's a relief. Until I saw this comment I was thinking that Flatpak would probably require too much disk space to be practical. But 15GB is hardly a drop in the bucket (especially compared to Windows software, where it's not uncommon for a single application to use 15GB).

My next question is: how do you know what you have and manage it over the long term? With apt, you have a centralized source of information about 99% of what's installed. With Flatpak, and the other assorted mechanisms you've documented, you don't. For example, how do you know what can be upgraded to a newer version? The answer to-date appears to be "keep good notes", is there anything more technically sophisticated than that?

Thanks again, I'm going to setup a VM and give it a whirl.
---scott

LinkedIn
User avatar
bluzee
Established Member
Posts: 253
Joined: Mon Nov 30, 2020 11:43 pm
Has thanked: 11 times
Been thanked: 55 times

Re: Ubuntu 22.04: pipewire, wayland and flatpak - A small guide

Post by bluzee »

There should be a service that runs and automatically updates installed Flatpaks.
Post Reply