I just want a stable Linux desktop to develop and run Faust programs

What other apps and distros do you use to round out your studio?

Moderators: MattKingUSA, khz

User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

I have an old Macbook Pro, upon which I installed Ubuntu Studio 19.04. I'm really interested in using Faust to develop my own LV2 plugins (thinking about getting a MOD Dwarf to put in the effects loop of my guitar modeling preamp). However Mod Dwarf is on a Kickstarter that even before the current worldwide disruption, wasn't planned to be available before December.

I got Faust running on a Bela but it's a little underpowered for my needs. Same with the ESP32-A1S audio dev board from AIThinker. Faust support for that is really bleeding edge and it's not clear really how much CPU horsepower those things bring to the table. Faust for all its wonderfulness generates a TON of code.

Anyway back to my Macbook Pro, I just used QJackctl and then made a couple Faust programs using the faust2jaqt compiler. Jack seems to run OK for a little while and then it goes off a cliff with XRUNs and glitches. This is just running a simple delay program. The CPU meter (I think I have a 4-core i5) bounce up and down but nothing is pinned. I have to restart Jack to recover and sometimes I have to reboot. This is really trying my patience.

I am currently booting Ubuntu Studio 19.04 with the low latency option, but I'll try anything. I mostly want to develop modulation and delay types of effects.

btw I am using the Behringer UMC404 audio interface.

TIA,

DL
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by lilith »

Did you optimize the system for real time audio? One of the most important things is to set the CPU governor to performace.

This script tells you where your system can still be optimized: https://github.com/raboof/realtimeconfigquickscan
CrocoDuck
Established Member
Posts: 1133
Joined: Sat May 05, 2012 6:12 pm
Been thanked: 17 times

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by CrocoDuck »

Digital Larry wrote: Thu Mar 19, 2020 5:26 pm Anyway back to my Macbook Pro, I just used QJackctl and then made a couple Faust programs using the faust2jaqt compiler. Jack seems to run OK for a little while and then it goes off a cliff with XRUNs and glitches. This is just running a simple delay program. The CPU meter (I think I have a 4-core i5) bounce up and down but nothing is pinned. I have to restart Jack to recover and sometimes I have to reboot. This is really trying my patience.
That's pretty strange. I need to do mad things with Faust to get it to produce xruns (like this nonlinear model). I also have the same audio interface.

Could you share your Faust source code and your Jack setup? Since you use Qjackctl you can repost the output of this:

Code: Select all

cat .jackdrc
User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

Yes, I checked the audio settings in the Ubuntu Studio Control Panel and it's already set to "Performance".

I'm also already on 19.10.

I also see that the Jack setup in the Ubuntu Studio control panel is different from what QJackctl shows. Not sure how to deal with this. I am open to which one to use. QJackCtl is slightly easier to use.

Code: Select all

gary@gary-MacBookPro:~$ cat .jackdrc
/usr/bin/jackd -dalsa -r44100 -p256 -n2 -Xseq -D -Chw:U192k,0 -Phw:U192k,0 -i4
gary@gary-MacBookPro:~$
Faust- I just used one of the included examples. I hadn't even looked at the code before, I just built it. Says it's using a deprecated library.

Code: Select all

// WARNING: This a "legacy example based on a deprecated library". Check misceffects.lib
// for more accurate examples of echo functions

declare name            "echo";
declare version         "1.0";
declare author          "Grame";
declare license         "BSD";
declare copyright       "(c)GRAME 2006";
//-----------------------------------------------
//                              A Simple Echo
//-----------------------------------------------

import("stdfaust.lib");

process = vgroup("echo-simple", ef.echo1s);
User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

Here's the output of the raboof scan tool:

Code: Select all

gary@gary-MacBookPro:~/github/realtimeconfigquickscan$ perl ./realTimeConfigQuic                                          kScan.pl
== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.3.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'performance' CPU 1: 'performance' CPU 2: 'perf                                          ormance' CPU 3: 'performance'  - good
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... < 524288 - not good
increase max_user_watches by adding 'fs.inotify.max_user_watches = 524288' to /e                                          tc/sysctl.conf and rebooting
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#s                                          ysctlconf
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
chrt: failed to set pid 0's policy: Operation not permitted
Checking the ability to prioritize processes with chrt... no - not good
Could not assign a 80 rtprio SCHED_FIFO value. Set up limits.conf.
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#l                                          imitsconfaudioconf
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without real-time capabilities found
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#i                                          nstalling_a_real-time_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.
gary@gary-MacBookPro:~/github/realtimeconfigquickscan$
uname -a shows:

Code: Select all

$ uname -a
Linux gary-MacBookPro 5.3.0-42-lowlatency #34-Ubuntu SMP PREEMPT Fri Feb 28 06:31:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

Okay, I made a few tweaks, here are the results now.

Code: Select all

== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.3.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'performance' CPU 1: 'performance' CPU 2: 'performance' CPU 3: 'performance'  - good
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
chrt: failed to set pid 0's policy: Operation not permitted
Checking the ability to prioritize processes with chrt... no - not good
Could not assign a 80 rtprio SCHED_FIFO value. Set up limits.conf.
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#limitsconfaudioconf
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without real-time capabilities found
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#installing_a_real-time_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.
gary@gary-MacBookPro:~/github/realtimeconfigquickscan$
Regarding this setting:

Code: Select all

Checking the ability to prioritize processes with chrt... no - not good
Could not assign a 80 rtprio SCHED_FIFO value. Set up limits.conf.
If I run the script using "sudo", it's OK, but then it complains about me running as root. Picky picky picky!

Will try again and see how it goes.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by lilith »

You have to edit your limits.conf file in /etc/security/

viewtopic.php?t=392

The nice entry is not needed, i.e only

Code: Select all

@audio           -       rtprio          95
@audio           -       memlock         unlimited
User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

Thanks, it seems to be running better now. I did get a glitch over about 15 minutes but maybe with networking off that will go away.

Only weird thing that happened is that all visible sign of QJackctl and my Faust apps disappeared, even though the processes remained. I'll keep plugging away at it.

Thanks!!!!!!
User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

non-root

Code: Select all

$ perl ./realTimeConfigQuickScan.pl
== GUI-enabled checks ==
Checking if you are root... no - good
Checking filesystem 'noatime' parameter... 5.3.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'performance' CPU 1: 'performance' CPU 2: 'performance' CPU 3: 'performance'  - good
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... yes - good
Checking for multiple 'audio' groups... no - good
chrt: failed to set pid 0's policy: Operation not permitted
Checking the ability to prioritize processes with chrt... no - not good
Could not assign a 80 rtprio SCHED_FIFO value. Set up limits.conf.
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#limitsconfaudioconf
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without real-time capabilities found
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#installing_a_real-time_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.
root

Code: Select all

$ sudo perl ./realTimeConfigQuickScan.pl
== GUI-enabled checks ==
Checking if you are root... yes - not good
You are running this script as root. Please run it as a regular user for the most reliable results.
Checking filesystem 'noatime' parameter... 5.3.0 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors... CPU 0: 'performance' CPU 1: 'performance' CPU 2: 'performance' CPU 3: 'performance'  - good
Checking swappiness... 10 - good
Checking for resource-intensive background processes... none found - good
Checking checking sysctl inotify max_user_watches... >= 524288 - good
Checking access to the high precision event timer... readable - good
Checking access to the real-time clock... readable - good
Checking whether you're in the 'audio' group... no - not good
add yourself to the audio group with 'adduser $USER audio'

Checking for multiple 'audio' groups... no - good
Checking the ability to prioritize processes with chrt... yes - good
Checking kernel support for high resolution timers... found - good
Kernel with Real-Time Preemption... not found - not good
Kernel without real-time capabilities found
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#installing_a_real-time_kernel
Checking if kernel system timer is high-resolution... found - good
Checking kernel support for tickless timer... found - good
== Other checks ==
Checking filesystem types... ok.
** Set $SOUND_CARD_IRQ to the IRQ of your soundcard to enable more checks.
   Find your sound card's IRQ by looking at '/proc/interrupts' and lspci.
$
limits.conf

Code: Select all

$ grep audio /etc/security/limits.conf
@audio - rtprio 95       # maximum realtime priority
@audio - memlock unlimited  # maximum locked-in-memory address space (KB)
$
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by lilith »

Not sure what's the problem here, but the solution is likely described here:
viewtopic.php?f=27&t=7629&p=23567&hilit ... hrt#p23567
User avatar
raboof
Established Member
Posts: 1855
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 50 times
Been thanked: 74 times
Contact:

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by raboof »

Digital Larry wrote: Fri Mar 20, 2020 2:40 am

Code: Select all

$ perl ./realTimeConfigQuickScan.pl
Checking whether you're in the 'audio' group... yes - good
chrt: failed to set pid 0's policy: Operation not permitted
Checking the ability to prioritize processes with chrt... no - not good
Could not assign a 80 rtprio SCHED_FIFO value. Set up limits.conf.
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#limitsconfaudioconf
limits.conf

Code: Select all

$ grep audio /etc/security/limits.conf
@audio - rtprio 95       # maximum realtime priority
@audio - memlock unlimited  # maximum locked-in-memory address space (KB)
$
I think you have to log out and log in again (or perhaps even reboot) to make changes to limits.conf take effect.
User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

raboof wrote: Fri Mar 20, 2020 10:24 am I think you have to log out and log in again (or perhaps even reboot) to make changes to limits.conf take effect.
Rebooting didn't change the test result. It still works a lot better than before.
tramp
Established Member
Posts: 2335
Joined: Mon Jul 01, 2013 8:13 am
Has thanked: 9 times
Been thanked: 454 times

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by tramp »

maybe you are affected by
https://github.com/systemd/systemd/issues/11386

check the output of:

Code: Select all

systemctl --version
if it is 240, you are affected.
On the road again.
User avatar
lilith
Established Member
Posts: 1698
Joined: Fri May 27, 2016 11:41 pm
Location: bLACK fOREST
Has thanked: 117 times
Been thanked: 57 times
Contact:

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by lilith »

tramp wrote: Fri Mar 20, 2020 3:01 pm maybe you are affected by
https://github.com/systemd/systemd/issues/11386

check the output of:

Code: Select all

systemctl --version
if it is 240, you are affected.
Better affected than infected :lol:
User avatar
Digital Larry
Established Member
Posts: 150
Joined: Thu Jan 09, 2014 5:25 am

Re: I just want a stable Linux desktop to develop and run Faust programs

Post by Digital Larry »

Code: Select all

gary@gary-MacBookPro:~$ systemctl --version
systemd 242 (242)
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid
gary@gary-MacBookPro:~$
Post Reply