summaryrefslogtreecommitdiffstats
path: root/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-09-20 14:29:45 +0300
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-10-14 15:21:16 +0000
commit1b0d65113b277610135b5599c8810ca7a4e3df4c (patch)
treec3579bbc0795fb8cb26c36505742edd84b383acb /meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua
parent3b7fb84007945e5b19c705b24179260cad05ba55 (diff)
meta-agl: split wireplumber to run in multiple instances
The "IC SoundManager" design specifies that there needs to be a session manager running in the host to manage devices and permissions, but all the domain-specific policy and app management needs to run in the IVI container, together with the apps. With this split, we are able to achieve that. In addition to the "host" and "policy" instances, we are also adding a "bluetooth" one, which loads the bluetooth plugin and manages the bluetooth device. This can be moved to the IVI container as well, or elsewhere... it only depends on bluez (so it must run in the same container as bluez). For now, given the absence of an IVI container in the lxc-demo image, all instances are running in the host, but it is trivial to move all the non-host ones to another container later. To compliment pipewire-ic-ipc, this change also adds an "alsa-suspend" lua script that runs in the context of the "host" wireplumber instance and its purpose is to mute pipewire-managed alsa devices when there is a sound playing in the IC container (on another alsa device). Finally, this change also adds V4L2 configuration in the "host" wireplumber instance, which is still disabled (and untested), but you can easily enable it for experimentation by uncommenting the relevant line in host.lua.d/90-enable-all.lua Bug-AGL: SPEC-4027 Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com> Change-Id: I9febc4f3919e7c559a5d7d32bfe7bc95c75934f2 Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/26662 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Naoto YAMAGUCHI <naoto.yamaguchi@aisin.co.jp> Reviewed-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.lua124
1 files changed, 0 insertions, 124 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
deleted file mode 100644
index f71b31316..000000000
--- a/meta-pipewire/recipes-multimedia/wireplumber/wireplumber-config-agl/10-default-policy.lua
+++ /dev/null
@@ -1,124 +0,0 @@
--- Default policy config file --
-
-default_policy = {}
-
-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
-
- -- how much to lower the volume of lower priority streams when ducking
- -- note that this is a linear volume modifier (not cubic as in the mixer)
- ["duck.level"] = 0.2,
-
- ["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"] = "duck",
- ["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")
-
- -- API to access default nodes from scripts
- load_module("default-nodes-api")
-
- -- API to access mixer controls, needed for volume ducking
- load_module("mixer-api")
-
- -- 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