diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2021-02-11 14:13:55 +0200 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2021-05-26 19:50:23 +0000 |
commit | fc722f8aea13246ce7779acbb3a59681b64131a6 (patch) | |
tree | f0ca74bffa3ed887affd3731bf1e57f6ceca614e /meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua | |
parent | b81c6beb388cafa6de9ca1baa13c3d529ca2f2d8 (diff) |
meta-pipewire: backport pipewire updates from master
Bug-AGL: SPEC-3844
Bug-AGL: SPEC-3900
Bug-AGL: SPEC-3909
Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Change-Id: I3c32d0083f31f94b49e33c3dd546515d39df7867
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26360
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tested-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua')
-rw-r--r-- | meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua new file mode 100644 index 000000000..3c04652f0 --- /dev/null +++ b/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua @@ -0,0 +1,124 @@ +-- Default policy config file -- + +default_policy = {} + +default_policy.sessions = { + -- [session name] = { session properties } + ["audio"] = { ["media.type"] = "Audio" }, + --["video"] = { ["media.type"] = "Video" }, +} + +default_policy.endpoints = { + -- [endpoint name] = { endpoint properties } + + ["endpoint.multimedia"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Multimedia", + }, + ["endpoint.speech_low"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Speech-Low", + }, + ["endpoint.custom_low"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Custom-Low", + }, + ["endpoint.navigation"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Navigation", + }, + ["endpoint.speech_high"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Speech-High", + }, + ["endpoint.custom_high"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Custom-High", + }, + ["endpoint.communication"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Communication", + }, + ["endpoint.emergency"] = { + ["media.class"] = "Audio/Sink", + ["role"] = "Emergency", + }, +} + +default_policy.policy = { + ["move"] = false, -- moves session items when metadata target.node changes + ["follow"] = true, -- moves session items to the default device when it has changed + + ["roles"] = { + ["Multimedia"] = { + ["alias"] = { "Movie", "Music", "Game" }, + ["priority"] = 25, + ["action.default"] = "cork", + }, + ["Speech-Low"] = { + ["priority"] = 30, + ["action.default"] = "cork", + ["action.Speech-Low"] = "mix", + }, + ["Custom-Low"] = { + ["priority"] = 35, + ["action.default"] = "cork", + ["action.Custom-Low"] = "mix", + }, + ["Navigation"] = { + ["priority"] = 50, + ["action.default"] = "cork", + ["action.Navigation"] = "mix", + }, + ["Speech-High"] = { + ["priority"] = 60, + ["action.default"] = "cork", + ["action.Speech-High"] = "mix", + }, + ["Custom-High"] = { + ["priority"] = 65, + ["action.default"] = "cork", + ["action.Custom-High"] = "mix", + }, + ["Communication"] = { + ["priority"] = 75, + ["action.default"] = "cork", + ["action.Communication"] = "mix", + }, + ["Emergency"] = { + ["alias"] = { "Alert" }, + ["priority"] = 99, + ["action.default"] = "cork", + ["action.Emergency"] = "mix", + }, + }, +} + +function default_policy.enable() + -- Session item factories, building blocks for the session management graph + -- Do not disable these unless you really know what you are doing + load_module("si-node") + load_module("si-audio-adapter") + load_module("si-standard-link") + load_module("si-audio-endpoint") + + -- Create sessions statically at startup + load_script("static-sessions.lua", default_policy.sessions) + + + -- Create endpoints statically at startup + load_script("static-endpoints.lua", default_policy.endpoints) + + -- Create session items for nodes that appear in the graph + load_script("create-item.lua") + + -- Link nodes to each other to make media flow in the graph + load_script("policy-node.lua", default_policy.policy) + + -- Link client nodes with endpoints to make media flow in the graph + load_script("policy-endpoint-client.lua", default_policy.policy) + load_script("policy-endpoint-client-links.lua", default_policy.policy) + + -- Link endpoints with device nodes to make media flow in the graph + load_script("policy-endpoint-device.lua", default_policy.policy) +end |