Wireplumber realtme problem and Realtime tweaks for Pro Audio

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

gabtram
Established Member
Posts: 38
Joined: Wed Nov 23, 2022 12:01 pm
Been thanked: 1 time

Wireplumber realtme problem and Realtime tweaks for Pro Audio

Post by gabtram »

Hi to all,

i have a working pipewire 0.3.71 configuration.
I have installed also wireplumber but i noticed some strange behaviour:

I find the the dir usr/share/wireplumber but i can't find etc/wireplumber
Also if i launch wireplumber from terminal i receive this:
During wireplumber also noticed that it enable a new object inide Carla with playback and capture channel but it blocks all.

Anyway pipewire works quite well.

Code: Select all

M 18:55:31.600531             mod.rt ../pipewire/src/modules/module-rt.c:272:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
M 18:55:31.601184             mod.rt ../pipewire/src/modules/module-rt.c:272:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
M 18:55:31.601355             mod.rt ../pipewire/src/modules/module-rt.c:654:set_nice: could not set nice-level to -11: No such file or directory
M 18:55:31.601839             mod.rt ../pipewire/src/modules/module-rt.c:272:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
M 18:55:31.604336             mod.rt ../pipewire/src/modules/module-rt.c:272:translate_error: RTKit error: org.freedesktop.DBus.Error.ServiceUnknown
W 18:55:31.639867                 pw ../pipewire/spa/plugins/bluez5/upower.c:52:upower_get_percentage_properties_reply: Failed to get percentage from UPower: org.freedesktop.DBus.Error.NameHasNoOwner
[2:31:48.784476984] [15537]  INFO Camera camera_manager.cpp:298 libcamera v0.0.5
W 18:55:31.650352         spa.bluez5 ../pipewire/spa/plugins/bluez5/bluez5-dbus.c:5198:get_managed_objects_reply: GetManagedObjects() failed: org.freedesktop.DBus.Error.NameHasNoOwner
W 18:55:32.133051 m-portal-permissio ../wireplumber/modules/module-portal-permissionstore.c:63:wp_portal_permissionstore_plugin_lookup: <WpPortalPermissionStorePlugin:0x56425ebed250> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.impl.portal.PermissionStore was not provided by any .service files
W 18:55:32.133923 m-portal-permissio ../wireplumber/modules/module-portal-permissionstore.c:63:wp_portal_permissionstore_plugin_lookup: <WpPortalPermissionStorePlugin:0x56425ebed250> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.impl.portal.PermissionStore was not provided by any .service files
W 18:55:32.158948 m-portal-permissio ../wireplumber/modules/module-portal-permissionstore.c:63:wp_portal_permissionstore_plugin_lookup: <WpPortalPermissionStorePlugin:0x56425ebed250> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.impl.portal.PermissionStore was not provided by any .service files
W 18:55:32.159979 m-portal-permissio ../wireplumber/modules/module-portal-permissionstore.c:63:wp_portal_permissionstore_plugin_lookup: <WpPortalPermissionStorePlugin:0x56425ebed250> Failed to call Lookup: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.impl.portal.PermissionStore was not provided by any .service files
Last edited by gabtram on Thu Jul 27, 2023 11:35 am, edited 1 time in total.
tseaver
Established Member
Posts: 408
Joined: Mon Mar 13, 2017 6:07 am
Has thanked: 12 times
Been thanked: 102 times

Re: Wireplumber is not installed correctly

Post by tseaver »

@gabtram To get appropriate help for your situation, please report your distro name and version, and how you installed Pipewire / wireplumber (e.g., from distro packages, from a backports repo, from downloaded binaries, from source, etc.)

Ubuntu, Mixbus32C; acoustic blues / country / jazz
User avatar
sunrat
Established Member
Posts: 926
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 152 times
Been thanked: 247 times

Re: Wireplumber is not installed correctly

Post by sunrat »

AFAIK /usr/share/wireplumber/ is the default but you can copy it to ~/.config/wireplumber/ or /etc/wireplumber/ if you wish to edit it.

From https://wiki.archlinux.org/title/WirePlumber

The configuration files are read from ~/.config/wireplumber/ (user configuration), /etc/wireplumber/ (global configuration), and then /usr/share/wireplumber/ (stock configuration).

gabtram
Established Member
Posts: 38
Joined: Wed Nov 23, 2022 12:01 pm
Been thanked: 1 time

Re: Wireplumber is not installed correctly

Post by gabtram »

Hi thanks,

i use Arch linux kernel 6.3.8
with last pipewire from AUR.
I posted also here: https://bbs.archlinux.org/viewtopic.php?id=286713

So i can create a dir here:

Code: Select all

~/.config/wireplumber

and the copy the file i want to ovveride... (i have to learn what to change, maybe there some trick to reduce latency changing parameters inside the .lua file? Have you some hints?).

Wireplumber is active on process monitor.

The Arch user said to me:

The mod.rt errors indicate that you don't have realtime privileges configured. If you don't need realtime then those errors can be ignored. Otherwise look at installing and configuring rtkit and realtime-privileges.

I haven't a response, perhaps i think yes! also noticed some xruns when i started guitarix or carla with 1024 buffer size and 48khz.

User avatar
bluebell
Established Member
Posts: 1927
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 113 times
Been thanked: 122 times

Re: Wireplumber is not installed correctly

Post by bluebell »

Put your user in the group audio and place a file into /etc/security/limits.d/ (e.g. audio.conf) with:

Code: Select all

@audio   -  rtprio     95
@audio   -  memlock    unlimited

Then log out and log in.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: Wireplumber is not installed correctly

Post by merlyn »

bluebell wrote: Mon Jun 26, 2023 1:13 pm

Put your user in the group audio and place a file into /etc/security/limits.d/ (e.g. audio.conf) with:

Code: Select all

@audio   -  rtprio     95
@audio   -  memlock    unlimited

Then log out and log in.

That's the right idea. On Arch Linux this works differently. The group with realtime privileges is called 'realtime'. Installing the package realtime-privileges should be enough IIRC.

Code: Select all

# pacman -S realtime-privileges
gabtram
Established Member
Posts: 38
Joined: Wed Nov 23, 2022 12:01 pm
Been thanked: 1 time

Re: Wireplumber is not installed correctly

Post by gabtram »

I made some of these tweaks,

but i have also some xruns.
Installed RTCQS

hese are my errors:
The scaling governor of one or more CPU's is not set to 'performance'. You can set the scaling governor to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -r -g performance' (Debian/Ubuntu). See also https://wiki.linuxaudio.org/wiki/system … cy_scaling
Is necessary

Kernel 6.4.4-arch1-1 without 'threadirqs' parameter or real-time capabilities found. See also https://wiki.linuxaudio.org/wiki/system … ime_kernel
I followed the guidem can't find kernel file in boot and trying to unzip the kernel file and change the configuration maybe can't understand something

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 … itigations
Is needed?

The following mounts should be avoided for audio purposes: /boot. See also https://wiki.linuxaudio.org/wiki/system … ilesystems
Can't understand this

Have you other hints?
I didn't want to make kernel tweaks cause the standard kernel of arch is just yet pretty well but if you use something very strong like vst3plugins via yabridge or ardour with 16 tracks (i have not yet installed ardour), for example, maybe is needed.

Thanks

User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Wireplumber is not installed correctly

Post by Impostor »

gabtram wrote: Wed Jul 26, 2023 11:40 am

Kernel 6.4.4-arch1-1 without 'threadirqs' parameter or real-time capabilities found. See also https://wiki.linuxaudio.org/wiki/system … ime_kernel
I followed the guidem can't find kernel file in boot and trying to unzip the kernel file and change the configuration maybe can't understand something

From my notes (always take notes when tweaking your system!):

-Open /etc/default/grub. Look for GRUB_CMDLINE_LINUX_DEFAULT and add threadirqs to the list of options:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash threadirqs"

Save the file and update the grub configuration:

sudo update-grub

Now reboot and you should have threaded IRQs.

User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Wireplumber is not installed correctly

Post by Impostor »

gabtram wrote: Wed Jul 26, 2023 11:40 am

These are my errors:
The scaling governor of one or more CPU's is not set to 'performance'. You can set the scaling governor to 'performance' with 'cpupower frequency-set -g performance' or 'cpufreq-set -r -g performance' (Debian/Ubuntu). See also https://wiki.linuxaudio.org/wiki/system … cy_scaling

I'd rather use cpu performance mode only when absolutely needed (almost never in fact), and then I do the switching on the fly with running the following script:
(you should adapt the script to your situation (nr of processors, file to write to)

Code: Select all

#!/bin/bash

File=/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

if ! grep -q performance "$File"; then
    for ((x=0 ; x<12 ; x++)); do
        File=/sys/devices/system/cpu/cpu$x/cpufreq/scaling_governor
        echo -n performance | sudo tee $File 1>/dev/null
    done
    echo "CPUs set to performance mode"
    read
    exit 0
else
     for ((x=0 ; x<12 ; x++)); do
        File=/sys/devices/system/cpu/cpu$x/cpufreq/scaling_governor
        echo -n ondemand | sudo tee $File 1>/dev/null
    done
    echo "CPUs set to ondemand mode"
    read
    exit 0
fi
gabtram
Established Member
Posts: 38
Joined: Wed Nov 23, 2022 12:01 pm
Been thanked: 1 time

Re: Wireplumber is not installed correctly

Post by gabtram »

Hi,

and thanks so much for you time!
I think i will change the subject of the thread.

I can say. These are actually my tweaks:

Pro audio tweaks

Code: Select all

Gab is part of realtime group
Installed realtime privilegies

/etc/security/limits.d
99-realtime-privileges.conf

Code: Select all

/etc/security/limits.conf 
@pipewire - memlock 4194304
@pipewire - nice -19
@pipewire - rtprio 95

I'm also following this: https://wiki.archlinux.org/title/Professional_audio but it's not easy :)

Thanks for your script to activate cpu scaling governor.
I made some tests yestarday with jack_iodelay, i'm using pipewire-jack

keyboard usb

Code: Select all

new capture latency: [1024, 1024]
new playback latency: [0, 0]

Signal below threshold...
 48511.416 frames   1010.655 ms total roundtrip latency
	extra loopback latency: 46463 frames
	use 23231 for the backend argu

guitar with guitarix focusrite 2i2 3gen

Code: Select all

 23911.676 frames    498.160 ms total roundtrip latency
	extra loopback latency: 21351 frames
	use 10675 for the backend arguments -I and -O ??

I think i need lower latency, the guitar and the synth are unplayable when you recording a multitrack.

The scaling governor cpu option and the kernle could be resolve this issue?

Really thanks!
Bye

User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Wireplumber is not installed correctly

Post by Impostor »

gabtram wrote: Thu Jul 27, 2023 8:42 am

I think i need lower latency, the guitar and the synth are unplayable when you recording a multitrack.
The scaling governor cpu option and the kernle could be resolve this issue?

The scaling governor setting the cpu's to performance mode just may prevent xruns from occurring due to the CPU speed dynamically varying when set to on-demand. Has nothing to do with latency afaik.

Threading IRQ's may have an effect. Just try it with and without. Only has effect on generic kernels though. If you already run a low-latency kernel this option is useless*, or so I've read.

*Guess I was wrong: see Merlyn below.

Last edited by Impostor on Thu Jul 27, 2023 1:15 pm, edited 1 time in total.
User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Wireplumber is not installed correctly

Post by Impostor »

gabtram wrote: Thu Jul 27, 2023 8:42 am

I think i need lower latency, the guitar and the synth are unplayable when you recording a multitrack.

Now, I don't use pipewire, but you should make sure that it runs "realtime" and with high enough priority. At least, that's how you'd do it for jack with qjackctl.

merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: Wireplumber is not installed correctly

Post by merlyn »

Impostor wrote: Thu Jul 27, 2023 12:51 pm

... Threading IRQ's may have an effect. Just try it with and without. Only has effect on generic kernels though. If you already run a low-latency kernel this option is useless, or so I've read. ...

It does have an effect on a low latency kernel. By default, threadirqs is not loaded with a low latency kernel. Loading threadirqs makes a low latency kernel more like a realtime kernel. Threadirqs is already loaded on a realtime kernel, so the boot option has no effect on a realtime kernel. That may have been what you were thinking of.

User avatar
bluzee
Established Member
Posts: 340
Joined: Mon Nov 30, 2020 11:43 pm
Has thanked: 18 times
Been thanked: 88 times

Re: Wireplumber realtme problem and Realtime tweaks for Pro Audio

Post by bluzee »

I'm now running the latest Pipewire on my Ham Radio computer and I can run the SDR software which is Pulse as well as Carla which is Jack to add multi band compressor for microphone. Latency is acceptable and qpwgraph makes routing easy. I can not get the latency low enough to play live with guitarix so my guitarix computer remains on Jack with Pipewire and Pulseaudio disabled. Perhaps one day Pipewire will do low enough latency, but it's not there yet.

gabtram
Established Member
Posts: 38
Joined: Wed Nov 23, 2022 12:01 pm
Been thanked: 1 time

Re: Wireplumber realtme problem and Realtime tweaks for Pro Audio

Post by gabtram »

Hi to all,

thanks for all your response.
I will take note about my tweaks and i will tell you if the low ltancy could become realtime.
I'm trying to install the RT pachset for archlinux but it's not clear to me how to add at the boot, i have to create alternative boot.
But sure i'd like to have a realtime kernel cause external instruments (my guitar or bass with focusrite) and my keyboard attached directly to my usb port, are not usable.
I recorded 8 tracks trying to reduce latency with dragging tracks before or after...but i had some headaches!

Thanks!

Post Reply