conf: improve config files

Make arrays from config sections that should really be an array.
Having the module name as the object key technically makes it
impossible to load the same module twice because the key can only
be once in the object.

The same applies to the context.objects and context.exec sections.

This also makes it somewhat easier to parse the config..
This commit is contained in:
Wim Taymans 2021-03-12 12:39:58 +01:00
parent 86cf4ad5a5
commit 90b0410280
7 changed files with 171 additions and 168 deletions

View file

@ -44,8 +44,8 @@ context.spa-libs = {
#audiotestsrc = audiotestsrc/libspa-audiotestsrc
}
context.modules = {
#<module-name> = {
context.modules = [
#{ name = <module-name>
# [ args = { <key> = <value> ... } ]
# [ flags = [ [ ifexists ] [ nofail ] ]
#}
@ -56,7 +56,7 @@ context.modules = {
#
# Uses RTKit to boost the data thread priority.
libpipewire-module-rtkit = {
{ name = libpipewire-module-rtkit
args = {
#nice.level = -11
#rt.prio = 88
@ -67,44 +67,44 @@ context.modules = {
}
# The native communication protocol.
libpipewire-module-protocol-native = null
{ name = libpipewire-module-protocol-native }
# The profile module. Allows application to access profiler
# and performance data. It provides an interface that is used
# by pw-top and pw-profiler.
libpipewire-module-profiler = null
{ name = libpipewire-module-profiler }
# Allows applications to create metadata objects. It creates
# a factory for Metadata objects.
libpipewire-module-metadata = null
{ name = libpipewire-module-metadata }
# Creates a factory for making devices that run in the
# context of the PipeWire server.
libpipewire-module-spa-device-factory = null
{ name = libpipewire-module-spa-device-factory }
# Creates a factory for making nodes that run in the
# context of the PipeWire server.
libpipewire-module-spa-node-factory = null
{ name = libpipewire-module-spa-node-factory }
# Allows creating nodes that run in the context of the
# client. Is used by all clients that want to provide
# data to PipeWire.
libpipewire-module-client-node = null
{ name = libpipewire-module-client-node }
# Allows creating devices that run in the context of the
# client. Is used by the session manager.
libpipewire-module-client-device = null
{ name = libpipewire-module-client-device }
# The portal module monitors the PID of the portal process
# and tags connections with the same PID as portal
# connections.
libpipewire-module-portal = {
{ name = libpipewire-module-portal
flags = [ ifexists nofail ]
}
# The access module can perform access checks and block
# new clients.
libpipewire-module-access = {
{ name = libpipewire-module-access
args = {
# access.allowed to list an array of paths of allowed
# apps.
@ -126,17 +126,17 @@ context.modules = {
# Makes a factory for wrapping nodes in an adapter with a
# converter and resampler.
libpipewire-module-adapter = null
{ name = libpipewire-module-adapter }
# Makes a factory for creating links between ports.
libpipewire-module-link-factory = null
{ name = libpipewire-module-link-factory }
# Provides factories to make session manager objects.
libpipewire-module-session-manager = null
}
{ name = libpipewire-module-session-manager }
]
context.objects = {
#<factory-name> = {
context.objects = [
#{ factory = <factory-name>
# [ args = { <key> = <value> ... } ]
# [ flags = [ [ nofail ] ]
#}
@ -144,16 +144,16 @@ context.objects = {
# Creates an object from a PipeWire factory with the given parameters.
# If nofail is given, errors are ignored (and no object is created).
#
#spa-node-factory = { args = { factory.name = videotestsrc node.name = videotestsrc Spa:Pod:Object:Param:Props:patternType = 1 } }
#spa-device-factory = { args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] }
#spa-device-factory = { args = { factory.name = api.alsa.enum.udev } }
#spa-device-factory = { args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } }
#adapter = { args = { factory.name = audiotestsrc node.name = my-test } }
#spa-node-factory = { args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } }
#{ factory = spa-node-factory args = { factory.name = videotestsrc node.name = videotestsrc Spa:Pod:Object:Param:Props:patternType = 1 } }
#{ factory = spa-device-factory args = { factory.name = api.jack.device foo=bar } flags = [ nofail ] }
#{ factory = spa-device-factory args = { factory.name = api.alsa.enum.udev } }
#{ factory = spa-device-factory args = { factory.name = api.alsa.seq.bridge node.name = Internal-MIDI-Bridge } }
#{ factory = adapter args = { factory.name = audiotestsrc node.name = my-test } }
#{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.source node.name = my-compute-source } }
# A default dummy driver. This handles nodes marked with the "node.always-driver"
# property when no other driver is currently active. JACK clients need this.
spa-node-factory = {
{ factory = spa-node-factory
args = {
factory.name = support.node.driver
node.name = Dummy-Driver
@ -162,7 +162,7 @@ context.objects = {
}
# This creates a new Source node. It will have input ports
# that you can link, to provide audio for this source.
#adapter = {
#{ factory = adapter
# args = {
# factory.name = support.null-audio-sink
# node.name = "my-mic"
@ -175,7 +175,7 @@ context.objects = {
# This creates a single PCM source device for the given
# alsa device path hw:0. You can change source to sink
# to make a sink in the same way.
#adapter = {
#{ factory = adapter
# args = {
# factory.name = api.alsa.pcm.source
# node.name = "alsa-source"
@ -192,10 +192,10 @@ context.objects = {
# #audio.position = "FL,FR"
# }
#}
}
]
context.exec = {
#<program-name> = { [ args = "<arguments>" ] }
context.exec = [
#{ path = <program-name> [ args = "<arguments>" ] }
#
# Execute the given program with arguments.
#
@ -203,12 +203,12 @@ context.exec = {
# but it is better to start it as a systemd service.
# Run the session manager with -h for options.
#
@comment@"@media_session_path@" = { args = "" }
@comment@{ path = "@media_session_path@" args = "" }
#
# You can optionally start the pulseaudio-server here as well
# but it is better to start it as a systemd service.
# It can be interesting to start another daemon here that listens
# on another address with the -a option (eg. -a tcp:4713).
#
@comment@"@pipewire_path@" = { args = "-c pipewire-pulse.conf" }
}
@comment@{ path = "@pipewire_path@" args = "-c pipewire-pulse.conf" }
]