wireplumber: Fix default volume of USB PnP microphone

Taken from upstream
https://gitlab.freedesktop.org/pipewire/wireplumber/-/blob/master/src/config/main.lua.d/40-stream-defaults.lua
This commit is contained in:
Sanchayan Maity 2023-10-17 17:06:40 +05:30
parent 7bad55af50
commit 0496c7a0a0
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3

View file

@ -0,0 +1,34 @@
stream_defaults = {}
stream_defaults.enabled = true
stream_defaults.properties = {
["restore-props"] = true,
["restore-target"] = true,
["default-channel-volume"] = 0.9,
}
stream_defaults.rules = {
{
matches = {
{
{ "node.nick", "matches", "USB PnP Audio Device" },
},
},
apply_properties = {
["state.restore-props"] = false,
["state.restore-target"] = false,
["state.default-channel-volume"] = 0.9,
},
},
}
function stream_defaults.enable()
if stream_defaults.enabled == false then
return
end
load_script("restore-stream.lua", {
properties = stream_defaults.properties,
rules = stream_defaults.rules,
})
end