config: load reserve-device only if alsa.reserve is true

and also make the default of alsa.reserve to be false, for easier scripting
This commit is contained in:
George Kiagiadakis 2021-02-15 19:43:07 +02:00
parent 4538d43bcb
commit 1d40e7713f
3 changed files with 9 additions and 8 deletions

View file

@ -83,9 +83,6 @@ function enable_audio()
-- Implements storing metadata about objects in RAM
load_module("metadata")
-- Enables device reservation via org.freedesktop.ReserveDevice1 on D-Bus
load_module("reserve-device")
end
function enable_endpoints()

View file

@ -7,8 +7,8 @@ local properties = {
-- connect to the real JACK server.
--["alsa.jack-device"] = false,
-- Reserve devices.
--["alsa.reserve"] = true,
-- Reserve devices via org.freedesktop.ReserveDevice1 on D-Bus
["alsa.reserve"] = true,
--["alsa.reserve.priority"] = -20,
--["alsa.reserve.application-name"] = "WirePlumber",
}
@ -97,6 +97,11 @@ local rules = {
}
function enable_alsa()
-- The "reserve-device" module needs to be loaded for reservation to work
if properties["alsa.reserve"] then
load_module("reserve-device")
end
load_monitor("alsa", {
properties = properties,
rules = rules,

View file

@ -303,9 +303,8 @@ if config.properties["alsa.jack-device"] then
})
end
-- reservation is only disabled by explicitly setting it to false
if config.properties["alsa.reserve"] == true or
config.properties["alsa.reserve"] == nil then
-- enable device reservation if requested
if config.properties["alsa.reserve"] then
rd_plugin = Plugin("reserve-device")
end