X-Over with UbuntuStudio, Pipewire and Calf

Since 2015 I run 24/7 a PC with KX-Studio which provides me the following services:
Everything runs in principle flawlessly. And although they say "Never change a running system" I wanted to try something new since KX-Studio is no longer developed. Most new distributions use PIPEWIRE as sound server. As distribution I chose Ubuntu Studio 23.04. Everything should be as easy as possible to set up and use via GUIs without cryptic command lines. For this I wanted to use the really great CALF plugins, especially the 4 band crossover. The sound is output via 4x2 channel HDMI, of which I only use 6 channels. As an amplifier I continue to use an HDMI AV receiver. I have in the meantime instead of the Onkyo TX-SR605 bought an ONKYO TX-SR876. There are used already for under 100 Euro.

And I must say I am inspired by the result. But everything in turn. I concentrate here on the settings for the crossover.
1. Installing Ubuntu Studio 23.04 should be possible for everyone. There are enough instructions
2. I install the following programs or they are already installed:
--- raysession
--- wireplumber
--- qpwgraph
--- calf-plugins
--- mc
--- ssh
--- agordejo
--- synaptic
--- flatpak
--- clementine
with flatpak additionally
--- coppwr
--- Simple Wireplumber GUI
--- Helvum

--- from WEB Universal Media Server

3. set all playback devices to "Pro Audio" in the audio - system settings

alle-wiedergabegeraete-auf-quotpro-audioquot-einstellen-in-den-audio-systemeinstellungen_1224851.png


4. start RaySession, create new session, add Calf Jack Host as applicant

raysession_1224852.png


5. load "X-Over 4 Band" in Calf Host

calf-4-band-x-over_1224855.png


6. open X-Over and define the frequency bands. For the Quadral I choose180 / 3800 and quite steep LR8.

frequenzbaender_1224856.png


7. do the virtual "wiring" in RaySession.
--- In this example Firefox outputs the sound over my USB interface AND over the chain crossover->HDMI->AVReceiver->speakers.

beispiel-quotverkabelungquot_1224870.png


--- Any "cabling" can be realized with different programs (here Firefox, VLC, Clementine). All my outputs are wired to the crossover AND the USB interface (for my headphones).

weitere-verbindungen_1224872.png


8. also a BT connection to my cell phone is possible and works wonderfully.

verbindung-ueber-bt-mit-handy_1224874.png


9. finally save the setup. All settings (including the settings in Calf) are saved and can be loaded again.

speichern_1224876.png


10. in qpwgraph the whole thing looks similar. But I didn't manage to load CALF with it.

qwpgraph_1224877.png


11. here are the views from coppwr. Here you can get a lot of additional information.

coppwr_1224878.png



coppwr_1224879.png


Maybe someone is interested.

BR
Guenter
 

Attachments

  • beispiel-quotverkabelungquot_1224870.png
    beispiel-quotverkabelungquot_1224870.png
    152.5 KB · Views: 73
  • calf-4-band-x-over_1224855.png
    calf-4-band-x-over_1224855.png
    131.3 KB · Views: 70
Last edited:
  • Like
Reactions: 6 users
Thanks for posting. I do not use apps for visualization of the connections, but it does show a lot of information. Nice. I expect to move to Pipewire sometime in the next year. I use Gstreamer now, and the developer of Pipewire is the same guy evidently. I primarily use complicated pipelines of my LADSPA plugins, but Pipewire is a LADSPA host and I should be able to move everything over to it. I will need to become very familiar with how to compose the Pipewire graphs before I even consider it.

Please let us know how it works for you, pros and cons, and whenever or if you run into a problem what happened and how you solved it.
 
Please let us know how it works for you, pros and cons, and whenever or if you run into a problem what happened and how you solved it.

Small interim report.

I have been running pipewire on Ubuntu Studio for 2 weeks now24/7, only with short interruptions for updates.
I am now running Ubuntu Studio 23.10 with pipewire version 0.3.84 (from the original repos).

Everything runs very well and no x-runs are displayed

Since yesterday I tried a small practical stress test and let several streams run for 24 hours.

I connect several different devices with different streams
Cell phone S21 via BT with the USB interface
VLC with build in AUDIO 1
Firefox with ASLA Loopback
Loopback monitor with X-Over
X-Over with HDMI
Clementine with Teamviewer
The corresponding Raysession connections here:

Screenshot Raysession.jpg


The audio streams run simultaneously everywhere without errors
DSP fluctuates between 5% and 7%
No X-runs

Output from pw-top here:
Screenshot pw-top.png


All streams have a sample rate of 44100 except for the stream to Teamviewer (48000). I don't know why.

To keep resampling as low as possible I made the following settings in /etc/pipewire/pipewire.conf
## Properties for the DSP configuration.
default.clock.rate = 44100
default.clock.allowed-rates = 44100
default.clock.quantum = 1024
default.clock.min-quantum = 32
default.clock.max-quantum = 2048
default.clock.quantum-limit = 8192
With this I hoped to have set all streams to 44100. My mp3 and flac files have a sample rate of 44100 anyway (CD quality).
Perhaps there are better settings. I can't quite figure it out yet.

Furthermore:
When starting VLC, Firefox, BT, Clementine, these are connected to the device which is set as default.
Calf Jack Host cannot be set as the default.
Therefore I have chosen the way via the ALSA Loopback devive.
This is loaded at boot time and can be set as the default devive.
Good description e.g. here: https://www.sdrutah.org/info/high_rate_loopback_websdr.html
Output aplay -l here:
Screenshot aplay -l.png


Perhaps there are better solutions here too?

Best Regards
Guenter
 
  • Like
Reactions: 1 users
I am now running Ubuntu Studio 23.10 with pipewire version 0.3.84 (from the original repos).
Thanks. Interesting post. I will be switching to Studio shortly having used OpenSuse for a very very long time. Studio LTS though so wish you had used that. Looking on the web using pipewire with that isn't really sorted out yet. There are suggestions and then complaints about not working.

I've mentioned Studio on here before. Main reason is sound apps preinstalled and the low latency kernel. One person said why do I want that - the low latency aspect allows sound to be processed more effectively.

On OpenSuse I could search app's on the basis of what they do rather than just name. I'll miss that so will be copying your list of downloads.

No serious processing but I have been running Studio with KDE on a pretty old dell laptop. Very early win8 machine - a get it in a machine quickly one so installed rather oddly due to bios limitations.

From memory the Studio aspects can be installed over Ubuntu Gnome. Maybe other desktop variants as well. Mentioned on Studio's site. Gnome - KDE well these days both get up to things I'd rather they didn't do. Loading wise I don't think there is much difference and many who use Gnome quickly try and roll back to a menu driven desktop. More general rather than specific use such as just audio though.

LOL To look at them I multibooted several Ubuntu flavours. Didn't work out, just booted the last one installed. So installed OpenSuse and could then choose. Sadly there stable version isn't that really any more for a number of popular apps. Ubuntu's forum can be pretty helpful but Studio doesn't have a separate one. It did have it's own threads but that was stopped. Can't say I am thrilled with how Canonical handle things but they now have the most popular distro so it's well supported. Even the latest version of wine is easy to get - if some one wants to run win apps. A lot of older ones are fine. Newish - more iffy.

One bleat. Flatpack Firefox. To many undates. Installed English GB, updates USA and create an account to change. It is possible to install a stable version normally from Firefox's site. Not tried and Chromium may not have this problem. It'll probably be flatpack too. This is being used more and more on apps as it's simplifies things for devs when producing stuff that will run on many different distro's. On web browsers the idea is to sandbox them. They are evil and can do bad things - an experience I have never had. In fact desktops are often seen by some in the same way.
 
Thank you for this,

I moved to PipeWire almost flawlessly thanks to you, especially the ALSA Loopback device part !
Previously I was using jack with pulseaudio-sink and claf (xover and a couple of parametric equalizers) all started-up and connected with a custom bash script.

Here is my configuration :

Vanilla ubuntu 23.10.
The soundcard is an Asus Xonar U7 mkII (automaticaly detected and fully functionnal).

Not mandatory but usefull for me, install a sane firefox :
sudo snap remove firefox sudo add-apt-repository ppa:mozillateam/ppa echo ' Package: * Pin: release o=LP-PPA-mozillateam Pin-Priority: 1001 ' | sudo tee /etc/apt/preferences.d/mozilla-firefox echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox sudo apt install firefox
Install RaySession
sudo apt install git make python3-liblo python3-pyqt5.qtsvg qtchooser qttools5-dev-tools pipewire-jack git clone https://github.com/Houston4444/RaySession.git cd RaySession/ git submodule update --init make LRELEASE=lrelease-qt5 sudo make install
Install calf
sudo apt install calf-plugins
Configure the ALSA Loopback device
sudo gnome-text-editor /etc/modprobe.d/alsa-base.conf
Add "options snd-aloop index=16,17 id=lp0,lp1 enable=1,1 pcm_streams=4,4" at the end
sudo modprobe snd-aloop
sudo gnome-text-editor /etc/modules
Add "snd-aloop" at the end

RaySession have to be started with
pw-jack raysession

Then configure kde/gsconnect to control the volume with the snatphone and add pw-jack raysession --start-session <sesion name> as startup aplication.

Two advantage of this setup over the old jack:
  • better Bluetooth input codec. Now can be switched to AptX and was previously sbc only with pulseaudio;
  • ability to sleep (jack was never able to recover aveter a S3 sleep for me).
 
  • Like
Reactions: 1 user
Installed vanilla ubuntu and added ubuntu-studio-audio.
Then proceeded to the other installs..until the flatpak where every sodding part needed user permissions !! 30 thousand later and then they wanted to know which of the 90 flatpak versions of the app I needed ??? WTF !!
Just so much undocumented and too loose to be useful.
Thanks for your efforts..hope it all works for you but leaving now. :-(
 
@DRONE7 thx for your feedback. For me it is ok with all the every-fkn-studio-office-audio-video-photo-numbat-things. My PC is around 12 years old (i5 Sandy Bridge) and it runs without any X-Runs 24/7. Used memory and CPU power after a fresh reboot you can see in enclosed screenshot. So such a full install does not bother me and I use some of this things as well.
I use the PC as follows:
  • File server (Samba and SFTP)
  • DLNA server for pictures, music and videos (Universal Media Server)
  • Mediaplayer connected to my AVReceiver which is connected to an TV and Quadral Vulkan MK 4 loudspeaker
  • Crossover for my activated 3 ways Quadral Vulkan MK 4
  • Steaming videos with firefox from Youtube, amazon, netflix, disney channel, .....
  • Steaming music from deezer.



Bild_2024-02-07_182432571.png
 
Last edited:
Unfortunately your screenshot is cut-off to the right so I cannot see totals and can't compare to my own hardware.
I suspect you have a well resourced device even if somewhat older.
I am trying to run a simple player and crossover from low resource hardware (12Gb Ram, Quadcore@1500 HP Thin-client)
So frustrating that the Linux environment does not have a simple implementation...any how-to lasts about 3 weeks before upstream change the various components and configuration is broken.

When still a Windows binary that runs on XP rock solid with a full GUI and allows on the fly adjustments in Pentium 4 and 1GB ram still works.... we seem to go backwards :-(