pipewire-vulkan: Start vulkan nodes via pipewire proxy server

This commit is contained in:
columbarius 2023-08-17 01:02:16 +02:00 committed by Wim Taymans
parent feb21a25f0
commit 33f98489d6
2 changed files with 115 additions and 1 deletions

View file

@ -27,6 +27,8 @@ build_ms = 'media-session' in get_option('session-managers')
build_wp = 'wireplumber' in get_option('session-managers')
default_sm = get_option('session-managers').get(0, '')
build_vk = get_option('vulkan').enabled()
summary({'Build media-session': build_ms,
'Build wireplumber': build_wp,
'Default session-manager': default_sm},
@ -75,6 +77,10 @@ conf_files = [
'pipewire-aes67.conf',
]
if build_vk
conf_files += 'pipewire-vulkan.conf'
endif
foreach c : conf_files
configure_file(input : '@0@.in'.format(c),
output : c,
@ -107,7 +113,17 @@ pipewire_exec = executable('pipewire',
ln = find_program('ln')
foreach alias : ['pipewire-pulse', 'pipewire-avb', 'pipewire-aes67']
pipewire_aliases = [
'pipewire-pulse',
'pipewire-avb',
'pipewire-aes67',
]
if build_vk
pipewire_aliases += 'pipewire-vulkan'
endif
foreach alias : pipewire_aliases
custom_target(
alias,
build_by_default: true,

View file

@ -0,0 +1,98 @@
# Config file for PipeWire version "0.3.77" #
#
# This config file should start the vulkan-compute-source/filter as proxied
# clients
#
context.properties = {
## Configure properties in the system.
#library.name.system = support/libspa-support
#context.data-loop.library.name.system = support/libspa-support
#support.dbus = true
#link.max-buffers = 64
#link.max-buffers = 16 # version < 3 clients can't handle more
#mem.warn-mlock = false
#mem.allow-mlock = true
#mem.mlock-all = false
#clock.power-of-two-quantum = true
#log.level = 4
#cpu.zero.denormals = false
#default.clock.quantum-limit = 8192
}
context.spa-libs = {
#<factory-name regex> = <library-name>
#
# Used to find spa factory names. It maps an spa factory name
# regular expression to a library name that should contain
# that factory.
#
api.vulkan.* = vulkan/libspa-vulkan
support.* = support/libspa-support
}
context.modules = [
#{ name = <module-name>
# ( args = { <key> = <value> ... } )
# ( flags = [ ( ifexists ) ( nofail ) ] )
# ( condition = [ { <key> = <value> ... } ... ] )
#}
#
# Loads a module with the given parameters.
# If ifexists is given, the module is ignored when it is not found.
# If nofail is given, module initialization failures are ignored.
# If condition is given, the module is loaded only when the context
# properties all match the match rules.
#
# Uses realtime scheduling to boost the audio thread priorities. This uses
# RTKit if the user doesn't have permission to use regular realtime
# scheduling.
{ name = libpipewire-module-rt
args = {
nice.level = -11
#rt.prio = 88
#rt.time.soft = -1
#rt.time.hard = -1
}
flags = [ ifexists nofail ]
}
# The native communication protocol.
{ name = libpipewire-module-protocol-native }
# Creates a factory for making nodes that run in the
# context of the PipeWire server.
{ 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.
{ name = libpipewire-module-client-node }
# Makes a factory for wrapping nodes in an adapter with a
# converter and resampler.
{ name = libpipewire-module-adapter }
]
context.objects = [
#{ factory = <factory-name>
# ( args = { <key> = <value> ... } )
# ( flags = [ ( nofail ) ] )
# ( condition = [ { <key> = <value> ... } ... ] )
#}
#
# Creates an object from a PipeWire factory with the given parameters.
# If nofail is given, errors are ignored (and no object is created).
# If condition is given, the object is created only when the context properties
# all match the match rules.
#
#{ 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-node-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 = vulkan-compute-source object.export = true } }
{ factory = spa-node-factory args = { factory.name = api.vulkan.compute.filter node.name = vulkan-compute-filter object.export = true } }
]