context: add support for multiple data loops

Add config options to create and start multiple data loops, each with
their own priority and thread affinity if requested.

Make it possible to assign loop.classes to the data-loops. Use the
node.loop.class to find a data-loop for the node of the same class. Try
to evenly spread the nodes over the available matching loops.

With this, it is possible to separate the processing of the nodes
depending on the classes, like audio/video and improve concurency on
the server.

No attempt is done yet to move nodes between loops or to move
independent nodes to separate data loops.

Fixes #3969
This commit is contained in:
Wim Taymans 2024-04-19 14:57:53 +02:00
parent e85bb7194b
commit a4bfdd7f82
10 changed files with 331 additions and 63 deletions

View file

@ -22,6 +22,20 @@ context.properties = {
#log.level = 2
#cpu.zero.denormals = false
#loop.rt-prio = -1 # -1 = use module-rt prio, 0 disable rt
#loop.class = data.rt
#thread.affinity = [ 0 1 ] # optional array of CPUs
#context.num-data-loops = 1 # -1 = num-cpus, 0 = no data loops
#
#context.data-loops = [
# { loop.rt-prio = -1
# loop.class = [ data.rt audio.rt ]
# #library.name.system = support/libspa-support
# thread.name = data-loop.0
# #thread.affinity = [ 0 1 ] # optional array of CPUs
# }
#]
core.daemon = true # listening for socket connections
core.name = pipewire-0 # core name and socket name