robbert-vdh / yabridge

A modern and transparent way to use Windows VST2, VST3 and CLAP plugins on Linux
GNU General Public License v3.0
2.47k stars 64 forks source link

Keep getting "Low RTTIME limit detected" warning after editing pipewire conf file #154

Closed cleinias closed 2 years ago

cleinias commented 2 years ago

Thanks for giving yabridge a shot!

Problem description

I am using yabridge with Ardour's loading the Kontakt plugin with several instruments. Every time I start my Ardour sessions, yabridge complains that the RTTIME limit is set at 20000 and it is too low/may cause crashes, etc. Indeed, I often have Kontakt crash when I load instruments into the Kontakt plugin. I run Ardour with jack under pipewire.

Yet, I have followed the instructions in the Readme file, and have uncommented the relevant parameters in pipewire's local conf file and set them to -1 as instructed there. I even edited the global conf file in /usr/share to no effect.

This behavior happened with wine-staging 6.14. I tried upgrading to the latest wine-staging version to see if the crashes would disappear but I detected no change in pipewire/yabridge behavior.

What did you expect to happen?

I expected the RTTIME limit to be lifted

What actually happened?

I keep getting warning about the RTTIME limit being too low every time an instrument is loaded into Kontakt

Operating system

Archlinux

How did you install yabridge?

from AUR yabridge-bin package

yabridge version

3.7.0-3

yabridgectl version

3.7.0-3

Wine version

wine-staging 7.0-rc1

Plugin installation method

copies

Plugin

NI Kontakt

Plugin type

VST2

Plugin architecture

64-bit

Host

Ardour

Desktop environment or WM

KDE plasma

GPU model

NVIDIA gtx 970

GPU drivers and kernel

No response

Debug log

No response

Anything else?

No response

robbert-vdh commented 2 years ago

Do you mean 200000 instead of 20000? That's rtkit's stock limit. Where are you launching your DAW from? Maybe the thing you're launching it from is already using rtkit and thus has its RLIMIT_RTTIME lowered. Try opening a terminal and running:

bash -c 'LANG=C ulimit -r -l -R'

That should print something like this (as long as the realtime priority is somewhere above 90 that's fine):

real-time priority                  (-r) 98
max locked memory           (kbytes, -l) unlimited
real-time non-blocking time  (microseconds, -R) unlimited

If that contains unlimited for the real-time non-blocking time, then try launching your DAW from that same terminal. If you then still get the RTTIME warning, then it's definitely your PipeWire config. PipeWire's config files are loaded in the order ~/.config/pipewire, /etc/pipewire, and then /usr/share/pipewire (which you of course should never edit).

cleinias commented 2 years ago

Yep, sorry, indeed I meant 200 000, sorry for the mistake. And I have a similar output on the terminal:

stefano@gorgias ~ $ bash -c 'LANG=C ulimit -r -l -R'

real-time priority                  (-r) 95
max locked memory           (kbytes, -l) unlimited
real-time non-blocking time  (microseconds, -R) unlimited

Ardour launched from the same terminal keeps giving me the RTTIME warning. I'll look more into the pipewire issue

robbert-vdh commented 2 years ago

Then it's definitely your PipeWire config. Make sure your ~/.config/pipewire/jack.conf looks like this.

cleinias commented 2 years ago

The relevant section of my ~/.config/pipewire/pipewire.conf is slightly different, because it uses the RTKit module:

   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.
    #

    # Uses RTKit to boost the data thread priority.
    { name = libpipewire-module-rtkit
        args = {
            #nice.level   = -11
            #rt.prio      = 88
            rt.time.soft = -1
            rt.time.hard = -1
        }
        flags = [ ifexists nofail ]
    }

#    Set thread priorities without using RTKit.
#    { name = libpipewire-module-rt
#        args = {
#            nice.level   = -11
#            rt.prio      = 88
#            rt.time.soft = -1
#            rt.time.hard = -1
#        }
#        flags = [ ifexists nofail ]
#    }

I am really new to pipewire, and I don't have clue about the difference between libpipewire-module-rtkit and libpipewire-module-rt. I've tried to switch to libpipewire-module-rt as in your linked example, but in that case pipewire does not start at all.

robbert-vdh commented 2 years ago

~/.config/pipewire/pipewire.conf is not the same file as ~/.config/pipewire/jack.conf. I'd personally just use normal realtime scheduling instead of rtkit everywhere, but the bare minimum you need to change is jack.conf.

cleinias commented 2 years ago

No wonder all my changes didn't have any effect---I was editing the wrong file. How embarrassing... Thanks for the help. The warning has disappeared by replacing Arch's jack.conf with the version you linked. However, I'm even more puzzled because the RTTIME limit was already set to -1 (I must have changed it when I originally set up pipewire-jack a few weeks back). Here is the diff between the jack.conf file I had and your version on github:

stefano@gorgias pipewire $ diff jack.conf-orig jack.conf-Robbert-vdh 
1c1
< # JACK client config file for PipeWire version "0.3.42" #
---
> # JACK client config file for PipeWire version "0.3.40" #
10c10
<     #mem.mlock-all   = false
---
>     mem.mlock-all   = true
39c39
<             #rt.prio      = 88
---
>             rt.prio      = 70

Anyways, I'll do some more testing and thanks again for the help.

robbert-vdh commented 2 years ago

Closing this since there hasn't been a response in a couple of months. Feel free to pop into the yabridge Discord if you have any more questions.

ThaYke commented 10 months ago

Hi there, not sure if this is the right place to ask but as my issue seems related, I thought it could fit here. I have the same problem of the low rttime limit, but only when starting Reaper from a .desktop shortcut. When I start my DAW from a terminal everything works fine. I worked around it in a ugly way by letting my .desktop file execute a terminal running the reaper command inside it, instead of directly running it. Any idea how to troubleshoot this further? Hints would be much appreciated. Thanks.

EDIT: typos