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