Get /R/ running on MX Linux, Pipewire, ALSA, Real Time Thread?

oh, man…hi there, lets go…

At first - Do i need it?
You can maybe uncheck the checkmark. What is working at the first time.
But after i got a Shut Down of Renois while using Sampler and VST Plugin same time,
a re-open Renoise got the same crackle sound as before the uncheck RT.
And i do not understand why this is happen.

I do not have reboot the system yet, but i will try to get the clear sound back after uncheck the ckeckmark
for real time audio what worked.

[ ] use realtime priority (requires rtprio permissions)

Before this, i log out/ reboot and proof if my setting (i describe below) for real time thread its working to run Renoise.

If this is working this can be used as a Tutorial for Beginners to fix Real Time (RT) issues in ALSA with Pipewire on Debian Systen (MX Linux). (if you need, and if the checkmark not unchecked)

So this can be pretty technical for beginners as well.

So i switched from Windows to Linux and really want to use Renoise on my System, but as a Linux Beginner the realtime thing is kinda crazy and i don’t get it running, but i am about to solve it just now. I am afraid of configure ALSA for Real Time Thread, but it looks relative simple.

i read about check the kernel config for these setting in

/boot/config-6.14.8-1-liquorix-amd64

open this file and i found this (strg+f for seaching)

CONFIG_PREEMPT=y
# CONFIG_PREEMPT_LAZY is not set
# CONFIG_PREEMPT_RT is not set

So it seems RealTime is not set.
But anyways. It seems i need to edit the mentioned in the FAQ Setting: (Linux FAQ - Renoise User Manual)

$sudo nano /etc/security/limits.conf

and added with a normal “-” at the end, before #End of Line (it is a comment anyways):

xx - rtprio 99
xx - nice -10

i change “myusername” to my actual used username in this case “xx” on the system, right?
I am not sure about xx - memlock 512000 option so i dont set this up (link in the FAQ)
to check if its working, save, re-login or reboot.

And it does’t work.

As you read above i found to uncheck the option (opt-out) in the setting :sweat_smile:
[ ] use real time priority
and this works right now, until i got an issue and open renoise again, after is suddenly closed.

So, actually, i dont know how this setting work, why it actuall not work after the sudden close.
What i need to do?


i try to follow the Linux FAQ and added additional Information about my system and what i sould check:

Operating System: MX Linux 23
KDE Plasma Version: 5.27.5
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version:  (64-bit)
Graphics Platform: X11 (v7.7)
Processors: 20 × Intel® Core™ i5-14600K
Memory: 62.6 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 4070 Ti SUPER

Audio:
  Device-1: Intel Raptor Lake High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel
    bus-ID: 1-11:6 v: kernel alternate: snd_soc_avs,snd_sof_pci_intel_tgl chip-ID: 0db0:a74b
    bus-ID: 00:1f.3 class-ID: 0300 chip-ID: 8086:7a50 class-ID: 0403
  Device-2: NVIDIA vendor: Palit Microsystems driver: snd_hda_intel
  Device-3: Micro Star USB Audio type: USB driver: hid-generic,snd-usb-audio,usbhid
  API: ALSA v: k6.14.8-1-liquorix-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 
1: pipewire-pulse status: active
2: wireplumber status: active 
3: pipewire-alsa type: plugin 
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl

more tech check:

: libasound2 - installed
: x11 v7.7 - installed
: libstdc++6 v.12.2 - installed
: gcc v.4.12 - installed
: libc6 - installed
: libgcc-s1 v.12.2 - installed
: libxau6 - installed
: libxdmcp6 - installed

Thread in Progress. Any comments appreciated.

Im not familiar with MXLinux, Im just a scrub who uses Ubuntu.
This may not be the answer you are looking for, but try using JACK instead of ALSA (Edit:Preferences:Device Type in renoise). ALSA has always performed terribly for me (not just in renoise, in everything)

i do not wanna try change ALSA to Jack (or Also running to Jack), for now. i am very happy that my machine is working. So if i should try this i need a explicit Tutorial i can use.
I know that it is maybe not that complicated to switch the audio-engine / Driver?
But will it solve this issue with ReakTime Audio or will Jack work without RT Thread?

If you want a batteries included mx version for audio production to hack on you could try this

Can you run this script and post the output, please?

This will check your audio configuration.

I also would use the stock kernel if you don´t have any problems with it. They are fine for audio and the liquorix kernel is more for gamers.

very interessting but i would struggle to figure out how to get it runing by copy copy code…
because i am a noob…i would appreciate an easier way

nice music → followed :wink:

1 Like

I know about this distribution but i am not focussed on audio…just wanted to use Renoise additional in my systeme

ok no problem.

Open a terminal and first check if python is installed with

python --version

or

python3 --version

If you don’t get a version number install it with

sudo apt install python3

You also need python3-pip and python3-venv.

You can install it with

sudo apt install python3-pip
sudo apt install python3-venv

Then you make a folder called rtcqs somewhere on your drive with

mkdir rtcqs

then you enter the directory

cd rtcqs

Then

python3 -m venv venv &&

Then you’ll get a > sign … and you further enter

. venv/bin/activate && (the dot is important!)

and

pip install --upgrade rtcqs

after that you can run the script with

rtcqs

To leave just close the terminal or leave the virtual environment wit exit.

Here’s the direct out put from my terminal:

fox@fox:~/tools/rtcqs$ python3 -m venv venv &&
> . venv/bin/activate &&
> pip install --upgrade rtcqs
Collecting rtcqs
  Downloading rtcqs-0.6.6-py3-none-any.whl.metadata (5.4 kB)
Collecting PySimpleGUI-4-foss (from rtcqs)
  Downloading PySimpleGUI_4_foss-4.60.4.1-py3-none-any.whl.metadata (1.1 kB)
Downloading rtcqs-0.6.6-py3-none-any.whl (25 kB)
Downloading PySimpleGUI_4_foss-4.60.4.1-py3-none-any.whl (689 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 689.5/689.5 kB 6.5 MB/s eta 0:00:00
Installing collected packages: PySimpleGUI-4-foss, rtcqs
Successfully installed PySimpleGUI-4-foss-4.60.4.1 rtcqs-0.6.6
(venv) fox@fox:~/tools/rtcqs$ ll
insgesamt 4
drwxrwxr-x 5 fox fox 4096 Jun  4 21:10 venv/
(venv) fox@fox:~/tools/rtcqs$ cd venv/
(venv) fox@fox:~/tools/rtcqs/venv$ ll
insgesamt 16
drwxrwxr-x 2 fox fox 4096 Jun  4 21:10 bin/
drwxrwxr-x 3 fox fox 4096 Jun  4 21:10 include/
drwxrwxr-x 3 fox fox 4096 Jun  4 21:10 lib/
lrwxrwxrwx 1 fox fox    3 Jun  4 21:10 lib64 -> lib/
-rw-rw-r-- 1 fox fox  165 Jun  4 21:10 pyvenv.cfg
(venv) fox@fox:~/tools/rtcqs/venv$ cd ..
(venv) fox@fox:~/tools/rtcqs$ ll
insgesamt 4
drwxrwxr-x 5 fox fox 4096 Jun  4 21:10 venv/
(venv) fox@fox:~/tools/rtcqs$ rtcqs
rtcqs - version 0.6.6

Root User
=========
[ OK ] Not running as root.

Group Limits
============
[ OK ] User fox is member of a group that has sufficient rtprio (95) and memlock (unlimited) limits set.

CPU Frequency Scaling
=====================
[ OK ] The scaling governor of all CPUs is set to performance.

Simultaneous Multithreading
===========================
[ WARNING ] Simultaneous Multithreading (SMT, also called hyper-threading) is enabled. This can cause spikes in DSP load at higher DSP loads. Consider disabling SMT when experiencing such spikes with 'echo off | sudo tee /sys/devices/system/cpu/smt/control'. See also https://wiki.linuxaudio.org/wiki/system_configuration#simultaneous_multithreading

Kernel Configuration
====================
[ OK ] Valid kernel configuration found.

High Resolution Timers
======================
[ OK ] High resolution timers are enabled.

Tickless Kernel
===============
[ OK ] System is using a tickless kernel.

Preempt RT
==========
[ WARNING ] Kernel 6.11.0-26-generic without 'threadirqs' parameter or real-time capabilities found. See also https://wiki.linuxaudio.org/wiki/system_configuration#do_i_really_need_a_real-time_kernel

Spectre/Meltdown Mitigations
============================
[ WARNING ] Kernel with Spectre/Meltdown mitigations found. This could have a negative impact on the performance of your system. See also https://wiki.linuxaudio.org/wiki/system_configuration#disabling_spectre_and_meltdown_mitigations

RT Priorities
=============
[ OK ] Realtime priorities can be set.

Swappiness
==========
[ OK ] Swappiness is set at 10.

Filesystems
===========
[ OK ] The following mounts can be used for audio purposes: /, /home, /media/fox/writable
[ WARNING ] The following mounts should be avoided for audio purposes: /tmp/.mount_pcloudzPQTiW, /home/fox/pCloudDrive. See also https://wiki.linuxaudio.org/wiki/system_configuration#filesystems

IRQs
====
[ OK ] USB port xhci_hcd with IRQ 71 does not share its IRQ.
[ OK ] USB port xhci_hcd with IRQ 88 does not share its IRQ.
[ OK ] Soundcard snd_hda_intel:card1 with IRQ 102 does not share its IRQ.
[ OK ] USB port xhci_hcd with IRQ 62 does not share its IRQ.
[ OK ] USB port xhci_hcd with IRQ 80 does not share its IRQ.
[ OK ] Soundcard snd_hda_intel:card0 with IRQ 101 does not share its IRQ.

Power Management
================
[ WARNING ] Power management can't be controlled from user space, the device node /dev/cpu_dma_latency can't be accessed by your user. This prohibits DAWs like Ardour and Reaper to set CPU DMA latency which could help prevent xruns. For enabling access see https://wiki.linuxaudio.org/wiki/system_configuration#quality_of_service_interface

It sounds more complicated than it is.

mx@mx:~/rtcqs
$ rtcqs
rtcqs - version 0.6.6

Root User

[ OK ] Not running as root.

Group Limits

[ WARNING ] User mx is currently not member of a group that has sufficient rtprio (99) and memlock (8388608) set
. Add yourself to a group with sufficent limits set, i.e. audio or realtime, with 'sudo usermod -a -G <group_nam
e> mx. See also System configuration [Linux-Sound]

CPU Frequency Scaling

[ WARNING ] The scaling governor of one or more CPUs is not set to ‘performance’. You can set the scaling govern
or to ‘performance’ with ‘cpupower frequency-set -g performance’ or ‘cpufreq-set -r -g performance’ (Debian/Ubun
tu). See also System configuration [Linux-Sound]

Simultaneous Multithreading

[ WARNING ] Simultaneous Multithreading (SMT, also called hyper-threading) is enabled. This can cause spikes in
DSP load at higher DSP loads. Consider disabling SMT when experiencing such spikes with ‘echo off | sudo tee /sy
s/devices/system/cpu/smt/control’. See also System configuration [Linux-Sound]
ultithreading

Kernel Configuration

[ OK ] Valid kernel configuration found.

High Resolution Timers

[ OK ] High resolution timers are enabled.

Tickless Kernel

[ OK ] System is using a tickless kernel.

Preempt RT

[ WARNING ] Kernel 6.14.8-1-liquorix-amd64 without ‘threadirqs’ parameter or real-time capabilities found. See a
lso System configuration [Linux-Sound]

Spectre/Meltdown Mitigations

[ WARNING ] Kernel with Spectre/Meltdown mitigations found. This could have a negative impact on the performance
of your system. See also System configuration [Linux-Sound]
itigations

RT Priorities

[ OK ] Realtime priorities can be set.

Swappiness

[ WARNING ] vm.swappiness is set to 15 which is too high. Set swappiness to a lower value by adding ‘vm.swappine
ss=10’ to /etc/sysctl.conf and run ‘sysctl --system’. See also wiki:system_configura [Linux-Sound]
tion#sysctlconf

Filesystems

[ OK ] The following mounts can be used for audio purposes: /

IRQs

[ OK ] Soundcard snd_hda_intel:card1 with IRQ 17 does not share its IRQ.
[ OK ] Soundcard snd_hda_intel:card0 with IRQ 159 does not share its IRQ.
[ OK ] USB port xhci_hcd with IRQ 143 does not share its IRQ.

Power Management

[ WARNING ] Power management can’t be controlled from user space, the device node /dev/cpu_dma_latency can’t be
accessed by your user. This prohibits DAWs like Ardour and Reaper to set CPU DMA latency which could help preven
t xruns. For enabling access see System configuration [Linux-Sound]
ace

Ok, 2 issues here.

  1. You need to add yourself to the audio group
  2. Your CPU governor is not set to performance

For 1 try adding you to the audio group with

sudo usermod -a -G audio  <username> 

username seems to be mx, i.e.

sudo usermod -a -G audio  mx 

For 2. you can install the programm e.g. cpupower-gui

sudo apt install cpupower-gui

With this you can set your CPU to performance mode. Please check then again with the script if it works.

$ sudo nala install cpupower-gui
Fehler: cpupower-gui nicht gefunden (not found)

it is this one?

$ which cpupower
/usr/src/linux-headers-6.14.8-1-liquorix-amd64/tools/power/cpupower/cpupower
$ cpupower
Usage:  cpupower [-d|--debug] [-c|--cpu cpulist ] <command> [<args>]
Supported commands are:
        frequency-info
        frequency-set
        idle-info
        idle-set
        powercap-info
        set
        info
        monitor
        help

Not all commands can make use of the -c cpulist option.

Use 'cpupower help <command>' for getting help for above commands.

one more thing. You most likely have to add an entry to your limits.conf file

This is usually in ‘/etc/security/limits.conf’

In this file you have to add two entries. These are

@audio   -  rtprio     95
@audio   -  memlock    unlimited

you need to edit the file with sudo and a text editor (nano for example).

→ sudo nano /etc/security/limits.conf

add the entries and save it.

Yes this also should work:

in a terminal run:
cpupower frequency-set --governor performance

https://askubuntu.com/questions/1021748/set-cpu-governor-to-performance-in-18-04

You can also make the change persistent.

why not:

@audio - rtprio 99
@audio - nice -10

how to check i am in audio group?

If you set it too high your PC could freeze because audio get’s a to high priority iirc.

Checking for audio group

fgrep -ie ‘audio’ /etc/group

https://wiki.ubuntu.com/Audio/TheAudioGroup

groups mx works also :smiley:
mx is in audio…back to the “stuff”

1 Like

this is done

@audio   -  rtprio     95
@audio   -  memlock    unlimited
1 Like

Perfect. Crackling should be gone now!

Maybe log out and in or better reboot.

second…

mx@mx:~
$ cpupower frequency-set --governor performance
Subcommand frequency-set needs root privileges
mx@mx:~
$ sudo cpupower frequency-set --governor performance
sudo: cpupower: Befehl nicht gefunden

its a missing package i spotted in synaptic…
i install it


$ sudo cpupower frequency-set --governor performance
CPU einstellen: 0
CPU einstellen: 1
CPU einstellen: 2
CPU einstellen: 3
CPU einstellen: 4
CPU einstellen: 5
CPU einstellen: 6
CPU einstellen: 7
CPU einstellen: 8
CPU einstellen: 9
CPU einstellen: 10
CPU einstellen: 11
CPU einstellen: 12
CPU einstellen: 13
CPU einstellen: 14
CPU einstellen: 15
CPU einstellen: 16
CPU einstellen: 17
CPU einstellen: 18
CPU einstellen: 19

??