flathub / org.ardour.Ardour

https://flathub.org/apps/details/org.ardour.Ardour
16 stars 5 forks source link

When starting Ardour says low ulimit #8

Open yajo opened 3 years ago

yajo commented 3 years ago

When I start, there's a dialog saying:

AVISO: Tu sistema tiene un límite para la cantidad de memoria bloqueada. Esto puede causar que Ardour se quede sin memoria antes que tu sistema.

Puedes comprobar este límite con 'ulimit -l' y normalmente se establece en /etc/security/limits.conf

Well... it's in Spanish but it means there's low memory limit.

However, in a term I run ulimit -l and it says: 4194304

I'm on Fedora 32. I installed package studio-controls and added my user to jackuser group, so I get unlocked mem limit.

Also interesting:

➤ flatpak enter org.ardour.Ardour sh
[📦 org.ardour.Ardour ~]$ ulimit -l
4194304

What's happening and how to fix it?

GeorgeSapkin commented 3 years ago

I think the expectation is that you set memlock to unlimited.

pinkflames commented 2 years ago

Noticed this issue only now. Not sure if it's still relevant but the core issue is as @GeorgeSapkin described - the launcher checks for memlock value and makes dubious complaints if it's not unlimited even if the actual value is probably large enough for all but the most demanding Ardour projects.

As for why ulimit -l would still say 4G, there's two explanations which I do not really feel like untangling - @yajo either forgot to log out and back which is required to apply a group. Or forgot to reboot, which is required to apply /etc/security/limits* changes on already running programs (and realistically it's almost certainly easier to reboot than to try to get all the involved PIDs restarted without taking down the host OS).

If a reboot had been done and if ulimit -l was still saying 4G, then most likely the way the lower memlock is set takes precedence over the memlock unlimited, which, yes, is a thing that next to no one understand, so seeing it misbehave when the same limit is set multiple time by different packages and with possibly different matching rules is hardly that unexpected or surprising.

On Flatpak side I'm not sure if anything can be done. One way would be to change launcher to only require 2GiB or 4GiB (in bytes and as multiple of page size) which should be plenty for most uses and users. Or that could be done upstream but I'm sure they were woried over UX of Ardour suddenly crashing if the limit is hit (not sure but seams plausible).