Pipewire, Jack Applications & Low-Latency tuning for soundcards

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

alex stone
Established Member
Posts: 351
Joined: Fri Jun 06, 2008 7:39 am
Has thanked: 67 times
Been thanked: 53 times

Re: Pipewire, Jack Applications & Low-Latency tuning for soundcards

Post by alex stone »

j_e_f_f_g wrote: Fri Jul 21, 2023 11:06 pm
alex stone wrote: Fri Jul 21, 2023 8:22 pm

jack midi versus alsa midi

Oh that's right. I remember now that you're using some giga libs, so you have a really complicated setup with Linuxsampler.

Are you running linuxsampler as a plugin inside of QTractor, or running it as a separate process connected via alsa sequencer API?

Because that could make a big difference in the resulting performance.

In other words, which of the follolwing methods do you use:

============================
I select QTractor's "Track -> Add Track..." menu command.
This pops up a dialog to enter the new track's properties. I select "MIDI" type of track. I check "Omni". Then I select the "Plugins" page, click the "Add..." button, and find/select the "Linuxsampler" LV2 plugin. I also check "latency compensation".
I click OK to dismiss the dialog and create my new track.

=============================
I run QSampler or Fantasia to start Linuxsampler.
I run QJackCtl, and click the "Connections" button.
I go to the "ALSA" page, and I connect QTrackor's MIDI Out to LinuxSampler's MIDI In.

==============================

You want to do #1, not #2,

Muse and Qtractor could both do with a folders feature

Muse has a group of 7 pushbuttons that allow you to set which types of tracks to show/hide. If you position the mouse cursor over the first button, a (yellow) tooltip will pop up that reads "Show midi tracks". If you click on this button, it will change to a dimmer color, and all the MIDI tracks will disappear from your window. They're still there, and they still play, but they're no longer shown in the window. If you click that button again, all the MIDI tracks reappear. You have 6 more buttons to show/hide other types of tracks. If you want to hide all of the plugins, click on the "Show synth tracks" button. (It's the rightmost button).

I'm pretty sure qtractor also has a way to hide/show tracks. But I don't know it offhand.

I run LS as a separate standalone process and Qtractor midi out to LS's midi in. I also do the same with Muse. So there's no plugin process going on inside either app, just midi connections.

I know about Muse pushbuttons, but they're for track types, not groups of midi tracks, for one example. I have hidden all the track types, except midi.

FR.
Create a folder. Add what ever tracks. These could be all the woodwind tracks, or all the articulation tracks for 1st violins, for just two examples. That's what I'm referring to when i suggest folder tracks. Close the folder when you're not working in it, and open when you are.

Alex.

j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: Pipewire, Jack Applications & Low-Latency tuning for soundcards

Post by j_e_f_f_g »

alex stone wrote:

I run LS as a separate standalone process and Qtractor midi out to LS's midi in. I also do the same with Muse.

Alex, you need to try to do it the first way. This may not only solve your timing issues when you used alsa (instead of jack), but it may reduce your cpu/ram usage noticeably. It's much more efficient to have linuxsampler running as a lv2 plugin (right inside your daw), then running as an exe in a separate process while passing midi messages through alsa's seq api.

First thing to do is check that you have the LV2 frontend for linuxsampler installed on your system.

Run Muse. Hold down the shift key and press the "s" key. This will bring up the "Synths" dialog. It will show you the names of all your plugins that are virtual instruments (as opposed to effects such as compressors, filters, distortion boxes, etc). Look down the list and see if you find "linuxsampler.LV2". If you do, this means that you have linuxsampler's LV2 frontend loaded. (If not, let me know, and we'll get it installed). Double-click on it, and select the OK button to close the dialog.

You should see a yellow track appear in your tracklist, referencing linuxsampler.

Now select the "File -> Import midi file..." menu command. Use the file dialog to locate one of your pieces (that you saved in standard midi file format). When asked how to import, select "Add to project".

Now all your midi tracks should appear in the tracklist. Hold down the CTRL key and start clicking on the track number (the first column on the left) of each blue midi track to select it. When it is selected, a track's color changes to yellow. When all are selected, release CTRL key.

Now click the right mouse button over the "Port" column of any midi track. This should pop up a menu. Select "linuxsampler LV2-0" in the menu. Now all your tracks are set to output to this one instance of the Linuxsampler plugin. Note: You have 16 midi channels to play with for each instance of linuxsampler (each synth track referencing linuxsampler).

Now hopefully LS will be loaded with your giga files. Unfortunately there is no LV2 GUI window for LS. So you can't click on a midi track to bring up a window like QSynth to load your giga file. You'll have to run QSynth (or Fantasia) separately to load it.

Your playback will not only be "sample accurate", it will also be more efficient.

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

j_e_f_f_g
Established Member
Posts: 2032
Joined: Fri Aug 10, 2012 10:48 pm
Been thanked: 358 times

Re: Pipewire, Jack Applications & Low-Latency tuning for soundcards

Post by j_e_f_f_g »

Alex,

Did you get a chance to try the above setup on Muse?

Author of BackupBand at https://sourceforge.net/projects/backupband/files/
My fans show their support by mentioning my name in their signature.

User avatar
khz
Established Member
Posts: 1648
Joined: Thu Apr 17, 2008 6:29 am
Location: German
Has thanked: 42 times
Been thanked: 92 times

Re: Pipewire, Jack Applications & Low-Latency tuning for soundcards

Post by khz »

No idea if this is helpful for the thread but I'll post the link https://bootlin.com/blog/an-introduction-to-pipewire/. :D

. . . FZ - Does humor belongs in Music?
. . GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
  • I don't care about the freedom of speech because I have nothing to say.
ElijahLynn
Posts: 1
Joined: Sun Dec 03, 2023 12:43 am

Re: Pipewire, Jack Applications & Low-Latency tuning for soundcards

Post by ElijahLynn »

A new zero-latency jackdbus bridge was added. This works similar to what PulseAudio has to offer and creates a sink/source when jackdbus is started. It is however much more efficient and runs the complete PipeWire graph as a synchronous JACK client with no added latency.

May 17th, 2023
https://www.phoronix.com/news/PipeWire-0.3.71-Released

With the completed work on IRQ-based scheduling in ALSA, PipeWire is now able to match the JACK audio server and have equal latency to PipeWire with the professional audio profile.

October 6th, 2023
https://www.phoronix.com/news/PipeWire-1.0-RC

And lastly, the release of a stable 1.0 release was just announced: https://www.phoronix.com/news/PipeWire-1.0-Released

Also the home page of Pipewire says this:

It provides a low-latency, graph-based processing engine on top of audio and video devices that can be used to support the use cases currently handled by both PulseAudio and JACK.
...

  • Capture and playback of audio and video with minimal latency.
peelybird
Established Member
Posts: 6
Joined: Fri Feb 23, 2024 2:12 pm

Re: Pipewire, Jack Applications & Low-Latency tuning for soundcards

Post by peelybird »

@asbak

I have been struggling to get any decent performance from my pipewire setup but I am new to this. Can you post the procedure and scripts you say you use to swap between pipe wire and native alsa?

David

Post Reply