pipewire: update to pw 0.3.40 and wp 0.4.5
[AGL/meta-agl.git] / meta-pipewire / recipes-multimedia / wireplumber / wireplumber-config-agl / 10-default-policy.lua
1 -- Default policy config file --
2
3 default_policy = {}
4
5 default_policy.endpoints = {
6   -- [endpoint name] = { endpoint properties }
7
8   ["endpoint.multimedia"] = {
9     ["media.class"] = "Audio/Sink",
10     ["role"] = "Multimedia",
11   },
12   ["endpoint.speech_low"] = {
13     ["media.class"] = "Audio/Sink",
14     ["role"] = "Speech-Low",
15   },
16   ["endpoint.custom_low"] = {
17     ["media.class"] = "Audio/Sink",
18     ["role"] = "Custom-Low",
19   },
20   ["endpoint.navigation"] = {
21     ["media.class"] = "Audio/Sink",
22     ["role"] = "Navigation",
23   },
24   ["endpoint.speech_high"] = {
25     ["media.class"] = "Audio/Sink",
26     ["role"] = "Speech-High",
27   },
28   ["endpoint.custom_high"] = {
29     ["media.class"] = "Audio/Sink",
30     ["role"] = "Custom-High",
31   },
32   ["endpoint.communication"] = {
33     ["media.class"] = "Audio/Sink",
34     ["role"] = "Communication",
35   },
36   ["endpoint.emergency"] = {
37     ["media.class"] = "Audio/Sink",
38     ["role"] = "Emergency",
39   },
40 }
41
42 default_policy.policy = {
43   ["move"] = false,  -- moves session items when metadata target.node changes
44   ["follow"] = true, -- moves session items to the default device when it has changed
45
46   -- Set to 'true' to disable channel splitting & merging on nodes and enable
47   -- passthrough of audio in the same format as the format of the device.
48   -- Note that this breaks JACK support; it is generally not recommended
49   ["audio.no-dsp"] = false,
50
51   -- how much to lower the volume of lower priority streams when ducking
52   -- note that this is a linear volume modifier (not cubic as in the mixer)
53   ["duck.level"] = 0.2,
54
55   ["roles"] = {
56     ["Multimedia"] = {
57       ["alias"] = { "Movie", "Music", "Game" },
58       ["priority"] = 25,
59       ["action.default"] = "cork",
60     },
61     ["Speech-Low"] = {
62       ["priority"] = 30,
63       ["action.default"] = "cork",
64       ["action.Speech-Low"] = "mix",
65     },
66     ["Custom-Low"] = {
67       ["priority"] = 35,
68       ["action.default"] = "cork",
69       ["action.Custom-Low"] = "mix",
70     },
71     ["Navigation"] = {
72       ["priority"] = 50,
73       ["action.default"] = "duck",
74       ["action.Navigation"] = "mix",
75     },
76     ["Speech-High"] = {
77       ["priority"] = 60,
78       ["action.default"] = "cork",
79       ["action.Speech-High"] = "mix",
80     },
81     ["Custom-High"] = {
82       ["priority"] = 65,
83       ["action.default"] = "cork",
84       ["action.Custom-High"] = "mix",
85     },
86     ["Communication"] = {
87       ["priority"] = 75,
88       ["action.default"] = "cork",
89       ["action.Communication"] = "mix",
90     },
91     ["Emergency"] = {
92       ["alias"] = { "Alert" },
93       ["priority"] = 99,
94       ["action.default"] = "cork",
95       ["action.Emergency"] = "mix",
96     },
97   },
98 }
99
100 function default_policy.enable()
101   -- Session item factories, building blocks for the session management graph
102   -- Do not disable these unless you really know what you are doing
103   load_module("si-node")
104   load_module("si-audio-adapter")
105   load_module("si-standard-link")
106   load_module("si-audio-endpoint")
107
108   -- API to access default nodes from scripts
109   load_module("default-nodes-api")
110
111   -- API to access mixer controls, needed for volume ducking
112   load_module("mixer-api")
113
114   -- Create endpoints statically at startup
115   load_script("static-endpoints.lua", default_policy.endpoints)
116
117   -- Create session items for nodes that appear in the graph
118   load_script("create-item.lua", default_policy.policy)
119
120   -- Link nodes to each other to make media flow in the graph
121   load_script("policy-node.lua", default_policy.policy)
122
123   -- Link client nodes with endpoints to make media flow in the graph
124   load_script("policy-endpoint-client.lua", default_policy.policy)
125   load_script("policy-endpoint-client-links.lua", default_policy.policy)
126
127   -- Link endpoints with device nodes to make media flow in the graph
128   load_script("policy-endpoint-device.lua", default_policy.policy)
129 end