Hydrogen syncing with Ardour (pipewire)

Support & discussion regarding DAWs and MIDI sequencers.

Moderators: MattKingUSA, khz

User avatar
funkmuscle
Established Member
Posts: 2814
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 133 times
Been thanked: 34 times

Hydrogen syncing with Ardour (pipewire)

Post by funkmuscle »

Hey, anyone know how to sync H2 with Ardour using pipewire?
We were able to do so via Jack.

User avatar
Largos
Established Member
Posts: 639
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by Largos »

You can still sync it with jack transport.

luciorgomes
Established Member
Posts: 120
Joined: Wed Feb 04, 2015 11:29 pm
Has thanked: 40 times
Been thanked: 7 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by luciorgomes »

I've done it last night.
For me it works the same way as using jack.
Do you have pipewire-jack installed?

Attachments
JackHydrogen.png
JackHydrogen.png (9.9 KiB) Viewed 717 times
User avatar
funkmuscle
Established Member
Posts: 2814
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 133 times
Been thanked: 34 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by funkmuscle »

luciorgomes wrote: Wed Feb 28, 2024 11:24 pm

I've done it last night.
For me it works the same way as using jack.
Do you have pipewire-jack installed?

Yes I've got the jack client installed. In fact I've got all of the pipewire apps that are necessary for low latency and pro audio. Hydrogen when playing you can actually see it being registered in ardour. Also when I switch hydrogen to Jack it does not take the buffer size given in qjackctl. Hydrogen switched to pipewire then I can change the buffer size. I think I may have to go edit the /pipewire/jack.conf to match the pipewire.conf so that way I'll have a wider range for the buffer but that still will not help with the synchronization.

luciorgomes
Established Member
Posts: 120
Joined: Wed Feb 04, 2015 11:29 pm
Has thanked: 40 times
Been thanked: 7 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by luciorgomes »

Qjackctl? Why? It's all managed by Pipewire.
Latency you can set with

Code: Select all

PIPEWIRE_LATENCY="128/48000" application

or in jack.conf:

Code: Select all

# global properties for all jack clients
jack.properties = {
     node.latency       = 256/48000
     #node.lock-quantum  = false
     #jack.merge-monitor = false
     #jack.short-name    = false
     #jack.filter-name   = false
     #
     # allow:           Don't restrict self connect requests
     # fail-external:   Fail self connect requests to external ports only
     # ignore-external: Ignore self connect requests to external ports only
     # fail-all:        Fail all self connect requests
     # ignore-all:      Ignore all self connect requests
     #jack.self-connect-mode = allow
     #jack.locked-process    = true
}
# client specific properties
jack.rules = [
    {
        matches = [
            {
                # all keys must match the value. ~ starts regex.
                #client.name                = "guitarix"
                application.process.binary = "guitarix"
                #application.name           = "~jack_simple_client.*"
            }
        ]
        actions = {
            update-props = {
                node.latency = 128/48000
            }
        }
	}
	{
        matches = [
            {
                application.process.binary = "rakarrack-plus"
            }
        ]
        actions = {
            update-props = {
                node.latency = 128/48000
            }
        }
    }
]
User avatar
funkmuscle
Established Member
Posts: 2814
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 133 times
Been thanked: 34 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by funkmuscle »

I use it that way because for instance say if I'm using midi files to trigger a software synth and then record it well I get some crazy latency. M
y main mixing DAW is mixbus32C which 1,024 is perfect for mixing and my interface has next to zero latency. It's one of those audient Sono.

But as mentioned before at 1,024 trying to record some midi files triggering a software synth in for instance Reaper I get the crazy latency. I know I can click at the top right and I get that little menu there and I can change the buffer size down to 64 but for some reason that's glitchy and the same with Ardour.. best way to demonstrate this is to use some screenshots so I will attach those

before.png
before.png (16.29 KiB) Viewed 648 times

[/url]
Before connecting to jack

set to 64.png
set to 64.png (16.22 KiB) Viewed 648 times

then I connect

back to 1024.png
back to 1024.png (17.51 KiB) Viewed 648 times

The very last pic shows after connecting to jack it goes back to 1024.
Qjackstl is set to 64 and stays there so Ardour and Reaper connects to 64 size buffer.
Hey correct me if the term is not buffer.
H2 with qjackctl running stills sees 1024

I need 1024 for Mixbus32C for mixing. I would use my interface as hardware monitoring if I need to say fix a guitar part quickly or even rerecord an analog piece like vocals. But midi events from a software synth recorded at 1024 you really feel, hear and see the latency.

User avatar
Largos
Established Member
Posts: 639
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by Largos »

You can't use qjackctl for changing settings with pipewire, it won't work. I put a script for setting the default quantum/buffer here: viewtopic.php?t=26607

User avatar
funkmuscle
Established Member
Posts: 2814
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 133 times
Been thanked: 34 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by funkmuscle »

Largos wrote: Thu Feb 29, 2024 9:54 am

You can't use qjackctl for changing settings with pipewire, it won't work. I put a script for setting the default quantum/buffer here: viewtopic.php?t=26607

Then somebody better inform my system because that's only how it works. I finally got stuff working what I wanted there but I got this script off of a guy on YouTube and it works.
My system defaults to $1,024 and if I do not put on qjackctl and change the buffer or sample size again I keep screwing up the proper term inside the DAW and save it, I would open it up again and notice it will go right back to 1024.

I use qjackctl And connect my DW through that and it will stay at 64. So I don't know what I'm doing but the bottom line is it works and I'm not going to go mess with it. As I said I heard on here so many people complaining about it and I was like this is the simplest thing. All I had problem was synchronizing and that was a problem inside of ardour. Once I did that they synchronize. The only thing is they do not synchronize because hydrogen does not see the jack client so I cannot change that because it keeps going right back to 1,024 but reaper, ardour and mixbus32C all see qjackctl And when connected to that, it takes its sample size or buffer size or whatever which is 64. Of course with my system it takes up too much resources running mixbus32C but the other two DAW performs flawlessly. In fact before pipewire, The lowest I can go was 128 but with this combo I can do 64.

So in the technical world I think the word can't doesn't exist that much. Maybe my setup is completely wrong but the bottom line is it works so to me it's not wrong. Thanks for the script I'm going to hold that just in case this thing goes belly up but been using it like that for over a year now.

User avatar
Largos
Established Member
Posts: 639
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by Largos »

$1,024 is an expensive setting :P

The 1024 default setting is dictated by a config file setting that qjackctl doesn't change. That's what the script I made does. Pipewire is designed so that programs choose their quantum/buffer and the lowest one requested is used. JACK programs don't work like this so just follow the default setting or in your case what Qjackctl says when it's turned on. That said Qjackctl changes the buffer/quantum for JACK programs but not others. If your hydrogen keeps going to 1024, maybe you've not got it set to JACK. Which may explain why you can't sync it as well.

User avatar
funkmuscle
Established Member
Posts: 2814
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 133 times
Been thanked: 34 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by funkmuscle »

Largos wrote: Fri Mar 01, 2024 5:39 pm

$1,024 is an expensive setting :P

The 1024 default setting is dictated by a config file setting that qjackctl doesn't change. That's what the script I made does. Pipewire is designed so that programs choose their quantum/buffer and the lowest one requested is used. JACK programs don't work like this so just follow the default setting or in your case what Qjackctl says when it's turned on. That said Qjackctl changes the buffer/quantum for JACK programs but not others. If your hydrogen keeps going to 1024, maybe you've not got it set to JACK. Which may explain why you can't sync it as well.

:D :D :D :D :D :mrgreen: :mrgreen: :mrgreen: $1024 buhahahaha
Poor voice to text skills and even worse at typing..

So yes, you've explained it. So Ardour being set to connect to qjackctl when set at 64 samples connects with the 64 samples and I get 1.33ms.
Shout off qjackctl, switch Ardour to 64, connect and it switched to 1024.
H2 is set for Jack but will only connect to the default 1024.

Since I can only run Mixbus32C at 1024, I just launch it and start mixing. I can do touch ups to say guitars are vocals by using my interface as monitoring giving me near zero latency.
Software touch ups though I have to open up Reaper or Ardour, connect to qjackctl to get the great performance.

Can you script fix all that and make it simple as when it was just Jack?

User avatar
Largos
Established Member
Posts: 639
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by Largos »

Nothing connects to qjackctl by the way, qjackctl changes things about jack which is what is being connected to or in this case the jack module of pipewire.

You can edit the application menu of items by changing the launch command to PIPEWIRE_LATENCY=<buffer>/<samplerate> <command> so for instance change

Code: Select all

Ardour

to

Code: Select all

PIPEWIRE_LATENCY=1024/48000 Ardour

That would work for using a specific setting on a specific program.

As for hydrogen, I tried it out. In the audio system dialogue it doesn't show the correct buffer size, only what the default says You can't have multiple buffer/quantum running at the same time anyway. Use the command line tool pw-top for live readings.

luciorgomes
Established Member
Posts: 120
Joined: Wed Feb 04, 2015 11:29 pm
Has thanked: 40 times
Been thanked: 7 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by luciorgomes »

This is my jack.conf file (goes on /.config/pipewire).
The "node.latency = 256/48000", inside "jack.properties", is the default latency for jack clients in pipewire.
You can set custom latency values per app in the "jack.rules" section (for guitarix and rakarrack-plus in my case),

Code: Select all

# JACK client config file for PipeWire version "0.3.38" #
#
# Copy and edit this file in /etc/pipewire for system-wide changes
# or in ~/.config/pipewire for local changes.

context.properties = {
    ## Configure properties in the system.
    #mem.warn-mlock  = false
    #mem.allow-mlock = true
    #mem.mlock-all   = false
    log.level        = 0
}

context.spa-libs = {
    #<factory-name regex> = <library-name>
    #
    # Used to find spa factory names. It maps an spa factory name
    # regular expression to a library name that should contain
    # that factory.
    #
    support.* = support/libspa-support
}

context.modules = [
    #{ name = <module-name>
    #    [ args  = { <key> = <value> ... } ]
    #    [ flags = [ [ ifexists ] [ nofail ] ]
    #}
    #
    # Loads a module with the given parameters.
    # If ifexists is given, the module is ignored when it is not found.
    # If nofail is given, module initialization failures are ignored.
    #
    #
    # Boost the data thread priority.
    { name = libpipewire-module-rt
        args = {
            # nice.level   = -11
            rt.prio      = 95
            rt.time.soft = -1
            rt.time.hard = -1
        }
        flags = [ ifexists nofail ]
    }

# The native communication protocol.
{ name = libpipewire-module-protocol-native }

# Allows creating nodes that run in the context of the
# client. Is used by all clients that want to provide
# data to PipeWire.
{ name = libpipewire-module-client-node }

# Allows applications to create metadata objects. It creates
# a factory for Metadata objects.
{ name = libpipewire-module-metadata }
]

# global properties for all jack clients
jack.properties = {
     node.latency       = 256/48000
     #node.lock-quantum  = false
     #jack.merge-monitor = false
     #jack.short-name    = false
     #jack.filter-name   = false
     #
     # allow:           Don't restrict self connect requests
     # fail-external:   Fail self connect requests to external ports only
     # ignore-external: Ignore self connect requests to external ports only
     # fail-all:        Fail all self connect requests
     # ignore-all:      Ignore all self connect requests
     #jack.self-connect-mode = allow
     #jack.locked-process    = true
}

# client specific properties
jack.rules = [
    {
        matches = [
            {
                # all keys must match the value. ~ starts regex.
                #client.name                = "guitarix"
                application.process.binary = "guitarix"
                #application.name           = "~jack_simple_client.*"
            }
        ]
        actions = {
            update-props = {
                node.latency = 128/48000
            }
        }
	}
	{
        matches = [
            {
                application.process.binary = "rakarrack-plus"
            }
        ]
        actions = {
            update-props = {
                node.latency = 128/48000
            }
        }
    }
]
User avatar
funkmuscle
Established Member
Posts: 2814
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 133 times
Been thanked: 34 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by funkmuscle »

Largos wrote: Fri Mar 01, 2024 9:59 pm

Nothing connects to qjackctl by the way, qjackctl changes things about jack which is what is being connected to or in this case the jack module of pipewire.

You can edit the application menu of items by changing the launch command to PIPEWIRE_LATENCY=<buffer>/<samplerate> <command> so for instance change

Code: Select all

Ardour

to

Code: Select all

PIPEWIRE_LATENCY=1024/48000 Ardour

That would work for using a specific setting on a specific program.

As for hydrogen, I tried it out. In the audio system dialogue it doesn't show the correct buffer size, only what the default says You can't have multiple buffer/quantum running at the same time anyway. Use the command line tool pw-top for live readings.

So if I follow correctly, the script you gave there will be a default so if I want to run any of those apps I've got to launch them from a terminal? So for instance I've tried that command before that you gave there for the latency and launching an app which worked well but for instance as I mentioned before, ardour and Reaper I need/use 64 and mixbus32C I need/can only use 1024.

Would your script cover the whole spectrum of buffers/samples? And if yes, what is the .conf name?

User avatar
Largos
Established Member
Posts: 639
Joined: Mon Oct 05, 2020 12:21 pm
Has thanked: 72 times
Been thanked: 186 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by Largos »

No, you don't have to launch from a terminal. For the PIPEWIRE_LATENCY variable, you can edit the application menu command. I don't know what Desktop Environment you are using, so the method may vary but with KDE you right click the application menu icon and click "edit applications".

My script creates a file at ~/.config/pipewire/pipewire.conf.d/quantumsetting.conf which overrides the default config file setting where the 1024 figure is given. These are the options: "16" "32" "64" "128" "256" "512" "1024" "2048" "4096" "8192"

User avatar
funkmuscle
Established Member
Posts: 2814
Joined: Mon Jun 02, 2008 2:30 pm
Has thanked: 133 times
Been thanked: 34 times

Re: Hydrogen syncing with Ardour (pipewire)

Post by funkmuscle »

Largos wrote: Sat Mar 02, 2024 11:06 am

No, you don't have to launch from a terminal. For the PIPEWIRE_LATENCY variable, you can edit the application menu command. I don't know what Desktop Environment you are using, so the method may vary but with KDE you right click the application menu icon and click "edit applications".

My script creates a file at ~/.config/pipewire/pipewire.conf.d/quantumsetting.conf which overrides the default config file setting where the 1024 figure is given. These are the options: "16" "32" "64" "128" "256" "512" "1024" "2048" "4096" "8192"

@Largos, If this works, I hope you wear a cape because your my new favorite superhero! Thanks a lot! Got a busy day but when I get back home I'm definitely giving it a shot.

BTW, I use OpenBox and my panel for launching apps is Plank.

Post Reply