... | ... | @@ -17,7 +17,7 @@ Kernel 5.16 brings important latency improvements for USB devices. It also inclu |
|
|
|
|
|
Realtime priorities are given to the data processing threads in both the clients and the server.
|
|
|
|
|
|
There are currently 2 modules that implement this, a native pthread implementation and one based on RTkit.
|
|
|
Since 0.3.44 there is a single module-rt that can use RTKit and fall back to native thread implementation automatically.
|
|
|
|
|
|
The RTKit implementation is potentially better because it can implement a global policy and does not require extra permissions from the client. It however needs DBus and is currently not configured optimally in many distributions. It also does not work with flatpaks because it does not know about the namespace of the thread ids in the sandbox.
|
|
|
|
... | ... | @@ -34,8 +34,8 @@ The relevant module is enabled in the `context.modules` section: |
|
|
|
|
|
```
|
|
|
context.modules = [
|
|
|
# Uses RTKit to boost the data thread priority.
|
|
|
{ name = libpipewire-module-rtkit
|
|
|
# boost the data thread priority.
|
|
|
{ name = libpipewire-module-rt
|
|
|
args = {
|
|
|
#nice.level = -11
|
|
|
#rt.prio = 88
|
... | ... | @@ -46,7 +46,7 @@ context.modules = [ |
|
|
}
|
|
|
....
|
|
|
```
|
|
|
Use `libpipewire-module-rtkit` or `libpipewire-module-rt` to select the RTKit or native thread implementation respectively. The arguments for both modules are the same.
|
|
|
Use `libpipewire-module-rt` to select the RTKit and native thread implementation.
|
|
|
|
|
|
- `nice.level` this will be the nice value set for the application thread. It improves performance of the communication with the pipewire daemon.
|
|
|
- `rt.prio` this is the realtime priority of the data thread. Higher values are higher priority.
|
... | ... | @@ -104,6 +104,8 @@ RTKIT_ARGS="--scheduling-policy=FIFO |
|
|
|
|
|
ALSA USB devices can be tuned for latency with the `api.alsa.period-size` property.
|
|
|
|
|
|
Since 0.3.43 this tuning is done automatically when the device is opened and based on the graph quantum.
|
|
|
|
|
|
See [here](https://gitlab.freedesktop.org/pipewire/media-session/-/wikis/Config-ALSA#alsa-buffer-properties) for tuning the period-size.
|
|
|
|
|
|
See [here](https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/Performance#pipewire-0331-tuned) for some measurements with a tuned ALSA USB device.
|
... | ... | @@ -116,11 +118,13 @@ Firefox can start `speech-dispatcher-dummy` and `speech-dispatcher-espeak-ng` in |
|
|
|
|
|
You can disable this by setting `media.webspeech.synth.enabled` to `false` in `about:config`.
|
|
|
|
|
|
Since 0.3.44 the pulse-server has a quirk to force a higher quantum on speech dispatcher, which should avoid the problem.
|
|
|
|
|
|
# Profiling
|
|
|
|
|
|
`pw-top` can be used to get a realtime overview of the various nodes in the graph.
|
|
|
|
|
|
The `pw-profiler` tool can be used to collect statistics about PipeWire and turn them into images that can be displayed in the browser. Run `pw-profiler` in a terminal, let ir collect information and then stop it. It will output a script and an html file in the current directory with instructions on how to display the generated graphs.
|
|
|
The `pw-profiler` tool can be used to collect statistics about PipeWire and turn them into images that can be displayed in the browser. Run `pw-profiler` in a terminal, let it collect information and then stop it. It will output a script and an html file in the current directory with instructions on how to display the generated graphs.
|
|
|
|
|
|
# Further Reading
|
|
|
|
... | ... | |