Lots of Xruns with Carla
Moderators: MattKingUSA, khz
Lots of Xruns with Carla
Hi.
I got back to kstudio and Linux music after a long time. I installed kstudio software from ppa over kubuntu LTS. My soundcard is an USB Scarlett 2i2.
I was then experimenting with reaper for Linux and some vst on Carla. Namely RandArp (win vst) and talk noisemaker. The objective was to make some vintage su the arpeggio a la hungry like the wolf or neverending story.
The basic setup works fine. I have the midi track in reaper routed to RandArp in random mode and then to the synth loaded in Carla. The problem is that I get lots of xruns every minute.
I tried with different combination of buffer size (from 128 to 512) and periods (2/3). Nothing helps. Xruns keep accumulating even with transport off.
The message I see in jack status is:
JackEngine::Xrun client = Carla was not finished, state = running
JackAudioDriver::ProcessGraphAsyncMaster: process error
According to Cadence my kernel is 5.3.0 generic and my user is not in audio group. I don't remember if this info matters anymore or how to fixed.
Can anybody help please?
I got back to kstudio and Linux music after a long time. I installed kstudio software from ppa over kubuntu LTS. My soundcard is an USB Scarlett 2i2.
I was then experimenting with reaper for Linux and some vst on Carla. Namely RandArp (win vst) and talk noisemaker. The objective was to make some vintage su the arpeggio a la hungry like the wolf or neverending story.
The basic setup works fine. I have the midi track in reaper routed to RandArp in random mode and then to the synth loaded in Carla. The problem is that I get lots of xruns every minute.
I tried with different combination of buffer size (from 128 to 512) and periods (2/3). Nothing helps. Xruns keep accumulating even with transport off.
The message I see in jack status is:
JackEngine::Xrun client = Carla was not finished, state = running
JackAudioDriver::ProcessGraphAsyncMaster: process error
According to Cadence my kernel is 5.3.0 generic and my user is not in audio group. I don't remember if this info matters anymore or how to fixed.
Can anybody help please?
- 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: Lots of Xruns with Carla
Yes I guess that's part of the problem.
Can you run this script from here and post the output?
https://github.com/raboof/realtimeconfigquickscan
Just open a terminal and execute
You need to install git first from your repository.
Can you run this script from here and post the output?
https://github.com/raboof/realtimeconfigquickscan
Just open a terminal and execute
Code: Select all
git clone git://github.com/raboof/realtimeconfigquickscan.git
cd realtimeconfigquickscan
perl ./realTimeConfigQuickScan.pl
Re: Lots of Xruns with Carla
Here it is. Thank you very much for your help.
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: 'powersave' CPU 1: 'powersave' CPU 2: 'powersave' CPU 3: 'powersave' - not good
Set CPU Governors to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -c <cpunr> -g performance' (Debian/Ubuntu)
See also: http://linuxmusicians.com/viewtopic.php?f=27&t=844
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 /etc/sysctl.conf and rebooting
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#sysctlconf
Checking access to the high precision event timer... not readable - not good
/dev/hpet found, but not readable.
make /dev/hpet readable by the 'audio' group
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#hardware_timers
Checking access to the real-time clock... not readable - not good
/dev/rtc found, but not readable.
make /dev/rtc readable by the 'audio' group
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#hardware_timers
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
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 'threadirqs' parameter or real-time capabilities found
For more information, see https://wiki.linuxaudio.org/wiki/system_configuration#do_i_really_need_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.
- 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: Lots of Xruns with Carla
Can you please check if you have kxstudio-default-settings installed? This script should adjust all of the crucial settings.
If not, please install it from the KX repo and reboot and again execute realtimeconfigscan.
Your CPU cores are not running at full speed which is for sure responsible for xruns.
If not, please install it from the KX repo and reboot and again execute realtimeconfigscan.
Your CPU cores are not running at full speed which is for sure responsible for xruns.
Re: Lots of Xruns with Carla
I have that package (and all others I could install from kstudio PPA) installed.
Is there a script or tool I should run?
I think there's a lowlatency kernel available somewhere in the package manager to install. Could I just install it? Would it help? And in case, is it tricky to do it and/or are there any other steps I should take to enable it?
I'm on a multiboot setup with Windows, Manjaro and another regular Ubuntu 19.10 installed, in case it matters. I would really like not to mess up with the other systems.
Is there a script or tool I should run?
I think there's a lowlatency kernel available somewhere in the package manager to install. Could I just install it? Would it help? And in case, is it tricky to do it and/or are there any other steps I should take to enable it?
I'm on a multiboot setup with Windows, Manjaro and another regular Ubuntu 19.10 installed, in case it matters. I would really like not to mess up with the other systems.
- 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: Lots of Xruns with Carla
That's strange, because the kx studio default setting package should do all these things for you.
@ others: That's right, isn't it?
You don't need the low latency kernel at the moment, that's one of the last things if you still need better performance.
Stupid question, but after adding the KX repo you also installed it, right? I guess so, because you have Carla already running.
@ others: That's right, isn't it?
You don't need the low latency kernel at the moment, that's one of the last things if you still need better performance.
Stupid question, but after adding the KX repo you also installed it, right? I guess so, because you have Carla already running.
Code: Select all
sudo apt update
sudo apt upgrade
Re: Lots of Xruns with Carla
I think i installed everything correctly. I istalled most if not every package from the PPA. I even have the KXStudio look and feel. Cadence, Carla, Claudia... every appseems to work, except for the latency issue.lilith wrote: ↑Wed Apr 15, 2020 10:21 pm That's strange, because the kx studio default setting package should do all these things for you.
@ others: That's right, isn't it?
You don't need the low latency kernel at the moment, that's one of the last things if you still need better performance.
Stupid question, but after adding the KX repo you also installed it, right? I guess so, because you have Carla already running.
Code: Select all
sudo apt update sudo apt upgrade
One other thing I noticed that isn't working is that if I try to create an Ardour session it fails when trying to create the folder in my home folder. I didn't notice it before cecause I'm using Reaper. Could it be a permission problem at the root of both issues?
As a side note, if I set Jack to 1024 buffer size it seems to work without xruns.
So, what do you suggetst? Should i try reinstalling the setting package and see if it fixes it? Or trying to go through the quick scan suggestions one by one?
- 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: Lots of Xruns with Carla
Can you post the output of e.g. cat /etc/security/limits.d/audio.conf please? That's a folder which is for instance made by kx studio.
I would kxsudio make all the settings. Doing it by hand can potentially collide with settings kx studio is doing for you.
I would kxsudio make all the settings. Doing it by hand can potentially collide with settings kx studio is doing for you.
Re: Lots of Xruns with Carla
sure, here it is.
$ cat /etc/security/limits.d/audio.conf
# Provided by the jackd package.
#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
# dpkg-reconfigure -p high jackd
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19
- 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: Lots of Xruns with Carla
Ok, then set the cpu governor to performance by hand as described here:
https://wiki.linuxaudio.org/wiki/system ... are_timers
First check if you have an audio group with. If so make:
You likely have to be root for these changes.
Install rtirq-init from your repository.
Reboot and post the output of realtimeconfig again.
https://wiki.linuxaudio.org/wiki/system ... are_timers
Set your user to the audio group:Debian
On Debian you can control the scaling governor with the cpufreq-set utility which is part of the cpufrequtils package:
sudo cpufreq-set -r -g performance
On installation the package also installs an init script in /etc/init.d/cpufrequtils and a configuration file in /etc/default/cpufrequtils. To have the governor always set to performance make sure the configuration file looks as follows:
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="0"
MIN_SPEED="0"
First check if you have an audio group with
Code: Select all
groups
Code: Select all
adduser $yourUSERname audio
Install rtirq-init from your repository.
Reboot and post the output of realtimeconfig again.
Re: Lots of Xruns with Carla
The instructions on the wiki regarding cpufreq-set seem not to be up to date.
The correnc command should be
where 0 is the index of your processors (in my case I have to issue the command 4 times from 0 to 3)
After doing that the script teports the correct situation
Even though I created and edited the /etc/default/cpufrequtils it didn't seem to have any effect and after the reboot the script again reports
Regarding the audio group I fixed the issue.
For the sake of completeness, the command only lists groups you user belongs to, not the full list. If you want to see it you must
The correnc command should be
Code: Select all
cpufreq-set -c 0 -g performance
After doing that the script teports the correct situation
Code: Select all
tarrasque@Tron:~/realtimeconfigquickscan$ 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 - not good
increase max_user_watches by adding 'fs.inotify.max_user_watches = 524288' to /etc/sysctl.conf and rebooting
For more information, see http://wiki.linuxaudio.org/wiki/system_configuration#sysctlconf
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
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 'threadirqs' parameter or real-time capabilities found
For more information, see https://wiki.linuxaudio.org/wiki/system_configuration#do_i_really_need_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.
Code: Select all
Checking CPU Governors... CPU 0: 'powersave' CPU 1: 'powersave' CPU 2: 'powersave' CPU 3: 'powersave' - not good
For the sake of completeness, the
Code: Select all
groups
Code: Select all
less /etc/group
- 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: Lots of Xruns with Carla
Does work?
https://blog.sleeplessbeastie.eu/2015/1 ... r-at-boot/
This is also explained here: https://wiki.linuxaudio.org/wiki/system ... are_timers
Code: Select all
echo -n performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
https://blog.sleeplessbeastie.eu/2015/1 ... r-at-boot/
This is also explained here: https://wiki.linuxaudio.org/wiki/system ... are_timers
Re: Lots of Xruns with Carla
The command outputs:lilith wrote: ↑Fri Apr 17, 2020 10:44 am Doeswork?Code: Select all
echo -n performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
https://blog.sleeplessbeastie.eu/2015/1 ... r-at-boot/
This is also explained here: https://wiki.linuxaudio.org/wiki/system ... are_timers
Code: Select all
$ echo -n performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
bash: /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor: ambiguous redirect
Could it be that the start script that is supposed to set the governor is not executed at all at boot?
Maybe it's better to follow the systemd way?
Code: Select all
Create systemd service file to set CPU governor at system boot.
$ cat << EOF | sudo tee /etc/systemd/system/cpupower.service
[Unit]
Description=CPU powersave
[Service]
Type=oneshot
ExecStart=/usr/bin/cpupower -c all frequency-set -g powersave
[Install]
WantedBy=multi-user.target
EOF
- 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: Lots of Xruns with Carla
Sorry, I think I was wrong. The CPU governor is not set by kxstudio. I have the kx default settings on my Laptop, but the governor has to be set by hand.Tarrasque wrote: ↑Sun Apr 19, 2020 9:17 pmThe command outputs:lilith wrote: ↑Fri Apr 17, 2020 10:44 am Doeswork?Code: Select all
echo -n performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
https://blog.sleeplessbeastie.eu/2015/1 ... r-at-boot/
This is also explained here: https://wiki.linuxaudio.org/wiki/system ... are_timers
I'm wondering: latest Ubuntu versions use systemd insted of initd.Code: Select all
$ echo -n performance > /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor bash: /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor: ambiguous redirect
Could it be that the start script that is supposed to set the governor is not executed at all at boot?
Maybe it's better to follow the systemd way?
As detailed here: https://blog.sleeplessbeastie.eu/2015/1 ... r-at-boot/Code: Select all
Create systemd service file to set CPU governor at system boot. $ cat << EOF | sudo tee /etc/systemd/system/cpupower.service [Unit] Description=CPU powersave [Service] Type=oneshot ExecStart=/usr/bin/cpupower -c all frequency-set -g powersave [Install] WantedBy=multi-user.target EOF