1
ˆ
ƒ�‹_•I|¥‰ÓMdœv ©ƒ&íK<óo¬À¿ œ
Index of /FSS-OZR/root/sys/dev/char/4:23/subsystem/tty/power
Index of /FSS-OZR/root/sys/dev/char/4:23/subsystem/tty/power
ˆÂÁ
0À¿ " ˆl–Ãa¾”ÔD¨ µÕÆ™¸ÛªbÑ¿Â
ƒtM·ÁÀ W -- WirePlumber
--
-- Copyright © 2025 Collabora Ltd.
-- @author Julian Bouzas
--
-- SPDX-License-Identifier: MIT
cutils = require ("common-utils")
log = Log.open_topic ("s-automute-alsa-routes")
function setRoute (device, route, mute)
local param = Pod.Object {
"Spa:Pod:Object:Param:Route", "Route",
index = route.index,
device = route.device,
props = Pod.Object {
"Spa:Pod:Object:Param:Props", "Route",
mute = mute
},
save = false,
}
log:info (device, "Setting mute to " .. tostring(mute) ..
" on route " .. route.name)
device:set_param("Route", param)
end
function findLowestPriorityAvailableOutputRoute (device)
local lowest_prio_r = nil
for p in device:iterate_params("Route") do
local route = cutils.parseParam (p, "Route")
if route and route.direction == "Output" and route.available ~= "no" then
if lowest_prio_r == nil or lowest_prio_r.priority > route.priority then
lowest_prio_r = route
end
end
end
return lowest_prio_r
end
function evaluateNode (node, source)
if nodes_info [node.id] == nil then
return
end
-- Get node info
local node_state = nodes_info [node.id].state
local node_api = nodes_info [node.id].api
local node_dev_id = nodes_info [node.id].dev_id
local node_cpd = nodes_info [node.id].cpd
-- Don't do anything if node was not running
if node_state ~= "running" then
return
end
-- Emite event if setting is enabled for this API
local mute_alsa = Settings.get_boolean ("device.routes.mute-on-alsa-playback-removed")
local mute_bluez = Settings.get_boolean ("device.routes.mute-on-bluetooth-playback-removed")
if (mute_alsa and node_api == "alsa") or
(mute_bluez and node_api == "bluez5") then
local e = source:call ("create-event", "mute-alsa-devices", nil, nil)
e:set_data ("device-id", node_dev_id)
e:set_data ("card-profile-device", node_cpd)
EventDispatcher.push_event (e)
end
end
mute_alsa_devices_hook = SimpleEventHook {
name = "device/mute-alsa-devices",
interests = {
EventInterest {
Constraint { "event.type", "=", "mute-alsa-devices" },
},
},
execute = function (event)
local source = event:get_source ()
local dev_id = tonum