Realtime kernel for audio

fresh install 21.4 KDE & 5.14.10 kernel …
can’t configure kernel for realtime with cadence & jack2 …
current status is …

= GUI-enabled checks ==

Checking if you are root... no - **good**

Checking filesystem 'noatime' parameter... 5.14.10 kernel - **good**

(relatime is default since 2.6.30)

Checking CPU Governors... CPU 0: 'schedutil' CPU 1: 'schedutil' CPU 2: 'schedutil' CPU 3: 'schedutil' - **not good**

Set CPU Governors to 'performance' with

'cpupower frequency-set -g performance' (Arch)

or 'cpufreq-set -c <cpunr> -g performance' (Debian/Ubuntu)

See also: linuxmusicians dot com/viewtopic dot php?f=27&t=844

Checking swappiness... System running without disk swap - **good**

** Your system is configured without swap. No swap => no problem between swap and realtime

Checking for resource-intensive background processes... none found - **good**

Checking checking sysctl inotify max_user_watches... >= 524288 - **good**

Checking whether you're in the 'audio' group... no - **not good**

add yourself to the audio group with 'adduser $USER audio'

sudo useradd -g $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 wiki linuxaudioorg/wiki/system_configuration#limitsconfaudioconf

@audio - rtprio 90 # maximum realtime priority

@audio - memlock unlimited # maximum locked-in-memory address space (KB)

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

any suggestions ?

1 Like

what about the rt kernels ?

Also … please use the </> ‘code’ button to format output like that.

EDIT - I fixed it for you :wink:

I have been checking the latest Manjaro ISOs with realtimeconfigquickscan but I had not checked KDE yet, so thank you for posting this

The scan response appears to be the same as on Xfce and Cinnamon
Gnome has 6 not-good warnings but only needs one additional reconfiguration

Checking whether you’re in the ‘audio’ group… no - not good

  • Use the suggested command ONE TIME ONLY to add user to audio group
    sudo useradd -g $USER audio
    

Checking the ability to prioritize processes with chrt… no - not good

  • Install package realtime-privileges
    pamac install realtime-privileges
    
  • When package install is completed, use this command ONE TIME ONLY to add user to realtime group
    sudo useradd -g $USER realtime
    

Kernel with Real-Time Preemption… not found - not good

There are 2 possible options for this:

  1. install a realtime kernel

    1.1 Use Manjaro Settings Manager GUI ( manjaro-settings-manager -m msm_kernel )

    1.2 Or use one of these commands
    sudo mhwd-kernel --install linux515-rt
    sudo mhwd-kernel --install linux510-rt

  2. use threaded IRQ option with standard Manjaro kernel

    2.1 Install package rtirq:

    pamac install rtirq 
    

    2.2 Open GRUB grub configuration with a text editor

    sudo nano /etc/default/grub
    

    2.3 Edit line 5 (GRUB_CMDLINE_LINUX_DEFAULT) and add boot option threadirqs like this:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet udev.log_priority=3 threadirqs"
    

    2.4 Update GRUB

    sudo update-grub
    

Checking CPU Governors… CPU 0: ‘schedutil’ CPU 1: ‘schedutil’ CPU 2: ‘schedutil’ CPU 3: ‘schedutil’ - not good

(The command suggested in realtimeconfigquickscan works but it is not persistent and does not survive system reboot)

  • Use this command to reconfigure cpupower CPU governor to performance
    sudo sed -i 's/governor='performance'/#governor='powersave'/g' /etc/default/cpupower
    
  • Use this command to start and enable cpupower.service
    systemctl enable --now cpupower.service
    

System must be restarted to load the first 3 configuration changes, but the CPU governor configuration does not require a reboot

Running realtimeconfigquickscan again should confirm system is now all good for JACK

1 Like

thx nik, the single core 3 ‘not good’ is perplexing … the i3 cpu is dual core …
cadence flags ok for realtime & user in audio group, but jack fails to start …
what gives ?

./realTimeConfigQuickScan.pl
== GUI-enabled checks ==
Checking if you are root… no - good
Checking filesystem ‘noatime’ parameter… 5.15.5 kernel - good
(relatime is default since 2.6.30)
Checking CPU Governors… CPU 0: ‘schedutil’ CPU 1: ‘schedutil’ CPU 2: ‘schedutil’ CPU 3: ‘schedutil’ - not good
Set CPU Governors to ‘performance’ with ‘cpupower frequency-set -g performance’ or ‘cpufreq-set -c -g performance’ (Debian/Ubuntu)
See also: cpu frequency scaling - LinuxMusicians
Checking swappiness… System running without disk swap - good
** Your system is configured without swap. No swap => no problem between swap and realtime
Checking for resource-intensive background processes… none found - good
Checking checking sysctl inotify max_user_watches… >= 524288 - 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… found - good
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.
sh-5.1$

Intel i3 has 2 hyperthreading cores so would have 4 threads and hence 4 CPU governors

The not good for the CPU Governors should not prevent JACK starting. The schedutil governor is not much different to performance and would at worst cause some xruns when JACK is running, but many users don’t have any problem

Check Cadence JACK message Logs for error messages when JACK is started
KXStudio : Applications : Cadence-Logs

thx Nik, jack error logs …
on Dec 27 16:09:43 2021: ------------------
Mon Dec 27 16:09:45 2021: Controller activated. Version 1.9.19 (0+3e6ca6b734b69e2f5dfb85935068e15006fb5acf-dirty) built on Mon Jul 26 10:15:38 2021
Mon Dec 27 16:09:45 2021: ERROR: Could not open component .so ‘/usr/lib/jack/jack_firewire.so’: libffado.so.2: cannot open shared object file: No such
file or directory
Mon Dec 27 16:09:45 2021: ERROR: Could not open component .so ‘/usr/lib/jack/jack_firewire.so’: libffado.so.2: cannot open shared object file: No such
file or directory
Mon Dec 27 16:09:45 2021: ERROR: jack_get_descriptor : dll
Mon Dec 27 16:09:45 2021: ERROR: jack_get_descriptor returns null for ‘jack_firewire.so’
Mon Dec 27 16:09:45 2021: ERROR: Could not open component .so ‘/usr/lib/jack/jack_firewire.so’: libffado.so.2: cannot open shared object file: No such
file or directory
Mon Dec 27 16:09:45 2021: Loading settings from “/home/apache/.config/jack/conf.xml” using expat_2.4.1 …
Mon Dec 27 16:09:46 2021: setting parameter ‘engine’:‘driver’:’(null)’ to value “alsa”
Mon Dec 27 16:09:46 2021: setting parameter ‘engine’:‘realtime-priority’:’(null)’ to value “6”
Mon Dec 27 16:09:46 2021: setting parameter ‘drivers’:‘alsa’:‘capture’ to value “hw:MID,0”
Mon Dec 27 16:09:46 2021: setting parameter ‘drivers’:‘alsa’:‘playback’ to value “hw:MID,0”
Mon Dec 27 16:09:46 2021: setting parameter ‘drivers’:‘alsa’:‘inchannels’ to value “3”
Mon Dec 27 16:09:46 2021: setting parameter ‘drivers’:‘alsa’:‘outchannels’ to value “3”
Mon Dec 27 16:09:46 2021: Listening for D-Bus messages
Mon Dec 27 16:09:46 2021: Controller deactivated.
Mon Dec 27 16:09:47 2021: ------------------
Mon Dec 27 16:09:47 2021: Controller activated. Version 1.9.19 (0+3e6ca6b734b69e2f5dfb85935068e15006fb5acf-dirty) built on Mon Jul 26 10:15:38 2021
Mon Dec 27 16:09:47 2021: ERROR: Could not open component .so ‘/usr/lib/jack/jack_firewire.so’: libffado.so.2: cannot open shared object file: No such
file or directory
Mon Dec 27 16:09:47 2021: ERROR: Could not open component .so ‘/usr/lib/jack/jack_firewire.so’: libffado.so.2: cannot open shared object file: No such
file or directory
Mon Dec 27 16:09:47 2021: ERROR: jack_get_descriptor : dll
Mon Dec 27 16:09:47 2021: ERROR: jack_get_descriptor returns null for ‘jack_firewire.so’
Mon Dec 27 16:09:47 2021: ERROR: Could not open component .so ‘/usr/lib/jack/jack_firewire.so’: libffado.so.2: cannot open shared object file: No such
file or directory
Mon Dec 27 16:09:47 2021: Loading settings from “/home/apache/.config/jack/conf.xml” using expat_2.4.1 …
Mon Dec 27 16:09:47 2021: setting parameter ‘engine’:‘driver’:’(null)’ to value “alsa”
Mon Dec 27 16:09:47 2021: setting parameter ‘engine’:‘realtime-priority’:’(null)’ to value “6”
Mon Dec 27 16:09:47 2021: setting parameter ‘drivers’:‘alsa’:‘capture’ to value “hw:MID,0”
Mon Dec 27 16:09:47 2021: setting parameter ‘drivers’:‘alsa’:‘playback’ to value “hw:MID,0”
Mon Dec 27 16:09:47 2021: setting parameter ‘drivers’:‘alsa’:‘inchannels’ to value “3”
Mon Dec 27 16:09:47 2021: setting parameter ‘drivers’:‘alsa’:‘outchannels’ to value “3”
Mon Dec 27 16:09:47 2021: Listening for D-Bus messages
Mon Dec 27 16:09:47 2021: Starting jack server…
Mon Dec 27 16:09:47 2021: JACK server starting in realtime mode with priority 6
Mon Dec 27 16:09:47 2021: self-connect-mode is “Don’t restrict self connect requests”
Mon Dec 27 16:09:53 2021: Device reservation request with priority 2147483647 denied for “Audio0”: org.freedesktop.DBus.Error.NoReply (Did not receive
a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply,
Mon Dec 27 16:09:53 2021: ERROR: Failed to acquire device name : Audio0 error : Did not receive a reply. Possible causes include: the remote applicati
on did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broke
Mon Dec 27 16:09:53 2021: ERROR: Audio device hw:MID,0 cannot be acquired…
Mon Dec 27 16:09:53 2021: ERROR: Cannot initialize driver
Mon Dec 27 16:09:53 2021: ERROR: JackServer::Open failed with -1
Mon Dec 27 16:09:53 2021: ERROR: Failed to open serverPreformatted text

JACK is configured to use the onboard audio device hw:MID,0 but is trying to create 3 audio channels for audio capture and playback

Mon Dec 27 16:09:47 2021: setting parameter ‘drivers’:‘alsa’:‘inchannels’ to value “3”
Mon Dec 27 16:09:47 2021: setting parameter ‘drivers’:‘alsa’:‘outchannels’ to value “3”

IDT 92HD87B1/3 audio codec only has 2 channels for stereo analog audio capture and playback
HW probe of Dell Inspiron N5040 #e6a927609f: amixer

I suggest you go to Cadence settings and set input channels and output channels to 2
KXStudio Documentation : Manual : JACK Configuration