pulse-server: handle pulse.properties

Load properties from pulse.properties section so that they can have
overrides.
This commit is contained in:
Wim Taymans 2022-03-02 17:53:08 +01:00
parent 6c4d3a5158
commit 5a55e1a47a
2 changed files with 33 additions and 26 deletions

View file

@ -40,32 +40,8 @@ context.modules = [
{ name = libpipewire-module-protocol-pulse
args = {
# the addresses this server listens on
server.address = [
"unix:native"
#"unix:/tmp/something" # absolute paths may be used
#"tcp:4713" # IPv4 and IPv6 on all addresses
#"tcp:[::]:9999" # IPv6 on all addresses
#"tcp:127.0.0.1:8888" # IPv4 on a single address
#
#{ address = "tcp:4713" # address
# max-clients = 64 # maximum number of clients
# listen-backlog = 32 # backlog in the server listen queue
# client.access = "restricted" # permissions for clients
#}
]
#pulse.min.req = 256/48000 # 5ms
#pulse.default.req = 960/48000 # 20 milliseconds
#pulse.min.frag = 256/48000 # 5ms
#pulse.default.frag = 96000/48000 # 2 seconds
#pulse.default.tlength = 96000/48000 # 2 seconds
#pulse.min.quantum = 256/48000 # 5ms
#pulse.default.format = F32
#pulse.default.position = [ FL FR ]
# These overrides are only applied when running in a vm.
vm.overrides = {
pulse.min.quantum = 1024/48000 # 22ms
}
# contents of pulse.properties can also be placed here
# to have config per server.
}
}
]
@ -91,6 +67,35 @@ stream.properties = {
#channelmix.hilbert-taps = 0
}
pulse.properties = {
# the addresses this server listens on
server.address = [
"unix:native"
#"unix:/tmp/something" # absolute paths may be used
#"tcp:4713" # IPv4 and IPv6 on all addresses
#"tcp:[::]:9999" # IPv6 on all addresses
#"tcp:127.0.0.1:8888" # IPv4 on a single address
#
#{ address = "tcp:4713" # address
# max-clients = 64 # maximum number of clients
# listen-backlog = 32 # backlog in the server listen queue
# client.access = "restricted" # permissions for clients
#}
]
#pulse.min.req = 256/48000 # 5ms
#pulse.default.req = 960/48000 # 20 milliseconds
#pulse.min.frag = 256/48000 # 5ms
#pulse.default.frag = 96000/48000 # 2 seconds
#pulse.default.tlength = 96000/48000 # 2 seconds
#pulse.min.quantum = 256/48000 # 5ms
#pulse.default.format = F32
#pulse.default.position = [ FL FR ]
# These overrides are only applied when running in a vm.
vm.overrides = {
pulse.min.quantum = 1024/48000 # 22ms
}
}
# client/stream specific properties
pulse.rules = [
{

View file

@ -5350,6 +5350,8 @@ struct pw_protocol_pulse *pw_protocol_pulse_new(struct pw_context *context,
support = pw_context_get_support(context, &n_support);
cpu = spa_support_find(support, n_support, SPA_TYPE_INTERFACE_CPU);
pw_context_conf_update_props(context, "pulse.properties", props);
if ((str = pw_properties_get(props, "vm.overrides")) != NULL) {
if (cpu != NULL && spa_cpu_get_vm_type(cpu) != SPA_CPU_VM_NONE)
pw_properties_update_string(props, str, strlen(str));